The last attempted (rolled back) resulted in changes in visible behavior:
- It consumed a recursion depth on the input stream (wrong)
- It resulted in different error codes for some malformed/truncated data.
PiperOrigin-RevId: 510415215
- The support for CI has been removed (no longer needed)
- Update some of the testing targets
- Removed some lesser used options (to simplify)
PiperOrigin-RevId: 509268013
This is done in basically the same way the C++ does this.
It was tested locally be putting `#error` directives in the pre-generated
sources and running the bazel build (it worked).
PiperOrigin-RevId: 509261352
Every where the script is invoked from protoc is already built, and this more
follows the model used by similar scripts for other languages.
PiperOrigin-RevId: 508694936
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