diff options
author | Jisi Liu <liujisi@google.com> | 2016-07-29 14:27:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 14:27:53 -0700 |
commit | 169d0ca43c5663c1b36cf4918f08aa031f5df468 (patch) | |
tree | 4781b8c492591d73e7eea2b2abd4c546baf1d135 | |
parent | 42e54876be41fdf0b22dea4e4ea7f416d5d1f3ec (diff) | |
parent | c4790429fc454a687312a48a22e30d93c29efd4d (diff) | |
download | protobuf-169d0ca43c5663c1b36cf4918f08aa031f5df468.tar.gz protobuf-169d0ca43c5663c1b36cf4918f08aa031f5df468.tar.bz2 protobuf-169d0ca43c5663c1b36cf4918f08aa031f5df468.zip |
Merge pull request #1893 from google/3.0.0-GA
Merge 3.0.0-GA into master
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | CHANGES.txt | 51 | ||||
-rw-r--r-- | Protobuf.podspec | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | csharp/Google.Protobuf.Tools.nuspec | 2 | ||||
-rw-r--r-- | csharp/src/Google.Protobuf/project.json | 2 | ||||
-rw-r--r-- | java/core/pom.xml | 2 | ||||
-rw-r--r-- | java/lite/pom.xml | 2 | ||||
-rw-r--r-- | java/pom.xml | 2 | ||||
-rw-r--r-- | java/util/pom.xml | 2 | ||||
-rw-r--r-- | js/package.json | 2 | ||||
-rwxr-xr-x | protoc-artifacts/build-protoc.sh | 27 | ||||
-rwxr-xr-x | protoc-artifacts/build-zip.sh | 52 | ||||
-rw-r--r-- | protoc-artifacts/pom.xml | 3 | ||||
-rwxr-xr-x | python/google/protobuf/__init__.py | 2 | ||||
-rw-r--r-- | python/setup.cfg | 2 | ||||
-rw-r--r-- | ruby/google-protobuf.gemspec | 2 | ||||
-rw-r--r-- | ruby/pom.xml | 2 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/google/protobuf/stubs/int128.cc | 6 | ||||
-rw-r--r-- | src/google/protobuf/stubs/port.h | 20 | ||||
-rw-r--r-- | src/google/protobuf/util/time_util.cc | 9 | ||||
-rwxr-xr-x | tests.sh | 9 |
23 files changed, 158 insertions, 53 deletions
diff --git a/.travis.yml b/.travis.yml index 1417cb98..094235e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,10 @@ matrix: # 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 allow_failures: # These currently do not work on OS X but are being worked on by @haberman. - os: osx diff --git a/CHANGES.txt b/CHANGES.txt index 04fa418e..822136c0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,54 @@ +2016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) + General + * This log only contains changes since the beta-4 release. Summarized change + log since the last stable release (v2.6.1) can be found in the github + release page. + + Compatibility Notice + * v3.0.0 is the first API stable release of the v3.x series. We do not expect + any future API breaking changes. + * For C++, Java Lite and Objective-C, source level compatibility is + guaranteed. Upgrading from v3.0.0 to newer minor version releases will be + source compatible. For example, if your code compiles against protobuf + v3.0.0, it will continue to compile after you upgrade protobuf library to + v3.1.0. + * For other languages, both source level compatibility and binary level + compatibility are guaranteed. For example, if you have a Java binary built + against protobuf v3.0.0. After switching the protobuf runtime binary to + v3.1.0, your built binary should continue to work. + * Compatibility is only guaranteed for documented API and documented + behaviors. If you are using undocumented API (e.g., use anything in the C++ + internal namespace), it can be broken by minor version releases in an + undetermined manner. + + Ruby + * When you assign a string field `a.string_field = "X"`, we now call + #encode(UTF-8) on the string and freeze the copy. This saves you from + needing to ensure the string is already encoded as UTF-8. It also prevents + you from mutating the string after it has been assigned (this is how we + ensure it stays valid UTF-8). + * The generated file for `foo.proto` is now `foo_pb.rb` instead of just + `foo.rb`. This makes it easier to see which imports/requires are from + protobuf generated code, and also prevents conflicts with any `foo.rb` file + you might have written directly in Ruby. It is a backward-incompatible + change: you will need to update all of your `require` statements. + * For package names like `foo_bar`, we now translate this to the Ruby module + `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`). + + JavaScript + * Scalar fields like numbers and boolean now return defaults instead of + `undefined` or `null` when they are unset. You can test for presence + explicitly by calling `hasFoo()`, which we now generate for scalar fields. + + Java Lite + * Java Lite is now implemented as a separate plugin, maintained in the + `javalite` branch. Both lite runtime and protoc artifacts will be available + in Maven. + + C# + * Target platforms now .NET 4.5, selected portable subsets and .NET Core. + * legacy_enum_values option is no longer supported. + 2016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript) General * Added a deterministic serialization API for C++. The deterministic diff --git a/Protobuf.podspec b/Protobuf.podspec index ac27f03e..642fc3e2 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.0.0-beta-4' + s.version = '3.0.0' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/google/protobuf' s.license = 'New BSD' diff --git a/configure.ac b/configure.ac index 7ae4a88b..41887997 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.0.0-beta-4],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.0.0],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 659b2e77..24b4a776 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.0.0-beta4</version> + <version>3.0.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/project.json b/csharp/src/Google.Protobuf/project.json index c8eae6d0..9b831f12 100644 --- a/csharp/src/Google.Protobuf/project.json +++ b/csharp/src/Google.Protobuf/project.json @@ -1,5 +1,5 @@ { - "version": "3.0.0-beta4", + "version": "3.0.0", "title": "Google Protocol Buffers", "description": "See project site for more info.", "authors": [ "Google Inc." ], diff --git a/java/core/pom.xml b/java/core/pom.xml index 422bde82..39d67818 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.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-java</artifactId> diff --git a/java/lite/pom.xml b/java/lite/pom.xml index 87a5c44d..9862cd94 100644 --- a/java/lite/pom.xml +++ b/java/lite/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-lite</artifactId> diff --git a/java/pom.xml b/java/pom.xml index 2d8e9a13..3a91a0ba 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -11,7 +11,7 @@ <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> <packaging>pom</packaging> <name>Protocol Buffers [Parent]</name> diff --git a/java/util/pom.xml b/java/util/pom.xml index d8f64eb1..0d5e8e37 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.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-java-util</artifactId> diff --git a/js/package.json b/js/package.json index 76ce0c1d..3f51d96b 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 88e6ae50..e31948e9 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -1,17 +1,30 @@ #!/bin/bash -# Builds protoc executable into target/protoc.exe +# Builds protoc executable into target/protoc.exe; optionally build protoc +# plugins into target/protoc-gen-*.exe # To be run from Maven. -# Usage: build-protoc.sh <OS> <ARCH> +# Usage: build-protoc.sh <OS> <ARCH> <TARGET> # <OS> and <ARCH> are ${os.detected.name} and ${os.detected.arch} from os-maven-plugin +# <TARGET> can be "protoc" or "protoc-gen-javalite" OS=$1 ARCH=$2 +MAKE_TARGET=$3 -if [[ $# < 2 ]]; then +if [[ $# < 3 ]]; then echo "No arguments provided. This script is intended to be run from Maven." exit 1 fi +case $MAKE_TARGET in + protoc-gen-javalite) + ;; + protoc) + ;; + *) + echo "Target ""$TARGET"" invalid." + exit 1 +esac + # Under Cygwin, bash doesn't have these in PATH when called from Maven which # runs in Windows version of Java. export PATH="/bin:/usr/bin:$PATH" @@ -126,7 +139,7 @@ checkDependencies () } ############################################################################ -echo "Building protoc, OS=$OS ARCH=$ARCH" +echo "Building protoc, OS=$OS ARCH=$ARCH TARGET=$TARGET" # Nested double quotes are unintuitive, but it works. cd "$(dirname "$0")" @@ -134,7 +147,7 @@ cd "$(dirname "$0")" WORKING_DIR=$(pwd) CONFIGURE_ARGS="--disable-shared" -MAKE_TARGET="protoc" +TARGET_FILE=target/$MAKE_TARGET.exe if [[ "$OS" == windows ]]; then MAKE_TARGET="${MAKE_TARGET}.exe" fi @@ -209,12 +222,10 @@ fi export CXXFLAGS LDFLAGS -TARGET_FILE=target/protoc.exe - cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && - (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) || + cp ../src/$MAKE_TARGET $TARGET_FILE || exit 1 if [[ "$OS" == osx ]]; then diff --git a/protoc-artifacts/build-zip.sh b/protoc-artifacts/build-zip.sh index 054e2ea1..3c5e887b 100755 --- a/protoc-artifacts/build-zip.sh +++ b/protoc-artifacts/build-zip.sh @@ -1,26 +1,30 @@ #!/bin/bash -if [ $# -eq 0 ]; then +if [ $# -ne 2 ]; then cat <<EOF -Usage: $0 <VERSION_NUMBER> +Usage: $0 <TARGET> <VERSION_NUMBER> + +TARGET: protoc | protoc-gen-javalite Example: - $ $0 3.0.0-beta-4 + $ $0 protoc 3.0.0 + $ $0 protoc-gen-javalite 3.0.0 -This script will download pre-built protoc binaries from maven repository -and package them with well-known type .proto files to create .zip packages -suitable to be included in the github release page. Each invocation will -create 5 zip packages: - dist/protoc-<VERSION_NUMBER>-win32.zip - dist/protoc-<VERSION_NUMBER>-osx-x86_32.zip - dist/protoc-<VERSION_NUMBER>-osx-x86_64.zip - dist/protoc-<VERSION_NUMBER>-linux-x86_32.zip - dist/protoc-<VERSION_NUMBER>-linux-x86_64.zip +This script will download pre-built protoc or protoc plugin binaries from maven +repository and create .zip packages suitable to be included in the github +release page. If the target is protoc, well-known type .proto files will also be +included. Each invocation will create 5 zip packages: + dist/<TARGET>-<VERSION_NUMBER>-win32.zip + dist/<TARGET>-<VERSION_NUMBER>-osx-x86_32.zip + dist/<TARGET>-<VERSION_NUMBER>-osx-x86_64.zip + dist/<TARGET>-<VERSION_NUMBER>-linux-x86_32.zip + dist/<TARGET>-<VERSION_NUMBER>-linux-x86_64.zip EOF exit 1 fi -VERSION_NUMBER=$1 +TARGET=$1 +VERSION_NUMBER=$2 # <zip file name> <binary file name> pairs. declare -a FILE_NAMES=( \ @@ -78,17 +82,27 @@ mkdir -p ${DIR}/bin # Create a zip file for each binary. for((i=0;i<${#FILE_NAMES[@]};i+=2));do ZIP_NAME=${FILE_NAMES[$i]} + if [ ${ZIP_NAME:0:3} = "win" ]; then + BINARY="$TARGET.exe" + else + BINARY="$TARGET" + fi BINARY_NAME=${FILE_NAMES[$(($i+1))]} - BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/protoc/${VERSION_NUMBER}/protoc-${VERSION_NUMBER}-${BINARY_NAME} - if ! wget ${BINARY_URL} -O ${DIR}/bin/protoc &> /dev/null; then + BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/$TARGET/${VERSION_NUMBER}/$TARGET-${VERSION_NUMBER}-${BINARY_NAME} + if ! wget ${BINARY_URL} -O ${DIR}/bin/$BINARY &> /dev/null; then echo "[ERROR] Failed to download ${BINARY_URL}" >&2 - echo "[ERROR] Skipped protoc-${VERSION_NAME}-${ZIP_NAME}" >&2 + echo "[ERROR] Skipped $TARGET-${VERSION_NAME}-${ZIP_NAME}" >&2 continue fi - TARGET_ZIP_FILE=`pwd`/dist/protoc-${VERSION_NUMBER}-${ZIP_NAME} + TARGET_ZIP_FILE=`pwd`/dist/$TARGET-${VERSION_NUMBER}-${ZIP_NAME} pushd $DIR &> /dev/null - chmod +x bin/protoc - zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null + chmod +x bin/$BINARY + if [ "$TARGET" = "protoc" ]; then + zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null + else + zip -r ${TARGET_ZIP_FILE} bin &> /dev/null + fi + rm bin/$BINARY popd &> /dev/null echo "[INFO] Successfully created ${TARGET_ZIP_FILE}" done diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 8fad896a..840bc60a 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.0.0-beta-4</version> + <version>3.0.0</version> <packaging>pom</packaging> <name>Protobuf Compiler</name> <description> @@ -59,6 +59,7 @@ <argument>build-protoc.sh</argument> <argument>${os.detected.name}</argument> <argument>${os.detected.arch}</argument> + <argument>protoc</argument> </arguments> </configuration> </plugin> diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 7213496e..6210a404 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.0.0b4' +__version__ = '3.0.0' if __name__ != '__main__': try: diff --git a/python/setup.cfg b/python/setup.cfg new file mode 100644 index 00000000..2a9acf13 --- /dev/null +++ b/python/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 8cf40e3f..286d8fe3 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.0.0.alpha.7.0.0" + s.version = "3.0.0" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." diff --git a/ruby/pom.xml b/ruby/pom.xml index 62845815..99e8449b 100644 --- a/ruby/pom.xml +++ b/ruby/pom.xml @@ -86,7 +86,7 @@ <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> - <version>3.0.0-beta-3</version> + <version>3.0.0-beta-4</version> </dependency> </dependencies> </project> diff --git a/src/Makefile.am b/src/Makefile.am index 524886ea..f70e9550 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,10 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) # If I say "dist_include_DATA", automake complains that $(includedir) is not # a "legitimate" directory for DATA. Screw you, automake. protodir = $(includedir) + +# If you are adding new files here, also remember to change the build files for +# all other languages, //protoc-artifacts/build-zip.sh and run +# //update_file_list.sh for bazel. nobase_dist_proto_DATA = google/protobuf/descriptor.proto \ google/protobuf/any.proto \ google/protobuf/api.proto \ diff --git a/src/google/protobuf/stubs/int128.cc b/src/google/protobuf/stubs/int128.cc index 3a36b4b1..a5090801 100644 --- a/src/google/protobuf/stubs/int128.cc +++ b/src/google/protobuf/stubs/int128.cc @@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) { std::streamsize div_base_log; switch (flags & std::ios::basefield) { case std::ios::hex: - div = GOOGLE_ULONGLONG(0x1000000000000000); // 16^15 + div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000)); // 16^15 div_base_log = 15; break; case std::ios::oct: - div = GOOGLE_ULONGLONG(01000000000000000000000); // 8^21 + div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000)); // 8^21 div_base_log = 21; break; default: // std::ios::dec - div = GOOGLE_ULONGLONG(10000000000000000000); // 10^19 + div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000)); // 10^19 div_base_log = 19; break; } diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 328258b7..d7f93b4c 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -109,15 +109,15 @@ typedef unsigned __int16 uint16; typedef unsigned __int32 uint32; typedef unsigned __int64 uint64; #else -typedef signed char int8; -typedef short int16; -typedef int int32; -typedef long long int64; - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef unsigned long long uint64; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef int64_t int64; + +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef uint64_t uint64; #endif // long long macros to be used because gcc and vc++ use different suffixes, @@ -131,8 +131,10 @@ typedef unsigned long long uint64; #define GOOGLE_ULONGLONG(x) x##UI64 #define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...) #else +// By long long, we actually mean int64. #define GOOGLE_LONGLONG(x) x##LL #define GOOGLE_ULONGLONG(x) x##ULL +// Used to format real long long integers. #define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also. #endif diff --git a/src/google/protobuf/util/time_util.cc b/src/google/protobuf/util/time_util.cc index c782d691..031d019a 100644 --- a/src/google/protobuf/util/time_util.cc +++ b/src/google/protobuf/util/time_util.cc @@ -142,6 +142,13 @@ int64 RoundTowardZero(int64 value, int64 divider) { } } // namespace +// Actually define these static const integers. Required by C++ standard (but +// omitting them may still work with some compilers). +const int64 TimeUtil::kTimestampMinSeconds; +const int64 TimeUtil::kTimestampMaxSeconds; +const int64 TimeUtil::kDurationMaxSeconds; +const int64 TimeUtil::kDurationMinSeconds; + string TimeUtil::ToString(const Timestamp& timestamp) { return FormatTime(timestamp.seconds(), timestamp.nanos()); } @@ -174,7 +181,7 @@ string TimeUtil::ToString(const Duration& duration) { seconds = -seconds; nanos = -nanos; } - result += StringPrintf("%" GOOGLE_LL_FORMAT "d", seconds); + result += SimpleItoa(seconds); if (nanos != 0) { result += "." + FormatNanos(nanos); } @@ -195,6 +195,14 @@ build_java_oracle7() { use_java oracle7 build_java oracle7 } +build_java_compatibility() { + use_java jdk7 + internal_build_cpp + # Use the unit-tests extraced from 2.5.0 to test the compatibilty between + # 3.0.0-beta-4 and the current version. + cd java/compatibility_tests/v2.5.0 + ./test.sh 3.0.0-beta-4 +} build_javanano_jdk7() { use_java jdk7 @@ -340,6 +348,7 @@ Usage: $0 { cpp | csharp | java_jdk7 | java_oracle7 | + java_compatibility | javanano_jdk7 | javanano_oracle7 | objectivec_ios | |