Commit Graph

7013 Commits

Author SHA1 Message Date
Joshua Haberman
78378dab22 Merge branch 'master' into layout_clear 2019-08-20 17:24:18 -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
Tristan Pratt
da5740082e c# feature(RepeatedField): Capacity property to resize the internal array
This property is useful for efficiently initializing long RepeatedFields.

I used System.Collections.Generic.List's design as a model.  It should feel the most familiar to C# developers.
2019-08-17 19:12:00 -04: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
Joshua Haberman
1c9fb9d45b WIP. 2019-08-16 06:42:13 -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
Sydney Acksman
54a3d8e7ef Add proto2 doc 2019-08-13 03:50:12 -05: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
Paul Yang
a450e13a95
Revert "Fixed JS parsing of default map values (#6394)" (#6468)
This reverts commit dcc8ffd9c6.
2019-08-02 15:04:31 -07:00
Paul Yang
0c4b607e98
Conformance packed (#6447)
* Add conformance tests for explicit packed/unpacked fields

* Fix typo

* Update failure lists

* Update failure list

* Use enum class to make enum scoped
2019-08-02 14:35:44 -07:00
Jie Luo
d1eeb852fc
compatibility test between last released and current for java python php (#6441)
* compatibility tests between last released and the current version
2019-07-31 17:49:26 -07:00
Gaël Delalleau
5db5c26ae4 Fix a Python extension crash in the descriptor's nested types container code (#6455) 2019-07-31 14:52:53 -07:00
Wang Kirin
f38b6ed041 add test case in cpp_bootstrap_unittest.cc 2019-07-30 07:41:26 -07:00
Yannic Bonenberger
bf0c69e130 [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl (Part 2)
This change adds the required loads to examples and zlib.
For full compatibility with --incompatible_load_{cc,java,proto}_rules_from_bzl,
we will need to roll gtest to a newer version.
2019-07-29 14:14:04 -07:00
Adam Cozzette
5b6238e486
Merge pull request #5044 from laszlocsomor/expand-wildcards
Windows: expand path names on command line
2019-07-29 14:07:43 -07:00
Laszlo Csomor
bee5538fda "enum class" instead of "enum" 2019-07-29 15:18:34 +02:00
Laszlo Csomor
ea61636cbc Merge branch 'master' into expand-wildcards 2019-07-29 15:16:10 +02:00
Andrei Shevtsov
1024cbea34 Fix ruby proto3 extension support (#6369) 2019-07-28 10:10:50 -07:00
Paul Yang
a9bb65643b
Add binary conformance test for default repeated fields (#6440)
* Add binary conformance test for default repeated fields

1) Both packed and unpacked encoding should be accepted for parsing.
2) Encode should follow the default way for the syntax.

* Uncomment test

* Remove is_primitive

* Add failed tests to failure lists.

* Add failed test to failure list

* Use binary format to specify expected value

Text format cannot distinguish whether repeated field is packed or not.

* Change method name from ToHexString to ToOctString

* Add failed test to failure list

* Add failed test to php's failure list

* Fix comments
2019-07-26 10:05:14 -07:00
Jie Luo
e399308ef0 Add csharp compatibility tests between last released and the current version (#6407)
* Add csharp compatibility tests for 3.7.0

* Add compatibility test between last major version with current for C#

* Update last version number

* compatibility tests between last released and the current version

* fix typo
2019-07-25 14:31:00 -07:00
Joe Bolinger
41e12344a1 Support hashes for struct initializers (#5716)
* support hashes for struct initalizers

* convert hash keys to string

* update tests

* add extra asserts
2019-07-25 11:17:51 -07:00
Lian Duan
dcc8ffd9c6 Fixed JS parsing of default map values (#6394) 2019-07-24 16:32:21 -07:00
Josh Humphries
cb58738de2 add test 2019-07-24 13:47:18 -07:00
Josh Humphries
f68b251f75 don't emit location for label unless label is present 2019-07-24 13:47:18 -07:00
Paul Yang
2849a79990
Add binary conformance test for message type. (#6435)
* Add binary conformance test for message type.

* Add test case for merge repeated scalar message field

* Add failed tests to failure list

* Add failed test to php's failure list

* Remove successful tests from php c's failure list
2019-07-24 12:26:40 -07:00
Yannic Bonenberger
ff21d0f877 Copy files to temp-dir for testing 2019-07-24 10:23:55 -07:00
Yannic Bonenberger
edbc27fb81 Print logs of failing tests 2019-07-24 10:23:55 -07:00
Yannic Bonenberger
27e85ab55d Address review comments 2019-07-24 10:23:55 -07:00