objc_library really will only build for Apple platforms, so tag it as such.
The objc conformance test really will only build/run on macOS, so tag it as
such.
With these two changes, it should be safer for recursive builds that include
this directory no matter what the host platform is.
PiperOrigin-RevId: 508438744
Since the sources can't reference each other, this is what helps keep them in
sync. Move it out to be a stand alone test in bazel instead of having it wired
into the Xcode projects.
PiperOrigin-RevId: 508429454
Move Field & Extension support for lack of UsesClassRef into the legacy api
so the only things taking the hit are old generate code.
PiperOrigin-RevId: 508074967
Add a new generator interface to:
- provide the message name directly instead of the overhead needed to try and compute it
- provide the data for the GPBFileDescriptor as a struct.
This allows -[GPBMessage fullName] to much more easily compute the fullname.
It also will allow the creation of all GPBFileDescriptors to be done on demand thus reducing the work in the startup codepaths as well as reducing memory requirements.
The generation changes are in a following commit.
PiperOrigin-RevId: 508063366
In order to flip the flag, all downstream projects should be adapted. However, it is hard to fix them all if there are constant regressions. Adding it to the CI will ensure that once the project can build with incompatible_disallow_empty_glob it can keep building like that.
See: bazelbuild/bazel#15327
PiperOrigin-RevId: 507927389
Include option to skip it if it was installed.
https://github.com/tuist/xcbeautify would also be an option (it supports bazel to),
but we'd have to install it.
PiperOrigin-RevId: 507852912
This slows down the build and hasn't had an issue in a really long time. The
support is still there, so it can be manually run at any time from within Xcode.
PiperOrigin-RevId: 507810543
This uses ccache + github caching to substantially decrease the time it takes to run XCode builds. Due to Bazel caching, these are some of our slowest tests, causing one of the biggest presubmit bottlenecks
PiperOrigin-RevId: 507794241
There already are explicit checks in debug builds, but this adds an addition
check within all builds to catch when unknown flags are being passed to the
runtime, which is an indication that the source generation is from a newer
version of the library.
PiperOrigin-RevId: 506091257
Descriptor was relying on the Root for the runtime check, but since the Root is
only startup up when needed, add the debug runtime check to the cases where the
Root isn't started up.
EnumDescriptors are normally started up by fields, but a developer could
directly call the public apis, so add the debug runtime check for safety sake.
PiperOrigin-RevId: 506062884
Looking back through history, figure out each place a generation change was
added and added compile asserts to help leave signals for what can be cleaned up
when if the legacy support is ever moved forward.
PiperOrigin-RevId: 506020387
Several of the classes vended by the runtime don't really support subclassing,
so mark them as such to get compiler enforcement just in case.
PiperOrigin-RevId: 505221732
Since it really just wraps some basic types, there are lots of instances
that are actually the same content wise, so to better match the contract
for NSObject it should compare the fields.
PiperOrigin-RevId: 505167021
The root class only needs to be started up if the message scopes extensions.
This updates the startup flows so the root is only started when the message
scopes extensions and thus the runtime requires that startup.
Bump the generated source version to account for the new initializer that
doesn't take the rootClass argument.
Fix typo while at it.
PiperOrigin-RevId: 504899046
For normal fields, closed enums get their out of range values put into unknown
fields, but that wasn't happening for extension fields, this fixes that by
adding the validation during parsing.
Also document on the getExtension API what happens with enums.
Add tests to confirm expected behaviors.
PiperOrigin-RevId: 491356730
Create/Collect all the MessageGenerators/EnumGenerators/ExtensionGeneators up at
the FileGenerator level and remove the need for some helpers and need for
generation apis to recurse through the generators.
The only change to the .pbobjc.m files is positionally where the enum support
for nested enums appears, it now is the same order as it was in the .pbobjc.h
files instead of being closer the the type it was nested in.
PiperOrigin-RevId: 491343515
The avoids passing four arguments and instead just passes one, so there tradeoff
in code is likely slightly better and from a perf pov, likely a wash.
PiperOrigin-RevId: 490540510
Xcode 14 is warning:
```
warning: Run script build phase 'Script: Check Runtime Stamps' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'UnitTests' from project 'ProtocolBuffers_OSX')
```
This setting avoids that warning.
PiperOrigin-RevId: 488703116
- FieldDescriptor:
- Add a new flag to mark when the enum on the field is closed (vs open).
- Support computing the state for when generated sources predate the support.
- EnumDescriptor:
- Support passing flags to the descriptor creation, currently closed is the
only new flag.
- Add an isClosed property to expose the state of the enum.
This does NOT update generation yet, allows things to be tested before the
generation support is added.
PiperOrigin-RevId: 488671606
- Streamline the FieldDescriptor loop a little.
- Move some of the init methods from PackagePrivate into the impl file as
nothing outside calls them and it better encapsulates the signature.
PiperOrigin-RevId: 488671041
The static analyzer in some versions of Xcode now flag the enumDescriptor_ as
retained by the generated methods and not being release in dealloc. So avoid the
whole issue by just bringing back the explicit getter.
PiperOrigin-RevId: 488436139
Going back to the first ObjC support commit, there never really was support for
not have the EnumDescriptors, so start removing that partial support.
PiperOrigin-RevId: 488381501
The Java Any.is() and Any.unpack() methods now accept an exemplar message in
place of a Java class. This avoids the need to use Java introspection in the
implementation of these methods. The exemplar variant of Any.is() is named
Any.isSameTypeAs(). The exemplar variant of Any.unpack() is named Any.unpackSameTypeAs().
PiperOrigin-RevId: 486748727
- Don't double run the conformance test, let the command line flag be the only
thing that runs it (lower in the script).
- Tweak the arg order to help ensure the script won't invoke with flags in a
different order and impact analysis caching.
PiperOrigin-RevId: 485693911
* Add remote cache to linux builds
* Remove BES flags
* Remove BES flags from the right file
* Migrate all Bazel kokoro builds to use remote caching
* Remove BES logic
* Fix mac ruby tests
* Give mac/windows builds GCP access
* Adding quotes to prevent issues with common flags
* Adding command echoing in windows builds
* Try enabling command echoing again
* Adding invocation id for windows bazel build
* Third try
* Adding credentials to windows build
The minOS version is high enough it can be used, and it avoids the long standing
issue for priority inversion dependent on what callers did with
threading/queues.