Commit Graph

6800 Commits

Author SHA1 Message Date
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
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
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
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
Yannic Bonenberger
4979489451 Add test to verify BUILD- and cmake-files are in sync with src/Makefile.am 2019-07-24 10:23:55 -07:00
Yannic Bonenberger
6e8991981a [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl 2019-07-24 10:10:22 -07:00
Paul Yang
455440fc47
Add binary conformance test for enum fields. (#6434)
* Add binary conformance test for enum fields.

* Add failed conformance test to js failure list
2019-07-23 15:07:26 -07:00
rmstar
2c76c2c413 Add podspec for C++ (#6404) 2019-07-23 13:51:21 -07:00
Paul Yang
29e4fadbfb
Add binary conformance test case for bytes field (#6428)
* Add binary conformance test case for bytes field

* Add failed conformance test to php's failure list
2019-07-23 12:42:30 -07:00
Joe Bolinger
180d3e3287 fix null terminated string (#6370) 2019-07-22 17:11:58 -07:00
Paul Yang
33af06edbb
Drop building wheel for python 3.4 (#6406) (#6426)
https://github.com/matthew-brett/multibuild/pull/240
2019-07-22 16:52:46 -07:00
Paul Yang
eef87dd138
Add conformance test for binary string (#6415)
* Add conformance test for binary string

* Add failing tests to php failure list
2019-07-22 16:52:31 -07:00
Paul Yang
d28cf02ee0 Drop building wheel for python 3.4 (#6406)
https://github.com/matthew-brett/multibuild/pull/240
2019-07-22 14:56:18 -07:00
Wang Kirin
1bbae02cff fix typo in io/printer.h 2019-07-22 13:41:14 -07:00
Sydney Acksman
9857d636fd Fix binary compatibility in FieldCodec factory methods (#6380)
* Fix binary compatibility in FieldCodec factory messages

* Make default value parameter for current factories required

* Route old methods through default value overloads
2019-07-19 16:25:00 -07:00
Leon Barrett
de5d071f44 Fix assignment between Python protobuf Structs (#6377)
Currently, if you access a ListValue from a Struct and attempted to
assign it to another Struct, you would get an exception:

   > s1 = spb.Struct()
   > s1['a'] = [1]
   > s2 = spb.Struct()
   > s2['a'] = s1['a']
   ValueError: Unexpected type

This fixes that case.
2019-07-19 15:47:52 -07:00