Commit Graph

6832 Commits

Author SHA1 Message Date
Sydney Acksman
5b2f2c5292 file descriptors and the syntax field are really weird with proto2 2019-08-23 17:16:37 -05:00
Sydney Acksman
8e917d1688 Added FieldDescriptor.IsExtension and sealed ExtensionCollection 2019-08-23 17:16:37 -05:00
Sydney Acksman
8b7fb7d0f4 Add tests for field presence and default values
Adjust APIs for extensions to properly return default values for extensions
Fix issues with IsInitialized and proto2 field reflection
2019-08-23 17:16:36 -05:00
Sydney Acksman
a976158b1c Fix incorrect code gen for string fields with default values 2019-08-23 17:16:36 -05:00
Sydney Acksman
8a57ec847b Add test protos to test project
Fix generated group code missing end group tag case
Fix generated field classes searching for presence index for extensions
2019-08-23 17:16:36 -05:00
Sydney Acksman
6e7c43fc68 Add checks to make sure values retrieved from CustomOptions match extension values 2019-08-23 17:16:36 -05:00
Sydney Acksman
43619bb6b2 Uncomment option code in OneofDescriptor 2019-08-23 17:16:36 -05:00
ObsidianMinor
03872044b1 Make extension container classes public and modify conformance to test proto2 messages 2019-08-23 17:16:36 -05:00
Sydney Acksman
05712c6791 Reapply custom option accessors from previous PR along with CustomOptions accessor deprecations 2019-08-23 17:16:36 -05:00
Sydney Acksman
4be0394686 Remove proto2 check from generator 2019-08-23 17:16:36 -05:00
Sydney Acksman
5caa44e056 Remove internal constraint on descriptor proto 2019-08-23 17:16:36 -05:00
Joshua Haberman
06d26df704
Merge pull request #6559 from haberman/notypedef
Removed ByteCountInt64.  This is a transitional typedef that should n…
2019-08-23 12:25:44 -07:00
Paul Yang
6c9d7ecfa4
Test singular fields are encoded in canonical way (#6553)
* Test singular fields are encoded in canonical way

* Defautl values in proto3 should not be encoded.
* Values should be converted to the canonical representation (e.g.,
long int64 value may be truncated for int32 field)

* Update failure list

* Update failure list
2019-08-23 12:20:19 -07:00
Joshua Haberman
6b2fc3c2c9 Removed ByteCountInt64. This is a transitional typedef that should not be released. 2019-08-23 11:10:02 -07:00
Mohamed Heikal
f8a2deafd5 Add ovrride keyword for overriden functions 2019-08-23 09:52:29 -07:00
Mohamed Heikal
db5b2bd13a clang-cl requires fully qualified name for friend class declarations 2019-08-23 09:48:52 -07:00
Mohamed Heikal
402b5772d5 Fix order of export and capability macros on WrappedMutex
clang-cl requires the order to be the opposite of what it currently is.
It should not affect other compilers since this is the only compiler
that has both macros defined.
2019-08-23 09:47:41 -07:00
Rafi Kamal
2228af689f
Merge pull request #6556 from rafi-kamal/201908221610
Down integrate internal changes to GitHub
2019-08-22 22:04:52 -07:00
Rafi Kamal
2cc432fcfd
Merge pull request #6542 from elharo/patch-2
Update to Truth 1.0
2019-08-22 17:57:16 -07:00
Rafi Kamal
4f02f056b5 Down integrate to GitHub 2019-08-22 17:33:01 -07:00
Paul Yang
893a7d31e1
No need to have a separate ruby conformance test on Mac (#6555)
The previous issue of mktime doesn't work on Mac has been fixed.
2019-08-22 16:17:37 -07:00
Joshua Haberman
780b050975 Fix for GC of Ruby map frames. (#6533)
We were creating a map decoding frame when starting the *map*,
but clearing the GC slot when finishing each *map entry*.  This
means that the decoding frame could be collected in the meantime.
2019-08-22 14:36:27 -07:00
Julio Monteiro
8c3a2ce198 Add source code URI to the Ruby gemspec file (#6466)
* Add source code URI to the Ruby gemspec file

As a developer, I would like to easily find the source code origin for this gem when browsing through https://rubygems.org/gems/google-protobuf.
In order to solve this, I've followed instructions at https://guides.rubygems.org/specification-reference/#metadata by adding the source_code_uri metadata key pair.

* Use git tag instead of fixed "master" string

* Substitute the string, not the Gem::Version
2019-08-22 14:32:06 -07:00
Paul Yang
d79d368ff1
Remove stale comment (#6552)
Proto2 has been tested for invalid cases. Check implementation of
ExpectParseFailureForProto (https://github.com/protocolbuffers/protobuf/blob/master/conformance/binary_json_conformance_suite.cc#L322)
2019-08-22 13:25:19 -07:00
Elliotte Rusty Harold
e971944bfc
Update to Truth 1.0 2019-08-20 19:49:31 -04:00
Joshua Haberman
63e4a3ecc9
Merge pull request #6541 from haberman/ruby_race_fix
Fix for race in lazy initialization of handlers.
2019-08-20 15:17:14 -07:00
Joshua Haberman
35b0a879c6
Merge pull request #6521 from haberman/layout_mark
Optimized layout_mark() for Ruby
2019-08-20 14:23:13 -07:00
Joshua Haberman
b245551a61 Fix for race in lazy initialization of handlers.
This fixes https://github.com/protocolbuffers/protobuf/issues/6532.
2019-08-20 14:08:31 -07:00
Paul Yang
6b3024f693
Accept string for int64 wrappers (#6491) 2019-08-19 17:16:58 -07:00
Joshua Haberman
ee4f2492ea Fixed some lint errors seen in google3. (#6520) 2019-08-16 15:23:06 -07:00
Joshua Haberman
c02a6fbf2c Bugfix for GC mark of oneof fields. 2019-08-16 09:37:36 -07:00
Adam Liddell
c60aaf79e6 Remove duplicate six http_archive definition
Archive is declared in the protobuf_deps() call above
2019-08-15 14:53:59 -07:00
Adam Liddell
8199a01ff4 Move six.BUILD to third_party and update paths 2019-08-15 14:53:59 -07:00
Adam Liddell
23e520e7fc Update six version to 1.12.0 and fix legacy_create_init issue
When the @six//:six library is used on a target without the
`legacy_create_init` flag disabled, the library will not be
usable due to __init__.py being empty and the six code will
be in six.py. This change forces six to occupy the __init__
name, preventing this file getting created regardless of
the `legacy_create_init` setting.

See comments on a74c43bbd9 for
context:
a74c43bbd9
2019-08-15 14:53:59 -07:00
DNKpp
8c46be0328 add Map forward declaration in arena.h
Signed-off-by: DNKpp <dnkpp2011@gmail.com>
2019-08-15 11:38:23 -07:00
Joshua Haberman
013a0ea882 Optimized layout_mark to not iterate over the msgdef. 2019-08-15 06:39:38 -07:00
Joshua Haberman
0088a75ce5 Merge branch 'master' into layout_mark 2019-08-15 05:36:24 -07:00
Joshua Haberman
0f76f8a83b Put oneof case offset in separate oneof table. 2019-08-15 03:37:06 -07:00
Joshua Haberman
63f324a993 Roll forward Ruby upb changes now that protobuf Ruby build is fixed (#5866)
* Rolled forward again with "Updated upb from defcleanup branch..."

Revert "Revert "Updated upb from defcleanup branch and modified Ruby to use it (#5539)" (#5848)"

This reverts commit 1568deab40.

* A few more merge fixes.

* Updated for defcleanup2 branch.

* Fixed upb to define upb_decode().

* Fixed names of nested messages.

* Revert submodule.

* Set -std=gnu90 and fixed warnings/errors.

Some of our Kokoro tests seem to run with this level of warnings,
and the source strives to be gnu90 compatible.  Enforcing it for
every build removes the possibility of some errors showing up in
Kokoro/Travis tests only.

* Fixed remaining warnings with gnu90 mode.

I tried to match warning flags with what Ruby appears to do
in our Kokoro tests.

* Initialize values registered by rb_gc_register_address().

* Fixed subtle GC bug.

We need to initialize this marked value before creating the instance.

* Truly fix the GC bug.

* Updated upb for mktime() fix.

* Removed XOPEN_SOURCE as we are not using strptime().

* Removed fixed tests from the conformance failure list for Ruby.

* Fixed memory error related to oneof def names.

* Picked up new upb changes re: JSON printing.

* Uncomment concurrent decoding test.
2019-08-14 14:41:37 -07:00
Joshua Haberman
402c28a321
Merge pull request #6502 from haberman/rubygcfix
Optimized away the creation of empty string objects.
2019-08-14 09:39:19 +01:00
Paul Yang
fa8f155dcf
Reinstall wget on mac (#6505) 2019-08-13 11:36:17 -07:00
Joshua Haberman
1e37a94bb5 Optimized away the creation of empty string objects.
Prior to this CL, creating an empty message object would create
two empty string objects for every declared field.  First we
created a unique string object for the field's default.  Then
we created yet another string object when we assigned the
default value into the message: we called #encode to ensure
that the string would have the correct encoding and be frozen.

I optimized these unnecessary objects away with two fixes:

1. Memoize the empty string so that we don't create a new empty
   string for every field's default.
2. If we are assigning a string to a message object, avoid creating
   a new string if the assigned string has the correct encoding and
   is already frozen.
2019-08-13 04:54:11 -07:00
reed-lau
c132a4aa16 replace 'const std::string&' with 'std::string'(by value) 2019-08-09 16:04:05 -07:00
reed-lau
e4c7ead20c use move method for SetString 2019-08-09 16:04:05 -07:00
reed-lau
218df038cc add movable String interface Reflection 2019-08-09 16:04:05 -07:00
reed-lau
6e0a6d1cbd Add move constructor for Reflection's SetString 2019-08-09 16:04:05 -07:00
Jie Luo
43156775be
Merge 3.9.x 201908071359 to master (#6484)
* Add changelog for 3.9.x

* Revert "Make php message class final to avoid mocking (#6277)" (#6324)

This reverts commit 7f84a94366.
This is just temporary. Eventually, we still want to roll forward this
change. Some users are complaining they need more time to clean up their
code.

* Update extract_includes.bat.in

File io_win32.h is not in directory google\protobuf\stubs under directory google\protobuf\io

* Set oneof case in array constructor (#6351)

Forgot to set it previously.

* Update protobuf version (#6366)

* Drop building wheel for python 3.4 (#6406)

https://github.com/matthew-brett/multibuild/pull/240

* Fix binary compatibility in FieldCodec factory methods (#6380) (#6424)

* Fix binary compatibility in FieldCodec factory messages

* Make default value parameter for current factories required

* Route old methods through default value overloads

* Remove ExtensionRegistry.Add(params) overload

* Rename ExtensionRegistry.Add(IEnumerable<Extension>) overload to AddRange

* Edit naming of parameters in Extension classes

* * Fix add API warnings to docs for extension APIs
* Rename internal ExtensionSet.GetValue to TryGetValue

* Disable javadoc error (#6371)

* Disable javadoc error

Actual fixes of the javadoc will be followed up

* Remove duplicated configuration

* Update javadoc plugin version

* Updated Bazel test script to use most recent Bazel version (#6413) (#6433)

I'm not exactly sure why, but this fixes the failing Bazel presubmit
test. Using the most recent version seems like a good idea anyway so
that we can make sure we're compatible with any new Bazel changes.

* [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl

* No need to update version in generated code (#6471)

generate_descriptor will handle that

* Update protobuf version (#6472)
2019-08-09 13:21:18 -07:00
Paul Yang
56988bee34
No free when construct was not done (#6483)
* No free when construct was not done

This fix the segfault when some other error happens

* Add more tests

* Use Sub to avoid printing too much
2019-08-07 13:17:20 -07:00
Yannic Bonenberger
d2d6ff51a8 [bazel] Load python rules from @rules_python 2019-08-06 16:50:32 -07:00
Paul Beusterien
479ba8226b Override CocoaPods module to lowercase (#6464)
Fix #3218
2019-08-06 15:05:24 -04:00