From d7e53e871b30aa640514cdc471d337cf2e8a458e Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 11 Mar 2019 15:39:50 -0600 Subject: [PATCH] Merge pull request #5454 from ejona86/protobuf-3.7.0 Upgrade to Protobuf 3.7.0 --- COMPILING.md | 10 ++--- android-interop-testing/app/build.gradle | 2 +- build.gradle | 4 +- buildscripts/make_dependencies.bat | 2 +- buildscripts/make_dependencies.sh | 2 +- core/build.gradle | 2 +- examples/android/helloworld/app/build.gradle | 2 +- examples/android/routeguide/app/build.gradle | 2 +- examples/build.gradle | 2 +- examples/example-alts/build.gradle | 2 +- examples/example-gauth/build.gradle | 2 +- examples/example-gauth/pom.xml | 2 +- .../android/helloworld/app/build.gradle | 2 +- examples/example-kotlin/build.gradle | 2 +- examples/example-tls/build.gradle | 2 +- examples/example-tls/pom.xml | 2 +- examples/pom.xml | 4 +- grpclb/build.gradle | 6 ++- protobuf-lite/build.gradle | 2 +- protobuf-nano/build.gradle | 2 +- protobuf/build.gradle | 2 +- repositories.bzl | 42 ++++++++++++++++--- services/build.gradle | 6 ++- xds/build.gradle | 6 ++- 24 files changed, 75 insertions(+), 37 deletions(-) diff --git a/COMPILING.md b/COMPILING.md index 828bdf5ff3..b483c8e4d5 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -44,7 +44,7 @@ For Linux, Mac and MinGW: ``` $ git clone https://github.com/google/protobuf.git $ cd protobuf -$ git checkout v3.6.1 +$ git checkout v3.7.0 $ ./autogen.sh $ ./configure $ make @@ -83,16 +83,16 @@ When building on Windows and VC++, you need to specify project properties for Gradle to find protobuf: ``` .\gradlew publishToMavenLocal ^ - -PvcProtobufInclude=C:\path\to\protobuf-3.6.1\src ^ - -PvcProtobufLibs=C:\path\to\protobuf-3.6.1\vsprojects\Release ^ + -PvcProtobufInclude=C:\path\to\protobuf-3.7.0\src ^ + -PvcProtobufLibs=C:\path\to\protobuf-3.7.0\vsprojects\Release ^ -PtargetArch=x86_32 ``` Since specifying those properties every build is bothersome, you can instead create ``\gradle.properties`` with contents like: ``` -vcProtobufInclude=C:\\path\\to\\protobuf-3.6.1\\src -vcProtobufLibs=C:\\path\\to\\protobuf-3.6.1\\vsprojects\\Release +vcProtobufInclude=C:\\path\\to\\protobuf-3.7.0\\src +vcProtobufLibs=C:\\path\\to\\protobuf-3.7.0\\vsprojects\\Release targetArch=x86_32 ``` diff --git a/android-interop-testing/app/build.gradle b/android-interop-testing/app/build.gradle index 3b765070cb..3da331ef0b 100644 --- a/android-interop-testing/app/build.gradle +++ b/android-interop-testing/app/build.gradle @@ -39,7 +39,7 @@ android { } protobuf { - protoc { artifact = 'com.google.protobuf:protoc:3.6.1' } + protoc { artifact = 'com.google.protobuf:protoc:3.7.0' } plugins { javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION diff --git a/build.gradle b/build.gradle index 399ce982d7..a64697aeb8 100644 --- a/build.gradle +++ b/build.gradle @@ -110,7 +110,7 @@ subprojects { nettyVersion = '4.1.34.Final' googleauthVersion = '0.13.0' guavaVersion = '26.0-android' - protobufVersion = '3.6.1' + protobufVersion = '3.7.0' protocVersion = protobufVersion protobufNanoVersion = '3.0.0-alpha-5' opencensusVersion = '0.19.2' @@ -192,7 +192,7 @@ subprojects { libraries = [ android_annotations: "com.google.android:annotations:4.1.1.4", animalsniffer_annotations: "org.codehaus.mojo:animal-sniffer-annotations:1.17", - errorprone: "com.google.errorprone:error_prone_annotations:2.2.0", + errorprone: "com.google.errorprone:error_prone_annotations:2.3.2", gson: "com.google.code.gson:gson:2.7", guava: "com.google.guava:guava:${guavaVersion}", hpack: 'com.twitter:hpack:0.10.1', diff --git a/buildscripts/make_dependencies.bat b/buildscripts/make_dependencies.bat index 7e86ce2d60..2cf322e714 100644 --- a/buildscripts/make_dependencies.bat +++ b/buildscripts/make_dependencies.bat @@ -1,4 +1,4 @@ -set PROTOBUF_VER=3.6.1 +set PROTOBUF_VER=3.7.0 set CMAKE_NAME=cmake-3.3.2-win32-x86 if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" ( diff --git a/buildscripts/make_dependencies.sh b/buildscripts/make_dependencies.sh index 373795a366..efad59800c 100755 --- a/buildscripts/make_dependencies.sh +++ b/buildscripts/make_dependencies.sh @@ -3,7 +3,7 @@ # Build protoc set -evux -o pipefail -PROTOBUF_VERSION=3.6.1 +PROTOBUF_VERSION=3.7.0 # ARCH is 64 bit unless otherwise specified. ARCH="${ARCH:-64}" diff --git a/core/build.gradle b/core/build.gradle index 1df2fec557..a6a3752133 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -8,7 +8,7 @@ dependencies { libraries.android_annotations, libraries.animalsniffer_annotations compile (libraries.guava) { - // prefer 2.2.0 from libraries instead of 2.1.3 + // prefer 2.3.2 from libraries instead of 2.1.3 exclude group: 'com.google.errorprone', module: 'error_prone_annotations' // prefer 3.0.2 from libraries instead of 3.0.1 exclude group: 'com.google.code.findbugs', module: 'jsr305' diff --git a/examples/android/helloworld/app/build.gradle b/examples/android/helloworld/app/build.gradle index 6465f3f42e..1cd6adc4e7 100644 --- a/examples/android/helloworld/app/build.gradle +++ b/examples/android/helloworld/app/build.gradle @@ -27,7 +27,7 @@ android { } protobuf { - protoc { artifact = 'com.google.protobuf:protoc:3.6.1' } + protoc { artifact = 'com.google.protobuf:protoc:3.7.0' } plugins { javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION diff --git a/examples/android/routeguide/app/build.gradle b/examples/android/routeguide/app/build.gradle index 4d68ff78df..ee6c141360 100644 --- a/examples/android/routeguide/app/build.gradle +++ b/examples/android/routeguide/app/build.gradle @@ -26,7 +26,7 @@ android { } protobuf { - protoc { artifact = 'com.google.protobuf:protoc:3.6.1' } + protoc { artifact = 'com.google.protobuf:protoc:3.7.0' } plugins { javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION diff --git a/examples/build.gradle b/examples/build.gradle index e2044c045c..da70c9c9b4 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -23,7 +23,7 @@ targetCompatibility = 1.7 // Feel free to delete the comment at the next line. It is just for safely // updating the version in our release process. def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION -def protobufVersion = '3.6.1' +def protobufVersion = '3.7.0' def protocVersion = protobufVersion dependencies { diff --git a/examples/example-alts/build.gradle b/examples/example-alts/build.gradle index da2cfa54a0..047c7c809e 100644 --- a/examples/example-alts/build.gradle +++ b/examples/example-alts/build.gradle @@ -23,7 +23,7 @@ targetCompatibility = 1.7 // Feel free to delete the comment at the next line. It is just for safely // updating the version in our release process. def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION -def protocVersion = '3.6.1' +def protocVersion = '3.7.0' dependencies { // grpc-alts transitively depends on grpc-netty-shaded, grpc-protobuf, and grpc-stub diff --git a/examples/example-gauth/build.gradle b/examples/example-gauth/build.gradle index d0161c4521..dfe66c3fff 100644 --- a/examples/example-gauth/build.gradle +++ b/examples/example-gauth/build.gradle @@ -23,7 +23,7 @@ targetCompatibility = 1.7 // Feel free to delete the comment at the next line. It is just for safely // updating the version in our release process. def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION -def protobufVersion = '3.6.1' +def protobufVersion = '3.7.0' def protocVersion = protobufVersion diff --git a/examples/example-gauth/pom.xml b/examples/example-gauth/pom.xml index e8aede6952..58c1562116 100644 --- a/examples/example-gauth/pom.xml +++ b/examples/example-gauth/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.20.0-SNAPSHOT - 3.6.1 + 3.7.0 1.7 1.7 diff --git a/examples/example-kotlin/android/helloworld/app/build.gradle b/examples/example-kotlin/android/helloworld/app/build.gradle index a18c5b2447..1fd6139791 100644 --- a/examples/example-kotlin/android/helloworld/app/build.gradle +++ b/examples/example-kotlin/android/helloworld/app/build.gradle @@ -49,7 +49,7 @@ android { } protobuf { - protoc { artifact = 'com.google.protobuf:protoc:3.6.1' } + protoc { artifact = 'com.google.protobuf:protoc:3.7.0' } plugins { javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION diff --git a/examples/example-kotlin/build.gradle b/examples/example-kotlin/build.gradle index f504179916..cc3085b601 100644 --- a/examples/example-kotlin/build.gradle +++ b/examples/example-kotlin/build.gradle @@ -39,7 +39,7 @@ dependencies { } protobuf { - protoc { artifact = 'com.google.protobuf:protoc:3.6.1' } + protoc { artifact = 'com.google.protobuf:protoc:3.7.0' } plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } } diff --git a/examples/example-tls/build.gradle b/examples/example-tls/build.gradle index 0ff2a01fbe..0482b8a38e 100644 --- a/examples/example-tls/build.gradle +++ b/examples/example-tls/build.gradle @@ -24,7 +24,7 @@ targetCompatibility = 1.7 // updating the version in our release process. def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION def nettyTcNativeVersion = '2.0.20.Final' -def protocVersion = '3.6.1' +def protocVersion = '3.7.0' dependencies { implementation "io.grpc:grpc-netty:${grpcVersion}" diff --git a/examples/example-tls/pom.xml b/examples/example-tls/pom.xml index 980f4cb92d..518855ea00 100644 --- a/examples/example-tls/pom.xml +++ b/examples/example-tls/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.20.0-SNAPSHOT - 3.6.1 + 3.7.0 2.0.20.Final 1.7 diff --git a/examples/pom.xml b/examples/pom.xml index 1af4bf16a9..4430cd01e2 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -13,8 +13,8 @@ UTF-8 1.20.0-SNAPSHOT - 3.6.1 - 3.6.1 + 3.7.0 + 3.7.0 1.7 1.7 diff --git a/grpclb/build.gradle b/grpclb/build.gradle index a71a6242f1..a08e27620d 100644 --- a/grpclb/build.gradle +++ b/grpclb/build.gradle @@ -14,8 +14,10 @@ dependencies { project(':grpc-stub'), libraries.protobuf compile (libraries.protobuf_util) { - // prefer 20.0 from libraries instead of 19.0 - exclude group: 'com.google.guava', module: 'guava' + // prefer 2.3.2 from libraries instead of 2.1.3 from guava + exclude group: 'com.google.errorprone', module: 'error_prone_annotations' + // prefer 1.17 from libraries instead of 1.14 from guava + exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' } compileOnly libraries.javax_annotation testCompile libraries.truth, diff --git a/protobuf-lite/build.gradle b/protobuf-lite/build.gradle index d87b88053a..f6d6dc06a7 100644 --- a/protobuf-lite/build.gradle +++ b/protobuf-lite/build.gradle @@ -15,7 +15,7 @@ dependencies { compile project(':grpc-core'), libraries.protobuf_lite compile (libraries.guava) { - // prefer 2.2.0 from libraries instead of 2.1.3 + // prefer 2.3.2 from libraries instead of 2.1.3 exclude group: 'com.google.errorprone', module: 'error_prone_annotations' // prefer 3.0.2 from libraries instead of 3.0.1 exclude group: 'com.google.code.findbugs', module: 'jsr305' diff --git a/protobuf-nano/build.gradle b/protobuf-nano/build.gradle index 80398789c7..06415b7a17 100644 --- a/protobuf-nano/build.gradle +++ b/protobuf-nano/build.gradle @@ -13,7 +13,7 @@ dependencies { compile project(':grpc-core'), libraries.protobuf_nano compile (libraries.guava) { - // prefer 2.2.0 from libraries instead of 2.1.3 + // prefer 2.3.2 from libraries instead of 2.1.3 exclude group: 'com.google.errorprone', module: 'error_prone_annotations' // prefer 3.0.2 from libraries instead of 3.0.1 exclude group: 'com.google.code.findbugs', module: 'jsr305' diff --git a/protobuf/build.gradle b/protobuf/build.gradle index 31f4f3c3d1..27531012bb 100644 --- a/protobuf/build.gradle +++ b/protobuf/build.gradle @@ -12,7 +12,7 @@ dependencies { compile project(':grpc-core'), libraries.protobuf compile (libraries.guava) { - // prefer 2.2.0 from libraries instead of 2.1.3 + // prefer 2.3.2 from libraries instead of 2.1.3 exclude group: 'com.google.errorprone', module: 'error_prone_annotations' // prefer 3.0.2 from libraries instead of 3.0.1 exclude group: 'com.google.code.findbugs', module: 'jsr305' diff --git a/repositories.bzl b/repositories.bzl index 4bbcee9250..d551205acf 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -4,6 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") def grpc_java_repositories( + omit_bazel_skylib = False, omit_com_google_android_annotations = False, omit_com_google_api_grpc_google_common_protos = False, omit_com_google_auth_google_auth_library_credentials = False, @@ -37,9 +38,12 @@ def grpc_java_repositories( omit_io_opencensus_grpc_metrics = False, omit_javax_annotation = False, omit_junit_junit = False, + omit_net_zlib = False, omit_org_apache_commons_lang3 = False, omit_org_codehaus_mojo_animal_sniffer_annotations = False): """Imports dependencies for grpc-java.""" + if not omit_bazel_skylib: + bazel_skylib() if not omit_com_google_android_annotations: com_google_android_annotations() if not omit_com_google_api_grpc_google_common_protos: @@ -106,6 +110,8 @@ def grpc_java_repositories( javax_annotation() if not omit_junit_junit: junit_junit() + if not omit_net_zlib: + net_zlib() if not omit_org_apache_commons_lang3: org_apache_commons_lang3() if not omit_org_codehaus_mojo_animal_sniffer_annotations: @@ -119,6 +125,22 @@ def grpc_java_repositories( name = "gson", actual = "@com_google_code_gson_gson//jar", ) + native.bind( + name = "zlib", + actual = "@net_zlib//:zlib", + ) + native.bind( + name = "error_prone_annotations", + actual = "@com_google_errorprone_error_prone_annotations//jar", + ) + +def bazel_skylib(): + http_archive( + name = "bazel_skylib", + sha256 = "bce240a0749dfc52fab20dce400b4d5cf7c28b239d64f8fd1762b3c9470121d8", + strip_prefix = "bazel-skylib-0.7.0", + urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.7.0.zip"], + ) def com_google_android_annotations(): jvm_maven_import_external( @@ -177,9 +199,9 @@ def com_google_code_gson(): def com_google_errorprone_error_prone_annotations(): jvm_maven_import_external( name = "com_google_errorprone_error_prone_annotations", - artifact = "com.google.errorprone:error_prone_annotations:2.2.0", + artifact = "com.google.errorprone:error_prone_annotations:2.3.2", server_urls = ["http://central.maven.org/maven2"], - artifact_sha256 = "6ebd22ca1b9d8ec06d41de8d64e0596981d9607b42035f9ed374f9de271a481a", + artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", licenses = ["notice"], # Apache 2.0 ) @@ -217,9 +239,10 @@ def com_google_protobuf(): # This statement defines the @com_google_protobuf repo. http_archive( name = "com_google_protobuf", - sha256 = "d6618d117698132dadf0f830b762315807dc424ba36ab9183f1f436008a2fdb6", - strip_prefix = "protobuf-3.6.1.2", - urls = ["https://github.com/google/protobuf/archive/v3.6.1.2.zip"], + sha256 = "8955eb28f9c6db71d013bfe8255e485837d473db8a5786f6a017e40934f304a7", + strip_prefix = "protobuf-4b9a5df4e8ba2066794da56598ad2905dc42051e", + # This is v3.7.0 with a Bazel compilation failure fix + urls = ["https://github.com/google/protobuf/archive/4b9a5df4e8ba2066794da56598ad2905dc42051e.zip"], ) def com_google_protobuf_javalite(): @@ -412,6 +435,15 @@ def junit_junit(): licenses = ["notice"], # EPL 1.0 ) +def net_zlib(): + http_archive( + name = "net_zlib", + build_file = "@com_google_protobuf//:third_party/zlib.BUILD", + sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", + strip_prefix = "zlib-1.2.11", + urls = ["https://zlib.net/zlib-1.2.11.tar.gz"], + ) + def org_apache_commons_lang3(): jvm_maven_import_external( name = "org_apache_commons_commons_lang3", diff --git a/services/build.gradle b/services/build.gradle index a22b9fdc1a..fd55fe2db1 100644 --- a/services/build.gradle +++ b/services/build.gradle @@ -21,8 +21,10 @@ dependencies { compile project(':grpc-protobuf'), project(':grpc-stub') compile (libraries.protobuf_util) { - // prefer 20.0 from libraries instead of 19.0 - exclude group: 'com.google.guava', module: 'guava' + // prefer 2.3.2 from libraries instead of 2.1.3 from guava + exclude group: 'com.google.errorprone', module: 'error_prone_annotations' + // prefer 1.17 from libraries instead of 1.14 from guava + exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' } compile libraries.re2j diff --git a/xds/build.gradle b/xds/build.gradle index 89a7e5135f..66cfbb7698 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -26,8 +26,10 @@ dependencies { compile project(':grpc-protobuf'), project(':grpc-stub') compile (libraries.protobuf_util) { - // prefer 20.0 from libraries instead of 19.0 - exclude group: 'com.google.guava', module: 'guava' + // prefer 2.3.2 from libraries instead of 2.1.3 from guava + exclude group: 'com.google.errorprone', module: 'error_prone_annotations' + // prefer 1.17 from libraries instead of 1.14 from guava + exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' } testCompile project(':grpc-core').sourceSets.test.output