aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@gmail.com>2018-06-25 15:52:29 -0700
committerGravatar GitHub <noreply@github.com>2018-06-25 15:52:29 -0700
commitd6f346b4d55ae5112934297593ec1c56c3d178a5 (patch)
tree021b5476160e465a20ef7d4ae4c0524351667233
parent3d603f481ed142d0be5e8e4dd6d1cb4457a51405 (diff)
parent82d3d7d250645322f8a7343188e5ae6246a76414 (diff)
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
-rw-r--r--CHANGES.txt88
-rw-r--r--Protobuf.podspec2
-rw-r--r--appveyor.yml6
-rw-r--r--configure.ac2
-rw-r--r--csharp/Google.Protobuf.Tools.nuspec2
-rw-r--r--csharp/src/Google.Protobuf/Google.Protobuf.csproj2
-rw-r--r--csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs4
-rw-r--r--java/core/pom.xml2
-rw-r--r--java/pom.xml2
-rw-r--r--java/util/pom.xml2
-rw-r--r--js/map.js15
-rwxr-xr-xjs/maps_test.js40
-rw-r--r--js/package.json2
-rw-r--r--js/testbinary.proto32
-rwxr-xr-xkokoro/release/linux/build_artifacts.sh14
-rwxr-xr-xkokoro/release/linux/prepare_build.sh16
-rw-r--r--kokoro/release/linux/release.cfg8
-rwxr-xr-xkokoro/release/linux/ruby/ruby_build.sh15
-rwxr-xr-xkokoro/release/linux/ruby/ruby_build_environment.sh8
-rwxr-xr-xkokoro/release/macos/build_artifacts.sh19
-rw-r--r--kokoro/release/macos/release.cfg8
-rwxr-xr-xkokoro/release/macos/ruby/ruby_build.sh15
-rwxr-xr-xkokoro/release/macos/ruby/ruby_build_environment.sh57
-rw-r--r--kokoro/release/protoc/macos/build.sh23
-rw-r--r--kokoro/release/protoc/macos/release.cfg8
-rw-r--r--kokoro/release/protoc/windows/build.bat27
-rw-r--r--kokoro/release/protoc/windows/release.cfg8
-rw-r--r--php/ext/google/protobuf/package.xml22
-rw-r--r--php/ext/google/protobuf/protobuf.h2
-rw-r--r--php/src/Google/Protobuf/Internal/Descriptor.php14
-rw-r--r--php/src/Google/Protobuf/Internal/DescriptorPool.php2
-rw-r--r--php/src/Google/Protobuf/Internal/EnumDescriptor.php14
-rw-r--r--php/src/Google/Protobuf/Internal/GPBUtil.php32
-rw-r--r--php/src/Google/Protobuf/Internal/MapField.php25
-rw-r--r--php/src/Google/Protobuf/Internal/RepeatedField.php23
-rwxr-xr-xphp/tests/compatibility_test.sh49
-rwxr-xr-xpost_process_dist.sh2
-rw-r--r--protoc-artifacts/pom.xml2
-rwxr-xr-xpython/google/protobuf/__init__.py2
-rwxr-xr-xpython/setup.py6
-rw-r--r--ruby/ext/google/protobuf_c/extconf.rb4
-rw-r--r--ruby/google-protobuf.gemspec2
-rw-r--r--src/Makefile.am6
-rw-r--r--src/google/protobuf/any.pb.h4
-rw-r--r--src/google/protobuf/api.pb.h4
-rw-r--r--src/google/protobuf/compiler/js/js_generator.cc6
-rw-r--r--src/google/protobuf/compiler/plugin.pb.h4
-rw-r--r--src/google/protobuf/descriptor.cc14
-rw-r--r--src/google/protobuf/descriptor.pb.h4
-rw-r--r--src/google/protobuf/duration.pb.h4
-rw-r--r--src/google/protobuf/empty.pb.h4
-rw-r--r--src/google/protobuf/field_mask.pb.h4
-rw-r--r--src/google/protobuf/generated_message_util.h9
-rw-r--r--src/google/protobuf/source_context.pb.h4
-rw-r--r--src/google/protobuf/struct.pb.h4
-rw-r--r--src/google/protobuf/stubs/common.h10
-rw-r--r--src/google/protobuf/timestamp.pb.h4
-rw-r--r--src/google/protobuf/type.pb.h4
-rw-r--r--src/google/protobuf/wrappers.pb.h4
59 files changed, 628 insertions, 93 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index c7c42916..c18c6377 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,91 @@
+2018-06-01 version 3.6.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ C++
+ * Starting from this release, we now require C++11. For those we cannot yet
+ upgrade to C++11, we will try to keep the 3.5.x branch updated with
+ critical bug fixes only. If you have any concerns about this, please
+ comment on issue #2780.
+ * Moved to C++11 types like std::atomic and std::unique_ptr and away from our
+ old custom-built equivalents.
+ * Added support for repeated message fields in lite protos using implicit
+ weak fields. This is an experimental feature that allows the linker to
+ strip out more unused messages than previously was possible.
+ * Fixed SourceCodeInfo for interpreted options and extension range options.
+ * Fixed always_print_enums_as_ints option for JSON serialization.
+ * Added support for ignoring unknown enum values when parsing JSON.
+ * Create std::string in Arena memory.
+ * Fixed ValidateDateTime to correctly check the day.
+ * Fixed bug in ZeroCopyStreamByteSink.
+ * Various other cleanups and fixes.
+
+ Java
+ * Dropped support for Java 6.
+ * Added a UTF-8 decoder that uses Unsafe to directly decode a byte buffer.
+ * Added deprecation annotations to generated code for deprecated oneof
+ fields.
+ * Fixed map field serialization in DynamicMessage.
+ * Cleanup and documentation for Java Lite runtime.
+ * Various other fixes and cleanups
+ * Fixed unboxed arraylists to handle an edge case
+ * Improved performance for copying between unboxed arraylists
+ * Fixed lite protobuf to avoid Java compiler warnings
+ * Improved test coverage for lite runtime
+ * Performance improvements for lite runtime
+
+ Python
+ * Fixed bytes/string map key incompatibility between C++ and pure-Python
+ implementations (issue #4029)
+ * Added __init__.py files to compiler and util subpackages
+ * Use /MT for all Windows versions
+ * Fixed an issue affecting the Python-C++ implementation when used with
+ Cython (issue #2896)
+ * Various text format fixes
+ * Various fixes to resolve behavior differences between the pure-Python and
+ Python-C++ implementations
+
+ PHP
+ * Added php_metadata_namespace to control the file path of generated metadata
+ file.
+ * Changed generated classes of nested message/enum. E.g., Foo.Bar, which
+ previously generates Foo_Bar, now generates Foo/Bar
+ * Added array constructor. When creating a message, users can pass a php
+ array whose content is field name to value pairs into constructor. The
+ created message will be initialized according to the array. Note that
+ message field should use a message value instead of a sub-array.
+ * Various bug fixes.
+
+ Objective-C
+ * We removed some helper class methods from GPBDictionary to shrink the size
+ of the library, the functionary is still there, but you may need to do some
+ specific +alloc / -init… methods instead.
+ * Minor improvements in the performance of object field getters/setters by
+ avoiding some memory management overhead.
+ * Fix a memory leak during the raising of some errors.
+ * Make header importing completely order independent.
+ * Small code improvements for things the undefined behaviors compiler option
+ was flagging.
+
+ Ruby
+ * Added ruby_package file option to control the module of generated class.
+ * Various bug fixes.
+
+ Javascript
+ * Allow setting string to int64 field.
+
+ Csharp
+ * Unknown fields are now parsed and then sent back on the wire. They can be
+ discarded at parse time via a CodedInputStream option.
+ * Movement towards working with .NET 3.5 and Unity
+ * Expression trees are no longer used
+ * AOT generics issues in Unity/il2cpp have a workaround (see this commit for
+ details)
+ * Floating point values are now compared bitwise (affects NaN value
+ comparisons)
+ * The default size limit when parsing is now 2GB rather than 64MB
+ * MessageParser now supports parsing from a slice of a byte array
+ * JSON list parsing now accepts null values where the underlying proto
+ representation does
+
2017-12-20 version 3.5.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Planned Future Changes
* Make C++ implementation C++11 only: we plan to require C++11 to build
diff --git a/Protobuf.podspec b/Protobuf.podspec
index 24498a27..b5bb673e 100644
--- a/Protobuf.podspec
+++ b/Protobuf.podspec
@@ -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.5.2'
+ s.version = '3.6.0'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
diff --git a/appveyor.yml b/appveyor.yml
index 1dd076a4..91f737a8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -17,6 +17,12 @@ environment:
UNICODE: ON
- platform: Win64
+ language: cpp
+ image: Visual Studio 2017
+ BUILD_DLL: OFF
+ UNICODE: ON
+
+ - platform: Win64
language: csharp
image: Visual Studio 2017
diff --git a/configure.ac b/configure.ac
index 634c0a69..69b3fe30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.5.2],[protobuf@googlegroups.com],[protobuf])
+AC_INIT([Protocol Buffers],[3.6.0],[protobuf@googlegroups.com],[protobuf])
AM_MAINTAINER_MODE([enable])
diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec
index e3386047..0ba7cc9f 100644
--- a/csharp/Google.Protobuf.Tools.nuspec
+++ b/csharp/Google.Protobuf.Tools.nuspec
@@ -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.5.2</version>
+ <version>3.6.0</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/google/protobuf/blob/master/LICENSE</licenseUrl>
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index 93dcd854..46728b72 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -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.5.2</VersionPrefix>
+ <VersionPrefix>3.6.0</VersionPrefix>
<Authors>Google Inc.</Authors>
<TargetFrameworks>netstandard1.0;net45</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
diff --git a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs
index 18a70b80..feaeba0e 100644
--- a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs
+++ b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs
@@ -34,10 +34,6 @@ using Google.Protobuf.Compatibility;
using System;
using System.Reflection;
-#if NET35
-using Google.Protobuf.Compatibility;
-#endif
-
namespace Google.Protobuf.Reflection
{
/// <summary>
diff --git a/java/core/pom.xml b/java/core/pom.xml
index 5b0b9520..a7d4ea37 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.5.2</version>
+ <version>3.6.0</version>
</parent>
<artifactId>protobuf-java</artifactId>
diff --git a/java/pom.xml b/java/pom.xml
index f2284918..35d653b4 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -11,7 +11,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.5.2</version>
+ <version>3.6.0</version>
<packaging>pom</packaging>
<name>Protocol Buffers [Parent]</name>
diff --git a/java/util/pom.xml b/java/util/pom.xml
index 4e55df0d..8ea4a40d 100644
--- a/java/util/pom.xml
+++ b/java/util/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.5.2</version>
+ <version>3.6.0</version>
</parent>
<artifactId>protobuf-java-util</artifactId>
diff --git a/js/map.js b/js/map.js
index 7b5b2c38..2fb14837 100644
--- a/js/map.js
+++ b/js/map.js
@@ -443,7 +443,8 @@ jspb.Map.prototype.serializeBinary = function(
/**
* Read one key/value message from the given BinaryReader. Compatible as the
* `reader` callback parameter to jspb.BinaryReader.readMessage, to be called
- * when a key/value pair submessage is encountered.
+ * when a key/value pair submessage is encountered. If the Key is undefined,
+ * we should default it to 0.
* @template K, V
* @param {!jspb.Map} map
* @param {!jspb.BinaryReader} reader
@@ -457,12 +458,17 @@ jspb.Map.prototype.serializeBinary = function(
* readMessage, in which case the second callback arg form is used.
*
* @param {?function(V,!jspb.BinaryReader)=} opt_valueReaderCallback
- * The BinaryReader parsing callback for type V, if V is a message type.
+ * The BinaryReader parsing callback for type V, if V is a message type
+ *
+ * @param {K=} opt_defaultKey
+ * The default value for the type of map keys. Accepting map
+ * entries with unset keys is required for maps to be backwards compatible
+ * with the repeated message representation described here: goo.gl/zuoLAC
*
*/
jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn,
- opt_valueReaderCallback) {
- var key = undefined;
+ opt_valueReaderCallback, opt_defaultKey) {
+ var key = opt_defaultKey;
var value = undefined;
while (reader.nextField()) {
@@ -470,6 +476,7 @@ jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn,
break;
}
var field = reader.getFieldNumber();
+
if (field == 1) {
// Key.
key = keyReaderFn.call(reader);
diff --git a/js/maps_test.js b/js/maps_test.js
index e8dd2f21..e496f446 100755
--- a/js/maps_test.js
+++ b/js/maps_test.js
@@ -35,6 +35,11 @@ goog.require('goog.userAgent');
goog.require('proto.jspb.test.MapValueEnum');
goog.require('proto.jspb.test.MapValueMessage');
goog.require('proto.jspb.test.TestMapFields');
+goog.require('proto.jspb.test.TestMapFieldsOptionalKeys');
+goog.require('proto.jspb.test.MapEntryOptionalKeysStringKey');
+goog.require('proto.jspb.test.MapEntryOptionalKeysInt32Key');
+goog.require('proto.jspb.test.MapEntryOptionalKeysInt64Key');
+goog.require('proto.jspb.test.MapEntryOptionalKeysBoolKey');
// CommonJS-LoadFromFile: test_pb proto.jspb.test
goog.require('proto.jspb.test.MapValueMessageNoBinary');
@@ -76,7 +81,7 @@ function toArray(iter) {
* Helper: generate test methods for this TestMapFields class.
* @param {?} msgInfo
* @param {?} submessageCtor
- * @param {!string} suffix
+ * @param {string} suffix
*/
function makeTests(msgInfo, submessageCtor, suffix) {
/**
@@ -260,6 +265,39 @@ function makeTests(msgInfo, submessageCtor, suffix) {
var decoded = msgInfo.deserializeBinary(serialized);
checkMapFields(decoded);
});
+ /**
+ * Tests deserialization of undefined map keys go to default values in binary format.
+ */
+ it('testMapDeserializationForUndefinedKeys', function() {
+ var testMessageOptionalKeys = new proto.jspb.test.TestMapFieldsOptionalKeys();
+ var mapEntryStringKey = new proto.jspb.test.MapEntryOptionalKeysStringKey();
+ mapEntryStringKey.setValue("a");
+ testMessageOptionalKeys.setMapStringString(mapEntryStringKey);
+ var mapEntryInt32Key = new proto.jspb.test.MapEntryOptionalKeysInt32Key();
+ mapEntryInt32Key.setValue("b");
+ testMessageOptionalKeys.setMapInt32String(mapEntryInt32Key);
+ var mapEntryInt64Key = new proto.jspb.test.MapEntryOptionalKeysInt64Key();
+ mapEntryInt64Key.setValue("c");
+ testMessageOptionalKeys.setMapInt64String(mapEntryInt64Key);
+ var mapEntryBoolKey = new proto.jspb.test.MapEntryOptionalKeysBoolKey();
+ mapEntryBoolKey.setValue("d");
+ testMessageOptionalKeys.setMapBoolString(mapEntryBoolKey);
+ var deserializedMessage = msgInfo.deserializeBinary(
+ testMessageOptionalKeys.serializeBinary()
+ );
+ checkMapEquals(deserializedMessage.getMapStringStringMap(), [
+ ['', 'a']
+ ]);
+ checkMapEquals(deserializedMessage.getMapInt32StringMap(), [
+ [0, 'b']
+ ]);
+ checkMapEquals(deserializedMessage.getMapInt64StringMap(), [
+ [0, 'c']
+ ]);
+ checkMapEquals(deserializedMessage.getMapBoolStringMap(), [
+ [false, 'd']
+ ]);
+ });
}
diff --git a/js/package.json b/js/package.json
index 39d99f93..325f2dcc 100644
--- a/js/package.json
+++ b/js/package.json
@@ -1,6 +1,6 @@
{
"name": "google-protobuf",
- "version": "3.5.2",
+ "version": "3.6.0",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [
diff --git a/js/testbinary.proto b/js/testbinary.proto
index 116f17fb..ed5bdfc6 100644
--- a/js/testbinary.proto
+++ b/js/testbinary.proto
@@ -201,6 +201,38 @@ message TestMapFields {
map<string, TestMapFields> map_string_testmapfields = 12;
}
+// These proto are 'mock map' entries to test the above map deserializing with
+// undefined keys. Make sure TestMapFieldsOptionalKeys is written to be
+// deserialized by TestMapFields
+message MapEntryOptionalKeysStringKey {
+ optional string key = 1;
+ optional string value = 2;
+}
+
+message MapEntryOptionalKeysInt32Key {
+ optional int32 key = 1;
+ optional string value = 2;
+}
+
+message MapEntryOptionalKeysInt64Key {
+ optional int64 key = 1;
+ optional string value = 2;
+}
+
+message MapEntryOptionalKeysBoolKey {
+ optional bool key = 1;
+ optional string value = 2;
+}
+
+message TestMapFieldsOptionalKeys {
+ optional MapEntryOptionalKeysStringKey map_string_string = 1;
+ optional MapEntryOptionalKeysInt32Key map_int32_string= 8;
+ optional MapEntryOptionalKeysInt64Key map_int64_string = 9;
+ optional MapEntryOptionalKeysBoolKey map_bool_string = 10;
+}
+
+// End mock-map entries
+
enum MapValueEnum {
MAP_VALUE_FOO = 0;
MAP_VALUE_BAR = 1;
diff --git a/kokoro/release/linux/build_artifacts.sh b/kokoro/release/linux/build_artifacts.sh
new file mode 100755
index 00000000..ae7dc813
--- /dev/null
+++ b/kokoro/release/linux/build_artifacts.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -ex
+
+# change to repo root
+cd $(dirname $0)/../../..
+
+source kokoro/release/linux/prepare_build.sh
+
+# ruby environment
+source kokoro/release/linux/ruby/ruby_build_environment.sh
+
+# build artifacts
+bash kokoro/release/linux/ruby/ruby_build.sh
diff --git a/kokoro/release/linux/prepare_build.sh b/kokoro/release/linux/prepare_build.sh
new file mode 100755
index 00000000..d3ff8764
--- /dev/null
+++ b/kokoro/release/linux/prepare_build.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Move docker's storage location to scratch disk so we don't run out of space.
+echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
+# Use container registry mirror for pulling docker images (should make downloads faster)
+# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring
+echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker
+sudo service docker restart
+
+# Download Docker images from DockerHub
+export DOCKERHUB_ORGANIZATION=grpctesting
+
+# All artifacts come here
+mkdir artifacts
+export ARTIFACT_DIR=$(pwd)/artifacts
+
diff --git a/kokoro/release/linux/release.cfg b/kokoro/release/linux/release.cfg
new file mode 100644
index 00000000..5dae7019
--- /dev/null
+++ b/kokoro/release/linux/release.cfg
@@ -0,0 +1,8 @@
+# Configuration for Linux release builds
+build_file: "protobuf/kokoro/release/linux/build_artifacts.sh"
+
+action {
+ define_artifacts {
+ regex: "github/protobuf/artifacts/**"
+ }
+}
diff --git a/kokoro/release/linux/ruby/ruby_build.sh b/kokoro/release/linux/ruby/ruby_build.sh
new file mode 100755
index 00000000..cf6b433d
--- /dev/null
+++ b/kokoro/release/linux/ruby/ruby_build.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Build protoc
+if test ! -e src/protoc; then
+ ./autogen.sh
+ ./configure
+ make -j4
+fi
+
+umask 0022
+pushd ruby
+bundle install && bundle exec rake gem:native
+ls pkg
+mv pkg/* $ARTIFACT_DIR
+popd
diff --git a/kokoro/release/linux/ruby/ruby_build_environment.sh b/kokoro/release/linux/ruby/ruby_build_environment.sh
new file mode 100755
index 00000000..ea04f905
--- /dev/null
+++ b/kokoro/release/linux/ruby/ruby_build_environment.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set +ex
+[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
+set -e # rvm commands are very verbose
+rvm --default use ruby-2.4.1
+gem install bundler --update
+set -ex
diff --git a/kokoro/release/macos/build_artifacts.sh b/kokoro/release/macos/build_artifacts.sh
new file mode 100755
index 00000000..23135ca3
--- /dev/null
+++ b/kokoro/release/macos/build_artifacts.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -ex
+
+# change to repo root
+cd $(dirname $0)/../../..
+
+# all artifacts come here
+mkdir artifacts
+export ARTIFACT_DIR=$(pwd)/artifacts
+
+# ruby environment
+bash kokoro/release/macos/ruby/ruby_build_environment.sh
+
+gem install rubygems-update
+update_rubygems
+
+# build artifacts
+bash kokoro/release/macos/ruby/ruby_build.sh
diff --git a/kokoro/release/macos/release.cfg b/kokoro/release/macos/release.cfg
new file mode 100644
index 00000000..35d36dee
--- /dev/null
+++ b/kokoro/release/macos/release.cfg
@@ -0,0 +1,8 @@
+# Configuration for Mac OSX release builds
+build_file: "protobuf/kokoro/release/macos/build_artifacts.sh"
+
+action {
+ define_artifacts {
+ regex: "github/protobuf/artifacts/**"
+ }
+}
diff --git a/kokoro/release/macos/ruby/ruby_build.sh b/kokoro/release/macos/ruby/ruby_build.sh
new file mode 100755
index 00000000..cf6b433d
--- /dev/null
+++ b/kokoro/release/macos/ruby/ruby_build.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Build protoc
+if test ! -e src/protoc; then
+ ./autogen.sh
+ ./configure
+ make -j4
+fi
+
+umask 0022
+pushd ruby
+bundle install && bundle exec rake gem:native
+ls pkg
+mv pkg/* $ARTIFACT_DIR
+popd
diff --git a/kokoro/release/macos/ruby/ruby_build_environment.sh b/kokoro/release/macos/ruby/ruby_build_environment.sh
new file mode 100755
index 00000000..e9c619cd
--- /dev/null
+++ b/kokoro/release/macos/ruby/ruby_build_environment.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+set -ex
+
+set +ex # rvm script is very verbose and exits with errorcode
+source $HOME/.rvm/scripts/rvm
+set -e # rvm commands are very verbose
+time rvm install 2.5.0
+rvm use 2.5.0 --default
+gem install rake-compiler --no-ri --no-doc
+gem install bundler --no-ri --no-doc
+rvm osx-ssl-certs status all
+rvm osx-ssl-certs update all
+set -ex
+
+rm -rf ~/.rake-compiler
+
+CROSS_RUBY=$(mktemp tmpfile.XXXXXXXX)
+
+curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > "$CROSS_RUBY"
+
+# See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details
+patch "$CROSS_RUBY" << EOF
+--- cross-ruby.rake 2018-04-10 11:32:16.000000000 -0700
++++ patched 2018-04-10 11:40:25.000000000 -0700
+@@ -133,8 +133,10 @@
+ "--host=#{MINGW_HOST}",
+ "--target=#{MINGW_TARGET}",
+ "--build=#{RUBY_BUILD}",
+- '--enable-shared',
++ '--enable-static',
++ '--disable-shared',
+ '--disable-install-doc',
++ '--without-gmp',
+ '--with-ext='
+ ]
+
+@@ -151,6 +153,7 @@
+ # make
+ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/ruby.exe" => ["#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile"] do |t|
+ chdir File.dirname(t.prerequisites.first) do
++ sh "test -s verconf.h || rm -f verconf.h" # if verconf.h has size 0, make sure it gets re-built by make
+ sh MAKE
+ end
+ end
+EOF
+
+MAKE="make -j8"
+
+for v in 2.5.0 2.4.0 2.3.0 2.2.2 2.1.6 2.0.0-p645 ; do
+ ccache -c
+ rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE"
+done
+
+sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY"
+mv "$CROSS_RUBY" ~/.rake-compiler/config.yml
+
diff --git a/kokoro/release/protoc/macos/build.sh b/kokoro/release/protoc/macos/build.sh
new file mode 100644
index 00000000..db9d3140
--- /dev/null
+++ b/kokoro/release/protoc/macos/build.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -x
+CXXFLAGS_COMMON="-DNDEBUG -mmacosx-version-min=10.9"
+
+cd github/protobuf
+./autogen.sh
+
+mkdir build32 && cd build32
+export CXXFLAGS="$CXXFLAGS_COMMON -m32"
+../configure --disable-shared
+make -j4
+file src/protoc
+otool -L src/protoc | grep dylib
+cd ..
+
+mkdir build64 && cd build64
+export CXXFLAGS="$CXXFLAGS_COMMON -m64"
+../configure --disable-shared
+make -j4
+file src/protoc
+otool -L src/protoc | grep dylib
+cd ..
diff --git a/kokoro/release/protoc/macos/release.cfg b/kokoro/release/protoc/macos/release.cfg
new file mode 100644
index 00000000..da903d03
--- /dev/null
+++ b/kokoro/release/protoc/macos/release.cfg
@@ -0,0 +1,8 @@
+# Configuration for Mac OSX protoc release builds
+build_file: "protobuf/kokoro/release/protoc/macos/build.sh"
+
+action {
+ define_artifacts {
+ regex: "**/protoc"
+ }
+}
diff --git a/kokoro/release/protoc/windows/build.bat b/kokoro/release/protoc/windows/build.bat
new file mode 100644
index 00000000..ae0fa94a
--- /dev/null
+++ b/kokoro/release/protoc/windows/build.bat
@@ -0,0 +1,27 @@
+set PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH%
+set generator32=Visual Studio 14
+set generator64=Visual Studio 14 Win64
+set vcplatform32=win32
+set vcplatform64=x64
+set configuration=Release
+
+echo Building protoc
+cd github\protobuf
+
+mkdir build32
+cd build32
+cmake -G "%generator32%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake
+msbuild protobuf.sln /p:Platform=%vcplatform32% || goto error
+cd ..
+
+mkdir build64
+cd build64
+cmake -G "%generator64%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake
+msbuild protobuf.sln /p:Platform=%vcplatform64% || goto error
+cd ..
+
+goto :EOF
+
+:error
+echo Failed!
+exit /b %ERRORLEVEL%
diff --git a/kokoro/release/protoc/windows/release.cfg b/kokoro/release/protoc/windows/release.cfg
new file mode 100644
index 00000000..0d0da8f1
--- /dev/null
+++ b/kokoro/release/protoc/windows/release.cfg
@@ -0,0 +1,8 @@
+# Configuration for Windows protoc release builds
+build_file: "protobuf/kokoro/release/protoc/windows/build.bat"
+
+action {
+ define_artifacts {
+ regex: "**/protoc.exe"
+ }
+}
diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml
index 3a556acf..28d713f3 100644
--- a/php/ext/google/protobuf/package.xml
+++ b/php/ext/google/protobuf/package.xml
@@ -10,11 +10,11 @@
<email>protobuf-opensource@google.com</email>
<active>yes</active>
</lead>
- <date>2018-03-06</date>
+ <date>2018-06-06</date>
<time>11:02:07</time>
<version>
- <release>3.5.2</release>
- <api>3.5.2</api>
+ <release>3.6.0</release>
+ <api>3.6.0</api>
</version>
<stability>
<release>stable</release>
@@ -232,5 +232,21 @@ GA release.
G A release.
</notes>
</release>
+ <release>
+ <version>
+ <release>3.6.0</release>
+ <api>3.6.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2018-06-06</date>
+ <time>11:02:07</time>
+ <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
+ <notes>
+G A release.
+ </notes>
+ </release>
</changelog>
</package>
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index c15bde2d..20035ab7 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -37,7 +37,7 @@
#include "upb.h"
#define PHP_PROTOBUF_EXTNAME "protobuf"
-#define PHP_PROTOBUF_VERSION "3.5.2"
+#define PHP_PROTOBUF_VERSION "3.6.0"
#define MAX_LENGTH_OF_INT64 20
#define SIZEOF_INT64 8
diff --git a/php/src/Google/Protobuf/Internal/Descriptor.php b/php/src/Google/Protobuf/Internal/Descriptor.php
index ee3a8bde..21ac5de3 100644
--- a/php/src/Google/Protobuf/Internal/Descriptor.php
+++ b/php/src/Google/Protobuf/Internal/Descriptor.php
@@ -44,6 +44,7 @@ class Descriptor
private $nested_type = [];
private $enum_type = [];
private $klass;
+ private $legacy_klass;
private $options;
private $oneof_decl = [];
@@ -151,6 +152,16 @@ class Descriptor
return $this->klass;
}
+ public function setLegacyClass($klass)
+ {
+ $this->legacy_klass = $klass;
+ }
+
+ public function getLegacyClass()
+ {
+ return $this->legacy_klass;
+ }
+
public function setOptions($options)
{
$this->options = $options;
@@ -167,16 +178,19 @@ class Descriptor
$message_name_without_package = "";
$classname = "";
+ $legacy_classname = "";
$fullname = "";
GPBUtil::getFullClassName(
$proto,
$containing,
$file_proto,
$message_name_without_package,
+ $legacy_classname,
$classname,
$fullname);
$desc->setFullName($fullname);
$desc->setClass($classname);
+ $desc->setLegacyClass($legacy_classname);
$desc->setOptions($proto->getOptions());
foreach ($proto->getField() as $field_proto) {
diff --git a/php/src/Google/Protobuf/Internal/DescriptorPool.php b/php/src/Google/Protobuf/Internal/DescriptorPool.php
index 304c1615..9b4dcc01 100644
--- a/php/src/Google/Protobuf/Internal/DescriptorPool.php
+++ b/php/src/Google/Protobuf/Internal/DescriptorPool.php
@@ -92,6 +92,7 @@ class DescriptorPool
$this->proto_to_class[$descriptor->getFullName()] =
$descriptor->getClass();
$this->class_to_desc[$descriptor->getClass()] = $descriptor;
+ $this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor;
foreach ($descriptor->getNestedType() as $nested_type) {
$this->addDescriptor($nested_type);
}
@@ -105,6 +106,7 @@ class DescriptorPool
$this->proto_to_class[$descriptor->getFullName()] =
$descriptor->getClass();
$this->class_to_enum_desc[$descriptor->getClass()] = $descriptor;
+ $this->class_to_enum_desc[$descriptor->getLegacyClass()] = $descriptor;
}
public function getDescriptorByClassName($klass)
diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptor.php b/php/src/Google/Protobuf/Internal/EnumDescriptor.php
index 01649fec..82a42767 100644
--- a/php/src/Google/Protobuf/Internal/EnumDescriptor.php
+++ b/php/src/Google/Protobuf/Internal/EnumDescriptor.php
@@ -9,6 +9,7 @@ class EnumDescriptor
use HasPublicDescriptorTrait;
private $klass;
+ private $legacy_klass;
private $full_name;
private $value;
private $name_to_value;
@@ -66,12 +67,23 @@ class EnumDescriptor
return $this->klass;
}
+ public function setLegacyClass($klass)
+ {
+ $this->legacy_klass = $klass;
+ }
+
+ public function getLegacyClass()
+ {
+ return $this->legacy_klass;
+ }
+
public static function buildFromProto($proto, $file_proto, $containing)
{
$desc = new EnumDescriptor();
$enum_name_without_package = "";
$classname = "";
+ $legacy_classname = "";
$fullname = "";
GPBUtil::getFullClassName(
$proto,
@@ -79,9 +91,11 @@ class EnumDescriptor
$file_proto,
$enum_name_without_package,
$classname,
+ $legacy_classname,
$fullname);
$desc->setFullName($fullname);
$desc->setClass($classname);
+ $desc->setLegacyClass($legacy_classname);
$values = $proto->getValue();
foreach ($values as $value) {
$desc->addValue($value->getNumber(), $value);
diff --git a/php/src/Google/Protobuf/Internal/GPBUtil.php b/php/src/Google/Protobuf/Internal/GPBUtil.php
index 023b07f4..b75d9bab 100644
--- a/php/src/Google/Protobuf/Internal/GPBUtil.php
+++ b/php/src/Google/Protobuf/Internal/GPBUtil.php
@@ -215,9 +215,10 @@ class GPBUtil
"Expect repeated field of different type.");
}
if ($var->getType() === GPBType::MESSAGE &&
- $var->getClass() !== $klass) {
+ $var->getClass() !== $klass &&
+ $var->getLegacyClass() !== $klass) {
throw new \Exception(
- "Expect repeated field of different message.");
+ "Expect repeated field of " . $klass . ".");
}
return $var;
}
@@ -242,9 +243,10 @@ class GPBUtil
throw new \Exception("Expect map field of value type.");
}
if ($var->getValueType() === GPBType::MESSAGE &&
- $var->getValueClass() !== $klass) {
+ $var->getValueClass() !== $klass &&
+ $var->getLegacyValueClass() !== $klass) {
throw new \Exception(
- "Expect map field of different value message.");
+ "Expect map field of " . $klass . ".");
}
return $var;
}
@@ -299,6 +301,17 @@ class GPBUtil
return "";
}
+ public static function getLegacyClassNameWithoutPackage(
+ $name,
+ $file_proto)
+ {
+ $parts = explode('.', $name);
+ foreach ($parts as $i => $part) {
+ $parts[$i] = static::getClassNamePrefix($parts[$i], $file_proto) . $parts[$i];
+ }
+ return implode('\\', $parts);
+ }
+
public static function getClassNameWithoutPackage(
$name,
$file_proto)
@@ -316,6 +329,7 @@ class GPBUtil
$file_proto,
&$message_name_without_package,
&$classname,
+ &$legacy_classname,
&$fullname)
{
// Full name needs to start with '.'.
@@ -334,21 +348,28 @@ class GPBUtil
$class_name_without_package =
static::getClassNameWithoutPackage($message_name_without_package, $file_proto);
+ $legacy_class_name_without_package =
+ static::getLegacyClassNameWithoutPackage(
+ $message_name_without_package, $file_proto);
$option = $file_proto->getOptions();
if (!is_null($option) && $option->hasPhpNamespace()) {
$namespace = $option->getPhpNamespace();
if ($namespace !== "") {
$classname = $namespace . "\\" . $class_name_without_package;
+ $legacy_classname =
+ $namespace . "\\" . $legacy_class_name_without_package;
return;
} else {
$classname = $class_name_without_package;
+ $legacy_classname = $legacy_class_name_without_package;
return;
}
}
if ($package === "") {
$classname = $class_name_without_package;
+ $legacy_classname = $legacy_class_name_without_package;
} else {
$parts = array_map('ucwords', explode('.', $package));
foreach ($parts as $i => $part) {
@@ -358,6 +379,9 @@ class GPBUtil
implode('\\', $parts) .
"\\".self::getClassNamePrefix($class_name_without_package,$file_proto).
$class_name_without_package;
+ $legacy_classname =
+ implode('\\', array_map('ucwords', explode('.', $package))).
+ "\\".$legacy_class_name_without_package;
}
}
diff --git a/php/src/Google/Protobuf/Internal/MapField.php b/php/src/Google/Protobuf/Internal/MapField.php
index 38736dad..f7d7b710 100644
--- a/php/src/Google/Protobuf/Internal/MapField.php
+++ b/php/src/Google/Protobuf/Internal/MapField.php
@@ -58,7 +58,11 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
/**
* @ignore
*/
- private $value_klass;
+ private $klass;
+ /**
+ * @ignore
+ */
+ private $legacy_klass;
/**
* Constructs an instance of MapField.
@@ -75,6 +79,17 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
$this->key_type = $key_type;
$this->value_type = $value_type;
$this->klass = $klass;
+
+ if ($this->value_type == GPBType::MESSAGE) {
+ $pool = DescriptorPool::getGeneratedPool();
+ $desc = $pool->getDescriptorByClassName($klass);
+ if ($desc == NULL) {
+ new $klass; // No msg class instance has been created before.
+ $desc = $pool->getDescriptorByClassName($klass);
+ }
+ $this->klass = $desc->getClass();
+ $this->legacy_klass = $desc->getLegacyClass();
+ }
}
/**
@@ -102,6 +117,14 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
}
/**
+ * @ignore
+ */
+ public function getLegacyValueClass()
+ {
+ return $this->legacy_klass;
+ }
+
+ /**
* Return the element at the given key.
*
* This will also be called for: $ele = $arr[$key]
diff --git a/php/src/Google/Protobuf/Internal/RepeatedField.php b/php/src/Google/Protobuf/Internal/RepeatedField.php
index 797b3b3a..e0ddef50 100644
--- a/php/src/Google/Protobuf/Internal/RepeatedField.php
+++ b/php/src/Google/Protobuf/Internal/RepeatedField.php
@@ -59,6 +59,10 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
* @ignore
*/
private $klass;
+ /**
+ * @ignore
+ */
+ private $legacy_klass;
/**
* Constructs an instance of RepeatedField.
@@ -71,7 +75,16 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
{
$this->container = [];
$this->type = $type;
- $this->klass = $klass;
+ if ($this->type == GPBType::MESSAGE) {
+ $pool = DescriptorPool::getGeneratedPool();
+ $desc = $pool->getDescriptorByClassName($klass);
+ if ($desc == NULL) {
+ new $klass; // No msg class instance has been created before.
+ $desc = $pool->getDescriptorByClassName($klass);
+ }
+ $this->klass = $desc->getClass();
+ $this->legacy_klass = $desc->getLegacyClass();
+ }
}
/**
@@ -91,6 +104,14 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
}
/**
+ * @ignore
+ */
+ public function getLegacyClass()
+ {
+ return $this->legacy_klass;
+ }
+
+ /**
* Return the element at the given index.
*
* This will also be called for: $ele = $arr[0]
diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh
index 7caa46e7..b5b255ea 100755
--- a/php/tests/compatibility_test.sh
+++ b/php/tests/compatibility_test.sh
@@ -2,12 +2,14 @@
function use_php() {
VERSION=$1
- PHP=`which php`
- PHP_CONFIG=`which php-config`
- PHPIZE=`which phpize`
- ln -sfn "/usr/local/php-${VERSION}/bin/php" $PHP
- ln -sfn "/usr/local/php-${VERSION}/bin/php-config" $PHP_CONFIG
- ln -sfn "/usr/local/php-${VERSION}/bin/phpize" $PHPIZE
+
+ OLD_PATH=$PATH
+ OLD_CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH
+ OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH
+
+ export PATH=/usr/local/php-${VERSION}/bin:$OLD_PATH
+ export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_CPLUS_INCLUDE_PATH
+ export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_C_INCLUDE_PATH
}
function generate_proto() {
@@ -18,7 +20,22 @@ function generate_proto() {
mkdir generated
$PROTOC1 --php_out=generated proto/test_include.proto
- $PROTOC2 --php_out=generated proto/test.proto proto/test_no_namespace.proto proto/test_prefix.proto
+ $PROTOC2 --php_out=generated \
+ proto/test.proto \
+ proto/test_no_namespace.proto \
+ proto/test_prefix.proto \
+ proto/test_php_namespace.proto \
+ proto/test_empty_php_namespace.proto \
+ proto/test_reserved_enum_lower.proto \
+ proto/test_reserved_enum_upper.proto \
+ proto/test_reserved_enum_value_lower.proto \
+ proto/test_reserved_enum_value_upper.proto \
+ proto/test_reserved_message_lower.proto \
+ proto/test_reserved_message_upper.proto \
+ proto/test_service.proto \
+ proto/test_service_namespace.proto \
+ proto/test_descriptors.proto
+
pushd ../../src
$PROTOC2 --php_out=../php/tests/generated -I../php/tests -I. ../php/tests/proto/test_import_descriptor_proto.proto
popd
@@ -52,9 +69,9 @@ cd $(dirname $0)
# The old version of protobuf that we are testing compatibility against.
case "$1" in
- ""|3.3.0)
- OLD_VERSION=3.3.0
- OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.3.0/protoc-3.3.0-linux-x86_64.exe
+ ""|3.5.0)
+ OLD_VERSION=3.5.0
+ OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
;;
*)
echo "[ERROR]: Unknown version number: $1"
@@ -81,7 +98,7 @@ git checkout v$OLD_VERSION
popd
# Build and copy the new runtime
-use_php 5.5
+use_php 7.1
pushd ../ext/google/protobuf
make clean || true
phpize && ./configure && make
@@ -99,12 +116,12 @@ chmod +x old_protoc
NEW_PROTOC=`pwd`/../../src/protoc
OLD_PROTOC=`pwd`/old_protoc
cd protobuf/php
-cp -r /usr/local/vendor-5.5 vendor
-wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit
+composer install
# Remove implementation detail tests.
tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php )
sed -i.bak '/php_implementation_test.php/d' phpunit.xml
+sed -i.bak '/generated_phpdoc_test.php/d' phpunit.xml
for t in "${tests[@]}"
do
remove_error_test tests/$t
@@ -118,7 +135,7 @@ cd tests
generate_proto $OLD_PROTOC $OLD_PROTOC
./test.sh
pushd ..
-phpunit
+./vendor/bin/phpunit
popd
# Test A.2:
@@ -127,7 +144,7 @@ popd
generate_proto $NEW_PROTOC $OLD_PROTOC
./test.sh
pushd ..
-phpunit
+./vendor/bin/phpunit
popd
# Test A.3:
@@ -136,5 +153,5 @@ popd
generate_proto $OLD_PROTOC $NEW_PROTOC
./test.sh
pushd ..
-phpunit
+./vendor/bin/phpunit
popd
diff --git a/post_process_dist.sh b/post_process_dist.sh
index eb5f584d..5b14de67 100755
--- a/post_process_dist.sh
+++ b/post_process_dist.sh
@@ -27,7 +27,7 @@ fi
set -ex
-LANGUAGES="cpp csharp java javanano js objectivec python ruby php all"
+LANGUAGES="cpp csharp java js objectivec python ruby php all"
BASENAME=`basename $1 .tar.gz`
VERSION=${BASENAME:9}
diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml
index 298730a6..667a0215 100644
--- a/protoc-artifacts/pom.xml
+++ b/protoc-artifacts/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protoc</artifactId>
- <version>3.5.2</version>
+ <version>3.6.0</version>
<packaging>pom</packaging>
<name>Protobuf Compiler</name>
<description>
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index d4360727..58a3f040 100755
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -30,7 +30,7 @@
# Copyright 2007 Google Inc. All Rights Reserved.
-__version__ = '3.5.2'
+__version__ = '3.6.0'
if __name__ != '__main__':
try:
diff --git a/python/setup.py b/python/setup.py
index ebbe1bb6..335e9114 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -203,11 +203,9 @@ if __name__ == '__main__':
v, _, _ = platform.mac_ver()
if v:
- v = float('.'.join(v.split('.')[:2]))
- if v >= 10.12:
- extra_compile_args.append('-std=c++11')
+ extra_compile_args.append('-std=c++11')
elif os.getenv('KOKORO_BUILD_NUMBER') or os.getenv('KOKORO_BUILD_ID'):
- extra_compile_args.append('-std=c++11')
+ extra_compile_args.append('-std=c++11')
if warnings_as_errors in sys.argv:
extra_compile_args.append('-Werror')
diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb
index 0886e607..cc097e11 100644
--- a/ruby/ext/google/protobuf_c/extconf.rb
+++ b/ruby/ext/google/protobuf_c/extconf.rb
@@ -2,7 +2,9 @@
require 'mkmf'
-$CFLAGS += " -std=c99 -O3 -DNDEBUG"
+unless RUBY_PLATFORM =~ /mswin|mingw/
+ $CFLAGS += " -std=c99 -O3 -DNDEBUG"
+end
if RUBY_PLATFORM =~ /linux/
diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec
index c09a7f24..cc7625d4 100644
--- a/ruby/google-protobuf.gemspec
+++ b/ruby/google-protobuf.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "google-protobuf"
- s.version = "3.5.2"
+ s.version = "3.6.0"
s.licenses = ["BSD-3-Clause"]
s.summary = "Protocol Buffers"
s.description = "Protocol Buffers are Google's data interchange format."
diff --git a/src/Makefile.am b/src/Makefile.am
index b8648049..09ab76f7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -164,7 +164,7 @@ nobase_include_HEADERS = \
lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
-libprotobuf_lite_la_LDFLAGS = -version-info 15:1:0 -export-dynamic -no-undefined
+libprotobuf_lite_la_LDFLAGS = -version-info 16:0:0 -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
@@ -210,7 +210,7 @@ libprotobuf_lite_la_SOURCES = \
google/protobuf/io/zero_copy_stream_impl_lite.cc
libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
-libprotobuf_la_LDFLAGS = -version-info 15:1:0 -export-dynamic -no-undefined
+libprotobuf_la_LDFLAGS = -version-info 16:0:0 -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
@@ -301,7 +301,7 @@ libprotobuf_la_SOURCES = \
nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)
libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
-libprotoc_la_LDFLAGS = -version-info 15:1:0 -export-dynamic -no-undefined
+libprotoc_la_LDFLAGS = -version-info 16:0:0 -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index bc537999..8a4c7f97 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index 5a720cce..0f90f411 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc
index 7109ed5b..dfa60068 100644
--- a/src/google/protobuf/compiler/js/js_generator.cc
+++ b/src/google/protobuf/compiler/js/js_generator.cc
@@ -2962,8 +2962,12 @@ void Generator::GenerateClassDeserializeBinaryField(
if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) {
printer->Print(", $messageType$.deserializeBinaryFromReader",
"messageType", GetMessagePath(options, value_field->message_type()));
+ } else {
+ printer->Print(", null");
}
-
+ printer->Print(", $defaultKey$",
+ "defaultKey", JSFieldDefault(key_field)
+ );
printer->Print(");\n");
printer->Print(" });\n");
} else {
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index 5ad6b4d3..d5b70a88 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
index 695a7b02..58dd0ac4 100644
--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -775,10 +775,10 @@ class FileDescriptorTables {
SymbolsByParentMap symbols_by_parent_;
mutable FieldsByNameMap fields_by_lowercase_name_;
- mutable FieldsByNameMap* fields_by_lowercase_name_tmp_;
+ std::unique_ptr<FieldsByNameMap> fields_by_lowercase_name_tmp_;
mutable GoogleOnceDynamic fields_by_lowercase_name_once_;
mutable FieldsByNameMap fields_by_camelcase_name_;
- mutable FieldsByNameMap* fields_by_camelcase_name_tmp_;
+ std::unique_ptr<FieldsByNameMap> fields_by_camelcase_name_tmp_;
mutable GoogleOnceDynamic fields_by_camelcase_name_once_;
FieldsByNumberMap fields_by_number_; // Not including extensions.
EnumValuesByNumberMap enum_values_by_number_;
@@ -1146,10 +1146,8 @@ bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) {
void FileDescriptorTables::FinalizeTables() {
// Clean up the temporary maps used by AddFieldByStylizedNames().
- delete fields_by_lowercase_name_tmp_;
- fields_by_lowercase_name_tmp_ = NULL;
- delete fields_by_camelcase_name_tmp_;
- fields_by_camelcase_name_tmp_ = NULL;
+ fields_by_lowercase_name_tmp_ = nullptr;
+ fields_by_camelcase_name_tmp_ = nullptr;
}
void FileDescriptorTables::AddFieldByStylizedNames(
@@ -1164,7 +1162,7 @@ void FileDescriptorTables::AddFieldByStylizedNames(
// entries from fields_by_number_.
PointerStringPair lowercase_key(parent, field->lowercase_name().c_str());
- if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_, lowercase_key,
+ if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_.get(), lowercase_key,
field)) {
InsertIfNotPresent(
&fields_by_lowercase_name_, lowercase_key,
@@ -1172,7 +1170,7 @@ void FileDescriptorTables::AddFieldByStylizedNames(
}
PointerStringPair camelcase_key(parent, field->camelcase_name().c_str());
- if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_, camelcase_key,
+ if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_.get(), camelcase_key,
field)) {
InsertIfNotPresent(
&fields_by_camelcase_name_, camelcase_key,
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index 5e7a05d5..7a8617a2 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h
index 3d0889d1..751edbef 100644
--- a/src/google/protobuf/duration.pb.h
+++ b/src/google/protobuf/duration.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h
index 53857e5f..c3da4fa8 100644
--- a/src/google/protobuf/empty.pb.h
+++ b/src/google/protobuf/empty.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h
index 144b41fa..7550f7a9 100644
--- a/src/google/protobuf/field_mask.pb.h
+++ b/src/google/protobuf/field_mask.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h
index bdaa561b..4da04cae 100644
--- a/src/google/protobuf/generated_message_util.h
+++ b/src/google/protobuf/generated_message_util.h
@@ -335,7 +335,16 @@ struct LIBPROTOBUF_EXPORT SCCInfoBase {
kRunning = 1,
kUninitialized = -1, // initial state
};
+#ifndef _MSC_VER
std::atomic<int> visit_status;
+#else
+ // MSVC doesnt make std::atomic constant initialized. This union trick
+ // makes it so.
+ union {
+ int visit_status_to_make_linker_init;
+ std::atomic<int> visit_status;
+ };
+#endif
int num_deps;
void (*init_func)();
// This is followed by an array of num_deps
diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h
index 16ed21ca..eee1b73f 100644
--- a/src/google/protobuf/source_context.pb.h
+++ b/src/google/protobuf/source_context.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h
index 75665ff2..b2263435 100644
--- a/src/google/protobuf/struct.pb.h
+++ b/src/google/protobuf/struct.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h
index c336383d..5d320764 100644
--- a/src/google/protobuf/stubs/common.h
+++ b/src/google/protobuf/stubs/common.h
@@ -101,27 +101,27 @@ namespace internal {
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 3005001
+#define GOOGLE_PROTOBUF_VERSION 3006000
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
// The minimum library version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3005000
+#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3006000
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// generator.
-static const int kMinHeaderVersionForLibrary = 3005000;
+static const int kMinHeaderVersionForLibrary = 3006000;
// The minimum protoc version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3005000
+#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3006000
// The minimum header version which works with the current version of
// protoc. This constant should only be used in VerifyVersion().
-static const int kMinHeaderVersionForProtoc = 3005000;
+static const int kMinHeaderVersionForProtoc = 3006000;
// Verifies that the headers and libraries are compatible. Use the macro
// below to call this.
diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h
index f73e75b3..daea80f6 100644
--- a/src/google/protobuf/timestamp.pb.h
+++ b/src/google/protobuf/timestamp.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h
index 69af6c2e..cbd0cdcc 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index 9f51a062..b00d4ea9 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#if GOOGLE_PROTOBUF_VERSION < 3006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.