Commit Graph

72 Commits

Author SHA1 Message Date
Thomas Van Lenten
d089f04ae5 Merge pull request #1595 from thomasvl/objc_travis_tweaks
Automated testing tweaks for ObjC
2016-05-25 10:05:31 -04:00
Thomas Van Lenten
368a2f4cee Automated testing tweaks for ObjC
- Move the ObjC tests into the list and exclude them on linux, this will change
  where in the order they start, since they are longer, it will have other
  things run in parallel instead of them ending up last and taking the longest.
- Switch to the Xcode 7.3 image.
- Drop the use of xctool and stream line things through the full_mac_build.sh
  script. This means we end up with only one build script instead of two.
- Tweaks to the mac build script:
  - Make iOS Xcode version support explicit
  - Support Debug/Release only building
  - Change the OS X min parallel count to 2 to better deal with VMs.
- Split the travis ios tests into the two Xcode Configurations as the logs are
  choking travis.
2016-05-24 15:39:36 -04:00
Thomas Van Lenten
7da023b892 Better support for using the proto library from a framework.
- Add generator constant for the default framework name.
- Add generator api for making the CPP symbol from the name.
- Add generator api to see if it is a bundled proto file.
- Output a CPP conditional and two imports for the core library headers.
- Add helper for generating the #import for file headers to deal with the
  framework imports.
- Add a reference from the unittests to a WKT to use that to inspect how
  imports generate.
- Update the podspec to define the CPP symbol and require pods 1.0 (or later).

Fixes https://github.com/google/protobuf/issues/1457
2016-05-24 09:25:02 -04:00
Thomas Van Lenten
6c47faa890 Make the CocoaPods integration tests more robust
- Env solution doesn't seem to always work, use template pod files and copy
  them in place instead.
- Flush the pods cache before and after runs.
- Make pod install verbose to have the info incase something goes wrong.
2016-05-20 11:06:43 -04:00
Thomas Van Lenten
20b5bf624f Add shared schemes for the CocoaPods integration tests
Otherwise the projects have to be opened once to create user schemes for the
command line builds to work.
2016-05-19 16:47:35 -04:00
Thomas Van Lenten
16dd477a29 CocoaPod Integration Tests
- Add an Xcode 6.3 created default iOS Project.
- Add an Xcode 6.3 created default OS X Project.
- Add Podfiles to for both that use Protobufs from within the tree.
- Add a script to run the tests (and cleanup) to help confirm the state of the
  Protobuf.podspec and sources.
2016-05-19 14:31:39 -04:00
Thomas Van Lenten
daec44fa52 Expand the OS X/Xcode gitignores
- Add the folder CocoaPods will add to the root folder.
- Move and expand the entries in the objectivec directory.
2016-05-19 10:08:51 -04:00
Thomas Van Lenten
4755bdc5f9 Declare an init and avoid passing NULL to initWithValue:count:
Fixes https://github.com/google/protobuf/issues/1189
2016-05-10 11:15:51 -04:00
Jisi Liu
e0df23ac14 Update descritpor protos for objc 2016-04-29 11:41:38 -07:00
Jisi Liu
454d5be8d3 Merge the script fix. 2016-04-29 11:35:59 -07:00
Jisi Liu
cf7e99db96 Fix cp -r usage to be portable.
cp -r foo/ bar/ in linux will create a bar/foo directoy. In the
objectivec generate descritpor case, well known types will be created in
objectivec/google/google/protobuf/.. if the command is run under linux.

Adding the trailing period fixes the behavior inconsistency.
2016-04-29 11:31:57 -07:00
Jisi Liu
12fdeb9b41 Merge branch 'master' of github.com:google/protobuf 2016-04-28 14:43:08 -07:00
Jisi Liu
cf14183bcd Down integrate from Google internal. 2016-04-28 14:34:59 -07:00
Thomas Van Lenten
30646288ad Fix up -hash/-isEqual: for bool storage.
Both methods weren't checking the has_bits (where the bools are stored), so
it resulted in invalid results.

Add a test that should shake out something like this in the future also.
2016-04-27 13:57:11 -04:00
Thomas Van Lenten
18b6a321b5 Proper checking of enum with non zero default
proto2 syntax allows the first enum to have a non zero value. This means any
field using that default has a non zero default without having an explicit
default being set. So when deciding what runtime info is needed, don't rely
on an explicit default, always check that the values aren't zero.

Fixes https://github.com/google/protobuf/issues/1453
2016-04-26 15:15:49 -04:00
Thomas Van Lenten
511f28b73a ObjC support for failing the build in the generated WKTs are out of date
- Always generated into a temp directory so we can see if things changed.
- Add a flag to control exiting with error when stale vs updating.

This should let the continuous builds error out when ObjC needs to have the
checked in sources updated.
2016-04-20 10:14:18 -04:00
Thomas Van Lenten
e664aa6d91 Regenerate the WKT to pick up current changes to the proto files. 2016-04-19 13:13:04 -04:00
Thomas Van Lenten
3633bcd5e4 Fix comment typo 2016-04-19 12:40:37 -04:00
Thomas Van Lenten
28c5c25397 Merge pull request #1391 from thomasvl/string_tweaks
ObjC String followups: one test case only addition, behavior change for invalid UTF-8
2016-04-06 15:52:17 -04:00
Geoffrey Wiseman
f98d2f5147 Updating Xcode Settings to use iOS 9.3
Update the simulators used for some tests under Xcode 7.3 to be iOS 9.3.
2016-04-06 15:29:52 -04:00
Thomas Van Lenten
c9167f2acd Error during parsing for invalid UTF-8 instead of dropping dropping data.
This seems to be some code evolution side effects. Back when there was a custom
string class, we couldn't really error when we finally saw the string was bad
so we had to return the empty string, but now that full validation is done
up front, it can error out.
2016-04-05 17:16:33 -04:00
Thomas Van Lenten
f3f5b3fb64 Add tests to ensure we read strings with BOMs so we don't forget about lessons of the past. 2016-04-05 17:16:33 -04:00
Thomas Van Lenten
331cee5022 Add -position and -isAtEnd for use when manually parsing input streams. 2016-04-01 12:26:15 -04:00
Thomas Van Lenten
3f917447e7 The message was autoreleased, the -releases are an over release. 2016-03-24 15:25:21 -04:00
Thomas Van Lenten
bd41a39f69 Only create the readonlySemaphore on demand.
This will lower the amount of dispatch_semaphores created per Message when the
full object tree isn't walked in a way that would require them to be created.
Uses a dispatch_once_t for one time init of the dispatch_semaphore.
2016-03-21 11:11:14 -04:00
Thomas Van Lenten
79a23c435c Shrink ObjC overhead (generated size and some runtime sizes)
NOTE: This is a binary breaking change as structure sizes have changed size
and/or order.

- Drop capturing field options, no other options were captured and other mobile
  targeted languages don't try to capture this sort information (saved 8
  bytes for every field defined (in static data and again in field descriptor
  instance size data).
- No longer generate/compile in the messages/enums in descriptor.proto. If
  developers need it, they should generate it and compile it in. Reduced the
  overhead of the core library.
- Compute the number of has_bits actually needs to avoid over reserving.
- Let the boolean single fields store via a has_bit to avoid storage, makes
  the common cases of the instance size smaller.
- Reorder some flags and down size the enums to contain the bits needed.
- Reorder the items in the structures to manually ensure they are are packed
  better (especially when generating 64bit code - 8 bytes for every field,
  16 bytes for every extension, instance sizes 8 bytes also).
- Split off the structure initialization so when the default is zero, the
  generated static storage doesn't need to reserve the space. This is batched
  at the message level, so all the fields for the message have to have zero
  defaults to get the saves. By definition all proto3 syntax  files fall into
  this case but it also saves space for the proto2 that use the standard
  defaults. (saves 8 bytes of static data for every field that had a zero
  default)
- Don't track the enums defined by a message. Nothing in the runtime needs it
  and it was just generation and runtime overhead. (saves 8 bytes per enum)
- Ensure EnumDescriptors are started up threadsafe in all cases.
- Split some of the Descriptor initialization into multiple methods so the
  generated code isn't padded with lots of zero/nil args.
- Change how oneof info is feed to the runtime enabling us to generate less
  static data (8 bytes saved per oneof for 64bit).
- Change how enum value informat is capture to pack the data and only decode
  it if it ends up being needed. Avoids padding issues causing bloat of 64bit,
  and removes the needs for extra pointers in addition to the data (just the
  data and one pointer now).
2016-03-17 10:04:21 -04:00
Thomas Van Lenten
1bf4b38f29 Fix up handing of fields with leading names that should be all caps.
Add a compile test to confirm things are working as expected.
2016-03-08 09:29:49 -05:00
Thomas Van Lenten
36650a07cf HeaderDoc support in the library and generated sources
- Convert most of the core library headers over to HeaderDoc format.
- Switch the generated comments over to HeaderDoc.
- Create GPBCodedOutputStream_PackagePrivate and move some things into there
  that should be more internal.
2016-03-07 12:07:03 -05:00
Thomas Van Lenten
2480acb6d9 Support ObjC Generic Collections
- Extend GPB*ObjectDictionary to support generic syntax.
- Update the generator to output generics so the enclosed type is exposed for compiler checks.
- Use generics in a the public interfaces.
- Update the generated sources that are checked in.
2016-02-18 13:55:59 -05:00
Thomas Van Lenten
1324119a42 Bump up travis to Xcode 7.2
- Update simulator versions used.
- Mark the iOS tests as flaky while trying to dig out the root cause.
2016-02-16 09:19:50 -05:00
Dongjoon Hyun
86325d7c95 Rewrap the line 2016-02-11 12:47:52 -08:00
Dongjoon Hyun
7a9040fe7f Remove redundant the in comments. 2016-02-03 15:27:27 -08:00
Jisi Liu
5221dcbe47 Integrate from google internal.
Java files are moved to un-do the hack in the prevous commit, which
moved the java files to the original position for integration.
2016-01-29 13:51:05 -08:00
Feng Xiao
da2eb68dd3 Merge pull request #1129 from dongjoon-hyun/fix_typos_in_README_and_CHANGES
Fix typos in README.md/CHANGES.txt
2016-01-12 10:54:44 -08:00
Thomas Van Lenten
4d663376e2 Release the semaphore in dealloc, fixing leak. 2016-01-12 09:04:08 -05:00
Dongjoon Hyun
7b08d49e9d Fix typos in README.md/CHANGES.txt 2016-01-11 14:52:01 -08:00
Thomas Van Lenten
0e42ed30cb Remove the stale reference to test no longer around, and keep the performance test limited to just performance tests. 2016-01-07 10:31:33 -05:00
Thomas Van Lenten
fcce7842fc Update objectivec/google/protobuf/Type.pbobjc.m
commit e841bac4fc seems to have updated the
generated .pbobjc.h but not the .pbobjc.m to match.
2016-01-05 15:23:50 -05:00
Thomas Van Lenten
ca428c1bc9 Have the tests rely on the autocreator behaviors.
Incase developers look at the tests for examples, have them rely on the
autocreators also.
2016-01-05 14:25:17 -05:00
Feng Xiao
d217808417 Merge branch master into v3.0.0-beta-2 2015-12-21 00:34:19 -08:00
Thomas Van Lenten
d6590d6534 Drop all use of OSSpinLock
Apple engineers have pointed out that OSSpinLocks are vulnerable to live locking
on iOS in cases of priority inversion:
. http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/
. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html

- Use a dispatch_semaphore_t within the extension registry.
- Use a dispatch_semaphore_t for protecting autocreation within messages.
- Drop the custom/internal GPBString class since we don't have really good
  numbers to judge the locking replacements and it isn't required. We can
  always bring it back with real data in the future.
2015-12-17 16:05:50 -05:00
Feng Xiao
e841bac4fc Down-integrate from internal code base. 2015-12-11 17:10:28 -08:00
Thomas Van Lenten
938ba41039 Update the min toolchain for iOS/OS X to be Xcode 7
- Let Xcode update the projects, schemes, and info.plists.
- Add workaround for shallow analyzer issues in current Xcode versions (deep analyze gets things correct).
- Tweak the Swift based tests to avoid warnings from Xcode 7's XCTest using optionals for autoenclosure results.
- No longer tag the ObjC iOS travis test as flaky, xctool seems to manage the simulator pretty well.
2015-12-10 16:40:10 -05:00
Thomas Van Lenten
52b8d3fe78 Use compiler provided static assert and avoid tripping unused-local-typedef warnings. 2015-12-08 17:18:35 -05:00
Thomas Van Lenten
c27833b632 Enable CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION for the projects. 2015-12-07 10:49:30 -05:00
Thomas Van Lenten
536059e569 Tweak the error message as the generate is in the core binary these days. 2015-12-02 14:43:29 -05:00
Thomas Van Lenten
20b4e84f42 Merge pull request #1020 from thomasvl/block_nil
Check and throw errors for nil values/keys (like NSDictionary).
2015-12-02 14:15:03 -05:00
Thomas Van Lenten
c3a0cf74fe Check and throw errors for nil values/keys (like NSDictionary). 2015-12-02 12:53:35 -05:00
Thomas Van Lenten
69d713fc3c Ensure the conformance build of objc code is using the Mac OS X SDK and 2015-12-02 11:48:14 -05:00
Osman Cihangir
f1e14fba23 Update GPBProtocolBuffers.h 2015-11-24 00:16:29 +02:00