* Don't drop parser warnings on the floor
Fix#9343.
* Convert "missing syntax" warning to an actual warning
For some reason this warning was emitted as a log message rather than a
structured warning. Convert it to use the AddWarning API so that it gets
emitted with a file and line number by protoc, and is visible via the
error collection interface during programmatic use.
* Remove CaptureTestStderr() call
CaptureTestStderr() and GetCapturedTestStderr() have to be paired with each other.
* Adjust tests for new warnings
A few tests now produce warnings that they didn't before, but were
expecting not to see any stderr output. Adjust the tests accordingly.
Co-authored-by: Adam Cozzette <acozzette@google.com>
When generating, it isn't uncommon to have generate >1 file at a time, and it is
likely that one file will include another. So cache the results as the
calculation is done so the work isn't repeated.
The previous pruning method didn't have any concept of tracking already done
work, this changes the algorithm to avoid the repeated work to make things more
minimal on the way up.
Some extremely deep proto graphs, this takes the generation time from around 15
min to under 45 seconds.
* Rollback pull request #9852, which will break clients who don't IWYU and depend on us for these STL headers
* Rolling forward https://github.com/protocolbuffers/protobuf/pull/9852 after confirming it doesn't break google internals
These filenames stutter, but are still being used by some users. So, these forward to the correct header. They should eventually be deprecated and removed.
This trivial change hints compiler to inline the utf8 helpers and
generate code with better performance.
Tested on skylake, with clang-12 and gcc-9.3. Observed about 10%
improvement from `google_message1_proto3_serialize` benchmark,
with default ./configure parameters. Similar improvement on arm.
* Fix NPE during encoding and add regression test for issue 9507.
(cherry picked from commit 58e320a732)
* Implement `respond_to?` in RubyMessage (#9677)
All synthetic methods implemented by `method_missing` are now supported by `respond_to?`.
Fixes issue #9202.
* Fix null pointer exceptions exposed by new regression tests.
* Fix clear_ on oneofs so that it is safe to call repeatedly and so that respond_to? does not depend on whether the oneof is currently cleared.
* Code cleanup: reenable more tests on JRuby.
* Align JRuby behavior with CRuby by throwing a RuntimeError when attempting to assign to a oneof.
(cherry picked from commit 8e7f936696)
* Update protobuf version
* Merge pull request #9727 from mlocati/build-packaged-php-extension
Fix building packaged PHP extension
(cherry picked from commit 7f9901c5f6)
* Update protobuf version
* Update changelogs for 3.20.1-rc1
Co-authored-by: Jason Lunn <jason.lunn@gmail.com>
Co-authored-by: Jorg Brown <jorg.brown@gmail.com>
This will address the following compilation error:
```
src/google/protobuf/compiler/python/python_generator.cc:95:13: warning: unused function 'HasTopLevelEnums' [-Wunused-function]
```
* Update extension_set.cc
avoid allocating memory if all extension are cleared
* Avoid allocating too much memory
* Accurately count flat memory size
* Update extension_set.cc
use the 4x growth.
* add unittest for ExtensionSet
* Support older versions of CMake.
VERSION_GREATER_EQUAL is supported by CMake >=3.7:
https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal
target_link_options() is supported by CMake >=3.13:
https://cmake.org/cmake/help/latest/command/target_link_options.html
* Use PROTOBUF_USE_DLLS and LIBPROTOC_EXPORTS for libprotoc.so shared library
Similar change for libprotobuf.so and libprotobuf-lite.so was made
in commit 5a0887fc65.
* Make value of PROTOC_EXPORT dependent on LIBPROTOC_EXPORTS instead of LIBPROTOBUF_EXPORTS
This was probably intention, and LIBPROTOC_EXPORTS is also used above
in _MSC_VER branch.
* Updated PHP to the new version of upb.
This is a large change, as the upb API surface has been
renamed to follow Google style more closely.
* Fixed utf8_range.
* Updated Ruby for new utf8_range.
* Picked up new upb for PHP, with spelling fixes.
* Fixed the 32-bit build.