Skip to content
Permalink
Browse files

Merge branch 'master' into 201910111201

  • Loading branch information...
rafi-kamal committed Oct 11, 2019
2 parents 6c92f9d + d8e678a commit 27c1defe3519b383c4910c7f8a858a4c9437952c
Showing with 676 additions and 497 deletions.
  1. +1 −0 BUILD
  2. +71 −0 CHANGES.txt
  3. +1 −1 Protobuf-C++.podspec
  4. +1 −1 Protobuf.podspec
  5. +1 −1 cmake/CMakeLists.txt
  6. +1 −1 configure.ac
  7. +4 −0 conformance/binary_json_conformance_suite.cc
  8. +0 −2 conformance/failure_list_php_c.txt
  9. +1 −1 csharp/Google.Protobuf.Tools.nuspec
  10. +2 −2 csharp/src/Google.Protobuf/Google.Protobuf.csproj
  11. +2 −2 csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs
  12. +2 −2 csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
  13. +2 −2 csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
  14. +2 −2 csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
  15. +2 −2 csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs
  16. +2 −2 csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs
  17. +2 −2 csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs
  18. +4 −0 docs/options.md
  19. +3 −3 java/README.md
  20. +3 −3 java/bom/pom.xml
  21. +1 −1 java/core/pom.xml
  22. +1 −1 java/lite/pom.xml
  23. +1 −1 java/pom.xml
  24. +1 −1 java/util/pom.xml
  25. +1 −1 js/package.json
  26. +10 −2 objectivec/GPBCodedInputStream.m
  27. +16 −12 objectivec/GPBUtilities_PackagePrivate.h
  28. +42 −0 php/README.md
  29. +26 −8 php/ext/google/protobuf/encode_decode.c
  30. +67 −61 php/ext/google/protobuf/message.c
  31. +48 −6 php/ext/google/protobuf/package.xml
  32. +1 −1 php/ext/google/protobuf/protobuf.h
  33. +54 −0 php/ext/google/protobuf/type_check.c
  34. +23 −27 php/ext/google/protobuf/upb.c
  35. +41 −0 php/tests/encode_decode_test.php
  36. +1 −0 php/tests/memory_leak_test.php
  37. +11 −0 php/tests/proto/test.proto
  38. +1 −1 protoc-artifacts/pom.xml
  39. +1 −1 python/google/protobuf/__init__.py
  40. +23 −41 ruby/ext/google/protobuf_c/upb.c
  41. +1 −1 ruby/google-protobuf.gemspec
  42. +12 −0 ruby/tests/common_tests.rb
  43. +1 −1 src/Makefile.am
  44. +2 −2 src/google/protobuf/any.pb.h
  45. +2 −2 src/google/protobuf/api.pb.h
  46. +2 −2 src/google/protobuf/compiler/command_line_interface_unittest.cc
  47. +4 −4 src/google/protobuf/compiler/cpp/cpp_message.cc
  48. +2 −2 src/google/protobuf/compiler/plugin.pb.h
  49. +1 −1 src/google/protobuf/descriptor.cc
  50. +2 −2 src/google/protobuf/descriptor.pb.h
  51. +1 −1 src/google/protobuf/descriptor_database.h
  52. +2 −2 src/google/protobuf/descriptor_unittest.cc
  53. +2 −2 src/google/protobuf/duration.pb.h
  54. +1 −0 src/google/protobuf/dynamic_message.h
  55. +2 −2 src/google/protobuf/empty.pb.h
  56. +2 −2 src/google/protobuf/field_mask.pb.h
  57. +27 −170 src/google/protobuf/port_def.inc
  58. +0 −14 src/google/protobuf/port_undef.inc
  59. +8 −16 src/google/protobuf/repeated_field.cc
  60. +8 −15 src/google/protobuf/repeated_field.h
  61. +2 −2 src/google/protobuf/source_context.pb.h
  62. +2 −2 src/google/protobuf/struct.pb.h
  63. +1 −1 src/google/protobuf/stubs/bytestream.h
  64. +4 −4 src/google/protobuf/stubs/common.h
  65. +3 −2 src/google/protobuf/stubs/port.h
  66. +0 −15 src/google/protobuf/stubs/strutil.cc
  67. +0 −2 src/google/protobuf/stubs/strutil.h
  68. +44 −0 src/google/protobuf/stubs/strutil_unittest.cc
  69. +1 −0 src/google/protobuf/text_format.h
  70. +2 −2 src/google/protobuf/timestamp.pb.h
  71. +2 −2 src/google/protobuf/type.pb.h
  72. +2 −2 src/google/protobuf/wrappers.pb.h
  73. +1 −0 third_party/BUILD
  74. +53 −28 update_version.py
1 BUILD
@@ -59,6 +59,7 @@ COPTS = select({
"-Wno-unused-function",
# Prevents ISO C++ const string assignment warnings for pyext sources.
"-Wno-write-strings",
"-Wno-deprecated-declarations",
],
})

@@ -1,3 +1,74 @@
2019-09-03 version 3.10.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
* Switch the proto parser to the faster MOMI parser.
* Properly escape Struct keys in the proto3 JSON serializer.
* Fix crash on uninitialized map entries.
* Informed the compiler of has-bit invariant to produce better code
* Unused imports of files defining descriptor extensions will now be reported
* Add proto2::util::RemoveSubranges to remove multiple subranges in linear time.
* Added BaseTextGenerator::GetCurrentIndentationSize()
* Made implicit weak fields compatible with the Apple linker
* Support 32 bit values for ProtoStreamObjectWriter to Struct.
* Removed the internal-only header coded_stream_inl.h and the internal-only methods defined there.
* Enforced no SWIG wrapping of descriptor_database.h (other headers already had this restriction).
* Implementation of the equivalent of the MOMI parser for serialization. This removes one of the two serialization routines, by making the fast array serialization routine completely general. SerializeToCodedStream can now be implemented in terms of the much much faster array serialization. The array serialization regresses slightly, but when array serialization is not possible this wins big.
* Do not convert unknown field name to snake case to accurately report error.
* Fix a UBSAN warnings. (#6333)
* Add podspec for C++ (#6404)
* protoc: fix source code info location for missing label (#6436)
* C++ Add move constructor for Reflection's SetString (#6477)

Java
* Call loadDescriptor outside of synchronized block to remove one possible source of deadlock.
* Have oneof enums implement a separate interface (other than EnumLite) for clarity.
* Opensource Android Memory Accessors
* Update TextFormat to make use of the new TypeRegistry.
* Support getFieldBuilder and getRepeatedFieldBuilder in ExtendableBuilder
* Update JsonFormat to make use of the new TypeRegistry.
* Add proguard config generator for GmmBenchmarkSuiteLite.
* Change ProtobufArrayList to use Object[] instead of ArrayList for 5-10% faster parsing
* Implement ProtobufArrayList.add(E) for 20% (5%-40%) faster overall protolite2 parsing
* Make a copy of JsonFormat.TypeRegistry at the protobuf top level package. This will eventually replace JsonFormat.TypeRegistry.
* Fix javadoc warnings in generated files (#6231)
* Java: Add Automatic-Module-Name entries to the Manifest (#6568)

Python
* Add descriptor methods in descriptor_pool are deprecated.
* Uses explicit imports to prevent multithread test failures in py3.
* Added __delitem__ for Python extension dict
* Update six version to 1.12.0 and fix legacy_create_init issue (#6391)

JavaScript
* Remove deprecated boolean option to getResultBase64String().
* Fix sint64 zig-zag encoding.
* Simplify hash64 string conversion to avoid DIGIT array. Should reduce overhead if these functions aren't used, and be more efficient by avoiding linear array searches.
* Change the parameter types of binaryReaderFn in ExtensionFieldBinaryInfo to (number, ?, ?).
* Create dates.ts and time_of_days.ts to mirror Java versions. This is a near-identical conversion of c.g.type.util.{Dates,TimeOfDays} respectively.
* Migrate moneys to TypeScript.

PHP
* Fix incorrect leap day for Timestamp (#6696)
* Initialize well known type values (#6713)

Ruby
* Fix scope resolution for Google namespace (#5878)
* Support hashes for struct initializers (#5716)
* Optimized away the creation of empty string objects. (#6502)
* Roll forward Ruby upb changes now that protobuf Ruby build is fixed (#5866)
* Optimized layout_mark() for Ruby (#6521)
* Optimization for layout_init() (#6547)
* Fix for GC of Ruby map frames. (#6533)
* Fixed leap year handling by reworking upb_mktime() -> upb_timegm(). (#6695)

Objective C
* Remove OSReadLittle* due to alignment requirements (#6678)
* Don't use unions and instead use memcpy for the type swaps. (#6672)

Other
* Override CocoaPods module to lowercase (#6464)


2019-06-28 version 3.9.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
s.version = '3.9.0-rc1'
s.version = '3.11.0-rc0'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
@@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.9.1'
s.version = '3.11.0-rc0'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'
@@ -199,7 +199,7 @@ if (MSVC)
configure_file(extract_includes.bat.in extract_includes.bat)

# Suppress linker warnings about files with no symbols defined.
set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")

# Configure Resource Compiler
enable_language(RC)
@@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.9.1],[protobuf@googlegroups.com],[protobuf])
AC_INIT([Protocol Buffers],[3.11.0-rc-0],[protobuf@googlegroups.com],[protobuf])

AM_MAINTAINER_MODE([enable])

@@ -2689,6 +2689,10 @@ void BinaryAndJsonConformanceSuite::RunSuiteImpl() {
})",
"repeated_timestamp: {seconds: -62135596800}"
"repeated_timestamp: {seconds: 253402300799 nanos: 999999999}");
RunValidJsonTest(
"TimestampLeap", REQUIRED,
R"({"optionalTimestamp": "1993-02-10T00:00:00.000Z"})",
"optional_timestamp: {seconds: 729302400}");
RunValidJsonTest("TimestampWithPositiveOffset", REQUIRED,
R"({"optionalTimestamp": "1970-01-01T08:00:01+08:00"})",
"optional_timestamp: {seconds: 1}");
@@ -66,8 +66,6 @@ Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.JsonOutput
Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput
@@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
<version>3.9.1</version>
<version>3.11.0-rc0</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
@@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.9.1</VersionPrefix>
<VersionPrefix>3.11.0-rc0</VersionPrefix>
<LangVersion>6</LangVersion>
<Authors>Google Inc.</Authors>
<TargetFrameworks>netstandard1.0;netstandard2.0;net45</TargetFrameworks>
@@ -28,7 +28,7 @@

<!-- Needed for the net45 build to work on Unix. See https://github.com/dotnet/designs/pull/33 -->
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'netstandard2.0' ">
@@ -77,7 +77,7 @@ public sealed class EnumValueDescriptor : DescriptorBase
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value enum value option for this descriptor
/// </summary>
public T GetOption<T>(Extension<EnumValueOptions, T> extension)
{
@@ -86,7 +86,7 @@ public T GetOption<T>(Extension<EnumValueOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value enum value option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<EnumValueOptions, T> extension)
{
@@ -302,7 +302,7 @@ public MessageDescriptor ExtendeeType
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value field option for this descriptor
/// </summary>
public T GetOption<T>(Extension<FieldOptions, T> extension)
{
@@ -311,7 +311,7 @@ public T GetOption<T>(Extension<FieldOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value field option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<FieldOptions, T> extension)
{
@@ -545,7 +545,7 @@ public override string ToString()
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value file option for this descriptor
/// </summary>
public T GetOption<T>(Extension<FileOptions, T> extension)
{
@@ -554,7 +554,7 @@ public T GetOption<T>(Extension<FileOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value file option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<FileOptions, T> extension)
{
@@ -264,7 +264,7 @@ internal bool IsExtensionsInitialized(IMessage message)
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value message option for this descriptor
/// </summary>
public T GetOption<T>(Extension<MessageOptions, T> extension)
{
@@ -273,7 +273,7 @@ public T GetOption<T>(Extension<MessageOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value message option for this descriptor
/// </summary>
public Collections.RepeatedField<T> GetOption<T>(RepeatedExtension<MessageOptions, T> extension)
{
@@ -77,7 +77,7 @@ public sealed class MethodDescriptor : DescriptorBase
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value method option for this descriptor
/// </summary>
public T GetOption<T>(Extension<MethodOptions, T> extension)
{
@@ -86,7 +86,7 @@ public T GetOption<T>(Extension<MethodOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value method option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<MethodOptions, T> extension)
{
@@ -109,7 +109,7 @@ public MessageDescriptor ContainingType
public CustomOptions CustomOptions => new CustomOptions(proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value oneof option for this descriptor
/// </summary>
public T GetOption<T>(Extension<OneofOptions, T> extension)
{
@@ -118,7 +118,7 @@ public T GetOption<T>(Extension<OneofOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value oneof option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<OneofOptions, T> extension)
{
@@ -98,7 +98,7 @@ public MethodDescriptor FindMethodByName(String name)
public CustomOptions CustomOptions => new CustomOptions(Proto.Options._extensions?.ValuesByNumber);

/// <summary>
/// Gets a single value enum option for this descriptor
/// Gets a single value service option for this descriptor
/// </summary>
public T GetOption<T>(Extension<ServiceOptions, T> extension)
{
@@ -107,7 +107,7 @@ public T GetOption<T>(Extension<ServiceOptions, T> extension)
}

/// <summary>
/// Gets a repeated value enum option for this descriptor
/// Gets a repeated value service option for this descriptor
/// </summary>
public RepeatedField<T> GetOption<T>(RepeatedExtension<ServiceOptions, T> extension)
{
@@ -208,3 +208,7 @@ with info about your project (name and website) so we can add an entry for you.
1. protokt
* Website: https://github.com/toasttab/protokt (Currently Private but will be open soon.)
* Extensions: 1072

1. Dart port of protocol buffers
* Website https://github.com/dart-lang/protobuf
* Extensions: 1073
@@ -23,7 +23,7 @@ If you are using Maven, use the following:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.9.1</version>
<version>3.9.2</version>
</dependency>
```

@@ -37,15 +37,15 @@ protobuf-java-util package:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.9.1</version>
<version>3.9.2</version>
</dependency>
```

### Gradle

If you are using Gradle, add the following to your `build.gradle` file's dependencies:
```
compile 'com.google.protobuf:protobuf-java:3.9.1'
compile 'com.google.protobuf:protobuf-java:3.9.2'
```
Again, be sure to check that the version number maches (or is newer than) the version number of protoc that you are using.

@@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.9.1</version>
<version>3.11.0-rc-0</version>
<packaging>pom</packaging>

<name>Protocol Buffers [BOM]</name>
@@ -29,8 +29,8 @@

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<name>3-Clause BSD License</name>
<url>https://opensource.org/licenses/BSD-3-Clause</url>
</license>
</licenses>

@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.1</version>
<version>3.11.0-rc-0</version>
</parent>

<artifactId>protobuf-java</artifactId>
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.1</version>
<version>3.11.0-rc-0</version>
</parent>

<artifactId>protobuf-javalite</artifactId>
@@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.1</version>
<version>3.11.0-rc-0</version>
<packaging>pom</packaging>

<name>Protocol Buffers [Parent]</name>
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.1</version>
<version>3.11.0-rc-0</version>
</parent>

<artifactId>protobuf-java-util</artifactId>
@@ -1,6 +1,6 @@
{
"name": "google-protobuf",
"version": "3.9.1",
"version": "3.11.0-rc.0",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [

0 comments on commit 27c1def

Please sign in to comment.
You can’t perform that action at this time.