Skip to content

Commit

Permalink
Update protobuf to latest master at a64497c and apply @laszlocsomor's…
Browse files Browse the repository at this point in the history
… latest changes from protocolbuffers/protobuf#2969 on top of it.

Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
  • Loading branch information
buchgr authored and hlopko committed May 23, 2017
1 parent 18fcb29 commit c0c5e46
Show file tree
Hide file tree
Showing 380 changed files with 22,232 additions and 7,098 deletions.
88 changes: 88 additions & 0 deletions third_party/protobuf/3.2.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
sudo: required
dist: trusty
# Note: travis currently does not support listing more than one language so
# this cheats and claims to only be cpp. If they add multiple language
# support, this should probably get updated to install steps and/or
# rvm/gemfile/jdk/etc. entries rather than manually doing the work.
language: cpp
os:
- osx
# The Objective C build needs Xcode 7.0 or later.
osx_image: xcode8.1
script:
- ./tests.sh $CONFIG
env:
- CONFIG=cpp
- CONFIG=cpp_distcheck
- CONFIG=golang
- CONFIG=java_jdk7
- CONFIG=java_oracle7
- CONFIG=javanano_jdk7
- CONFIG=javanano_oracle7
- CONFIG=javascript
# iOS build log was starting to choke travis UI, so split to cover the
# Xcode Debug and Release Configurations independently.
- CONFIG=objectivec_ios_debug
- CONFIG=objectivec_ios_release
- CONFIG=objectivec_osx
- CONFIG=objectivec_cocoapods_integration
- CONFIG=python
- CONFIG=python_cpp
- CONFIG=ruby21
- CONFIG=ruby22
- CONFIG=jruby
- CONFIG=php5.6_mac
- CONFIG=php7.0_mac
matrix:
exclude:
# It's nontrivial to programmatically install a new JDK from the command
# line on OS X, so we rely on testing on Linux for Java code.
- os: osx
env: CONFIG=java_jdk7
- os: osx
env: CONFIG=java_oracle7
- os: osx
env: CONFIG=javanano_jdk7
- os: osx
env: CONFIG=javanano_oracle7
# Requires installing golang, currently travis.sh is doing that with apt-get
# which doesn't work on OS X.
- os: osx
env: CONFIG=golang
include:
# The dotnet environment requires Ubuntu 14.04 or 16.04. This
# configuration is effectively an "extra" one, outside the
# autogenerated matrix.
- os: linux
env: CONFIG=csharp
dist: trusty
# This test is kept on travis because it doesn't play nicely with other
# tests on jenkins running in parallel.
- os: linux
env: CONFIG=cpp_distcheck
# The Java compatibility test currently only runs on Linux because it will
# fetch pre-built Linux protoc binaries in the test.
- os: linux
env: CONFIG=java_compatibility
# The Python compatibility test currently only runs on Linux because it will
# fetch pre-built Linux protoc binaries in the test.
- os: linux
env: CONFIG=python_compatibility
allow_failures:
# These currently do not work on OS X but are being worked on by @haberman.
- os: osx
env: CONFIG=ruby22
- os: osx
env: CONFIG=jruby
# https://github.com/google/protobuf/issues/1253 - Started failing when
# we moved to an OS X image that is 10.11.
- os: osx
env: CONFIG=python_cpp
# Mark the iOS test as flakey as xcodebuild some times fails to start the
# iOS Simulator.
- os: osx
env: CONFIG=objectivec_ios_debug
- os: osx
env: CONFIG=objectivec_ios_release
notifications:
email: false
102 changes: 97 additions & 5 deletions third_party/protobuf/3.2.0/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ filegroup(

java_import(
name = "protobuf_java_util",
jars = ["protobuf-java-util-3.2.0.jar"],
jars = ["libprotobuf_java_util.jar"],
exports = [
"//third_party:gson",
],
Expand All @@ -35,21 +35,21 @@ java_import(

java_import(
name = "protobuf_java",
jars = ["protobuf-java-3.2.0.jar"],
jars = ["libprotobuf_java.jar"],
visibility = ["//visibility:public"],
)

# For bootstrapping JavaBuilder
filegroup(
name = "protobuf-jars",
srcs = ["protobuf-java-3.2.0.jar"],
srcs = ["libprotobuf_java.jar"],
visibility = ["//visibility:public"],
)

################################################################################
# The below build rules are a copy of the upstream protobuf BUILD file with
# Java support removed.
################################################################################
# # Java support removed.
# ################################################################################

################################################################################
# Protobuf Runtime Library
Expand Down Expand Up @@ -255,6 +255,7 @@ RELATIVE_WELL_KNOWN_PROTOS = [
"google/protobuf/any.proto",
"google/protobuf/api.proto",
"google/protobuf/compiler/plugin.proto",
"google/protobuf/compiler/profile.proto",
"google/protobuf/descriptor.proto",
"google/protobuf/duration.proto",
"google/protobuf/empty.proto",
Expand Down Expand Up @@ -399,6 +400,7 @@ cc_library(
"src/google/protobuf/compiler/php/php_generator.cc",
"src/google/protobuf/compiler/plugin.cc",
"src/google/protobuf/compiler/plugin.pb.cc",
"src/google/protobuf/compiler/profile.pb.cc",
"src/google/protobuf/compiler/python/python_generator.cc",
"src/google/protobuf/compiler/ruby/ruby_generator.cc",
"src/google/protobuf/compiler/subprocess.cc",
Expand Down Expand Up @@ -450,6 +452,9 @@ RELATIVE_TEST_PROTOS = [
"google/protobuf/unittest_enormous_descriptor.proto",
"google/protobuf/unittest_import.proto",
"google/protobuf/unittest_import_public.proto",
"google/protobuf/unittest_lazy_dependencies.proto",
"google/protobuf/unittest_lazy_dependencies_custom_option.proto",
"google/protobuf/unittest_lazy_dependencies_enum.proto",
"google/protobuf/unittest_lite_imports_nonlite.proto",
"google/protobuf/unittest_mset.proto",
"google/protobuf/unittest_mset_wire_format.proto",
Expand Down Expand Up @@ -494,6 +499,7 @@ COMMON_TEST_SRCS = [
# AUTOGEN(common_test_srcs)
"src/google/protobuf/arena_test_util.cc",
"src/google/protobuf/map_test_util.cc",
"src/google/protobuf/stubs/io_win32.cc",
"src/google/protobuf/test_util.cc",
"src/google/protobuf/testing/file.cc",
"src/google/protobuf/testing/googletest.cc",
Expand Down Expand Up @@ -536,6 +542,7 @@ cc_test(
"src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc",
"src/google/protobuf/compiler/cpp/cpp_unittest.cc",
"src/google/protobuf/compiler/cpp/metadata_test.cc",
"src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc",
"src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc",
"src/google/protobuf/compiler/importer_unittest.cc",
"src/google/protobuf/compiler/java/java_doc_comment_unittest.cc",
Expand Down Expand Up @@ -603,6 +610,10 @@ cc_test(
":test_plugin",
] + glob([
"src/google/protobuf/**/*",
# Files for csharp_bootstrap_unittest.cc.
"conformance/**/*",
"csharp/src/**/*",
"examples/**/*",
]),
includes = [
"src/",
Expand Down Expand Up @@ -833,3 +844,84 @@ proto_lang_toolchain(
runtime = ":protobuf_java",
visibility = ["//visibility:public"],
)

OBJC_HDRS = [
"objectivec/GPBArray.h",
"objectivec/GPBBootstrap.h",
"objectivec/GPBCodedInputStream.h",
"objectivec/GPBCodedOutputStream.h",
"objectivec/GPBDescriptor.h",
"objectivec/GPBDictionary.h",
"objectivec/GPBExtensionInternals.h",
"objectivec/GPBExtensionRegistry.h",
"objectivec/GPBMessage.h",
"objectivec/GPBProtocolBuffers.h",
"objectivec/GPBProtocolBuffers_RuntimeSupport.h",
"objectivec/GPBRootObject.h",
"objectivec/GPBRuntimeTypes.h",
"objectivec/GPBUnknownField.h",
"objectivec/GPBUnknownFieldSet.h",
"objectivec/GPBUtilities.h",
"objectivec/GPBWellKnownTypes.h",
"objectivec/GPBWireFormat.h",
"objectivec/google/protobuf/Any.pbobjc.h",
"objectivec/google/protobuf/Api.pbobjc.h",
"objectivec/google/protobuf/Duration.pbobjc.h",
"objectivec/google/protobuf/Empty.pbobjc.h",
"objectivec/google/protobuf/FieldMask.pbobjc.h",
"objectivec/google/protobuf/SourceContext.pbobjc.h",
"objectivec/google/protobuf/Struct.pbobjc.h",
"objectivec/google/protobuf/Timestamp.pbobjc.h",
"objectivec/google/protobuf/Type.pbobjc.h",
"objectivec/google/protobuf/Wrappers.pbobjc.h",
]

OBJC_PRIVATE_HDRS = [
"objectivec/GPBArray_PackagePrivate.h",
"objectivec/GPBCodedInputStream_PackagePrivate.h",
"objectivec/GPBCodedOutputStream_PackagePrivate.h",
"objectivec/GPBDescriptor_PackagePrivate.h",
"objectivec/GPBDictionary_PackagePrivate.h",
"objectivec/GPBMessage_PackagePrivate.h",
"objectivec/GPBRootObject_PackagePrivate.h",
"objectivec/GPBUnknownFieldSet_PackagePrivate.h",
"objectivec/GPBUnknownField_PackagePrivate.h",
"objectivec/GPBUtilities_PackagePrivate.h",
]

OBJC_SRCS = [
"objectivec/GPBArray.m",
"objectivec/GPBCodedInputStream.m",
"objectivec/GPBCodedOutputStream.m",
"objectivec/GPBDescriptor.m",
"objectivec/GPBDictionary.m",
"objectivec/GPBExtensionInternals.m",
"objectivec/GPBExtensionRegistry.m",
"objectivec/GPBMessage.m",
"objectivec/GPBRootObject.m",
"objectivec/GPBUnknownField.m",
"objectivec/GPBUnknownFieldSet.m",
"objectivec/GPBUtilities.m",
"objectivec/GPBWellKnownTypes.m",
"objectivec/GPBWireFormat.m",
"objectivec/google/protobuf/Any.pbobjc.m",
"objectivec/google/protobuf/Api.pbobjc.m",
"objectivec/google/protobuf/Duration.pbobjc.m",
"objectivec/google/protobuf/Empty.pbobjc.m",
"objectivec/google/protobuf/FieldMask.pbobjc.m",
"objectivec/google/protobuf/SourceContext.pbobjc.m",
"objectivec/google/protobuf/Struct.pbobjc.m",
"objectivec/google/protobuf/Timestamp.pbobjc.m",
"objectivec/google/protobuf/Type.pbobjc.m",
"objectivec/google/protobuf/Wrappers.pbobjc.m",
]

objc_library(
name = "objectivec",
hdrs = OBJC_HDRS + OBJC_PRIVATE_HDRS,
includes = [
"objectivec",
],
non_arc_srcs = OBJC_SRCS,
visibility = ["//visibility:public"],
)
108 changes: 108 additions & 0 deletions third_party/protobuf/3.2.0/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,111 @@
2017-04-05 version 3.3.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Planned Future Changes
* There are some changes that are not included in this release but are
planned for the near future:
- Preserve unknown fields in proto3: please read this doc:

https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view

for the timeline and follow up this github issue:

https://github.com/google/protobuf/issues/272

for discussion.
- Make C++ implementation C++11 only: we plan to require C++11 to build
protobuf code starting from 3.4.0 or 3.5.0 release. Please join this
github issue:

https://github.com/google/protobuf/issues/2780

to provide your feedback.

C++
* Fixed map fields serialization of DynamicMessage to correctly serialize
both key and value regardless of their presence.
* Parser now rejects field number 0 correctly.
* New API Message::SpaceUsedLong() that’s equivalent to
Message::SpaceUsed() but returns the value in size_t.
* JSON support
- New flag always_print_enums_as_ints in JsonPrintOptions.
- New flag preserve_proto_field_names in JsonPrintOptions. It will instruct
the JSON printer to use the original field name declared in the .proto
file instead of converting them to lowerCamelCase when printing JSON.
- JsonPrintOptions.always_print_primtive_fields now works for oneof message
fields.
- Fixed a bug that doesn’t allow different fields to set the same json_name
value.
- Fixed a performance bug that causes excessive memory copy when printing
large messages.
* Various performance optimizations.

Java
* Map field setters eagerly validate inputs and throw NullPointerExceptions
as appropriate.
* Added ByteBuffer overloads to the generated parsing methods and the Parser
interface.
* proto3 enum's getNumber() method now throws on UNRECOGNIZED values.
* Output of JsonFormat is now locale independent.

Python
* Added FindServiceByName() in the pure-Python DescriptorPool. This works only
for descriptors added with DescriptorPool.Add(). Generated descriptor_pool
does not support this yet.
* Added a descriptor_pool parameter for parsing Any in text_format.Parse().
* descriptor_pool.FindFileContainingSymbol() now is able to find nested
extensions.
* Extending empty [] to repeated field now sets parent message presence.

PHP
* Added file option php_class_prefix. The prefix will be prepended to all
generated classes defined in the file.
* When encoding, negative int32 values are sign-extended to int64.
* Repeated/Map field setter accepts a regular PHP array. Type checking is
done on the array elements.
* encode/decode are renamed to serializeToString/mergeFromString.
* Added mergeFrom, clear method on Message.
* Fixed a bug that oneof accessor didn’t return the field name that is
actually set.
* C extension now works with php7.
* This is the first GA release of PHP. We guarantee that old generated code
can always work with new runtime and new generated code.

Objective-C
* Fixed help for GPBTimestamp for dates before the epoch that contain
fractional seconds.
* Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a
message and any sub messages.
* Addressed a threading race in extension registration/lookup.
* Increased the max message parsing depth to 100 to match the other languages.
* Removed some use of dispatch_once in favor of atomic compare/set since it
needs to be heap based.
* Fixes for new Xcode 8.3 warnings.

C#
* Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily
if provided exactly the right size of array to copy to.
* Fixed enum JSON formatting when multiple names mapped to the same numeric
value.
* Added JSON formatting option to format enums as integers.
* Modified RepeatedField<T> to implement IReadOnlyList<T>.
* Introduced the start of custom option handling; it's not as pleasant as it
might be, but the information is at least present. We expect to extend code
generation to improve this in the future.
* Introduced ByteString.FromStream and ByteString.FromStreamAsync to
efficiently create a ByteString from a stream.
* Added whole-message deprecation, which decorates the class with [Obsolete].

Ruby
* Fixed Message#to_h for messages with map fields.
* Fixed memcpy() in binary gems to work for old glibc, without breaking the
build for non-glibc libc’s like musl.

Javascript
* Added compatibility tests for version 3.0.0.
* Added conformance tests.
* Fixed serialization of extensions: we need to emit a value even if it is
falsy (like the number 0).
* Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript.

2017-01-23 version 3.2.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite)
General
* Added protoc version number to protoc plugin protocol. It can be used by
Expand Down
Loading

0 comments on commit c0c5e46

Please sign in to comment.