Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

deps: upgrade protobuf to 3.19.1 #1571

Merged
merged 2 commits into from Nov 29, 2021
Merged

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Nov 29, 2021

Upgrading the protobuf version to 3.19.1.

Reference:

In protobuf_deps.bzl we now define a constant PROTOBUF_MAVEN_ARTIFACTS that you can use with maven_install() in your WORKSPACE file to make sure all protobuf's Java dependencies are available.

protocolbuffers/protobuf#9132 (comment)

@suztomo suztomo requested review from a team as code owners November 29, 2021 16:16
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 29, 2021
@suztomo
Copy link
Member Author

suztomo commented Nov 29, 2021

It failed.

Run which bazel
  which bazel
  bazel --version
  bazel --batch test //... --noshow_progress --test_output=errors
  shell: sh -e {0}
  env:
    JAVA_HOME_8.0.312_x64: /__t/jdk/8.0.312/x64
    JAVA_HOME: /__t/jdk/8.0.312/x64
    JAVA_HOME_8_0_312_X64: /__t/jdk/8.0.312/x64
/usr/bin/bazel
bazel 3.7.2
INFO: SHA256 (https://github.com/protocolbuffers/protobuf/archive/v3.19.1.zip) = 25f1292d4ea6666f460a2a30038eef121e6c3937ae0f61d610611dfb14b0bd32
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "25f1292d4ea6666f460a2a30038eef121e6c3937ae0f61d610611dfb14b0bd32"
DEBUG: Repository com_google_protobuf instantiated at:
  /__w/gax-java/gax-java/WORKSPACE:13:37: in <toplevel>
  /__w/gax-java/gax-java/repositories.bzl:51:11: in com_google_api_gax_java_repositories
  /__w/gax-java/gax-java/repositories.bzl:131:14: in _maybe
Repository rule http_archive defined at:
  /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/grpc/grpc-java/archive/v1.41.0.zip) = a61a678f995f1d612bb23d5fb721d83b6960508cc1e0b0dc3c164d6d8d8d24e0
DEBUG: Rule 'io_grpc_grpc_java' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "a61a678f995f1d612bb23d5fb721d83b6960508cc1e0b0dc3c164d6d8d8d24e0"
DEBUG: Repository io_grpc_grpc_java instantiated at:
  /__w/gax-java/gax-java/WORKSPACE:13:37: in <toplevel>
  /__w/gax-java/gax-java/repositories.bzl:60:11: in com_google_api_gax_java_repositories
  /__w/gax-java/gax-java/repositories.bzl:131:14: in _maybe
Repository rule http_archive defined at:
  /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value/1.8.2/auto-value-1.8.2.jar) = 2067b788d4c1c96fd621ad861053a5c4d8a801cfafc77fec20d49a6e9340a745
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/api/api-common/2.0.5/api-common-2.0.5.jar) = 77327ac29c0fb63719855bd65cf1365256e15649261b5567cfca0b02d0f26eae
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-gson/1.40.1/google-http-client-gson-1.40.1.jar) = e0b2d3b534757207b52ad017aa5e61d0df9337bdc2b0b8a23f66c6c4a362a831
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.8.2/auto-value-annotations-1.8.2.jar) = 392a848fc611fff5fd317c2453a9a1bf7775e4f4de9c5af0d688bff57f691f6e
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.2.1/google-auth-library-oauth2-http-1.2.1.jar) = ca64326818a2a458d35319ef963b9bee26aaf8072f0aabf652a4be934e92515d
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-credentials/1.2.1/google-auth-library-credentials-1.2.1.jar) = 9c21ad259aea5173199e5cc8a3dd6f2dc3f8d5f31b7c6838e08705d8efd8e6a0
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client/1.40.1/google-http-client-1.40.1.jar) = 0695da3f3847838c93ec80fc865764065e6100355f2b198e663cff248c067263
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar) = d5be94d65e87bd219fb3193ad1517baa55a3b88fc91d21cf735826ab5af087b9
INFO: SHA256 (https://repo.maven.apache.org/maven2/io/grpc/grpc-grpclb/1.41.0/grpc-grpclb-1.41.0.jar) = 2b35684ac30279637fd46b4b95337fb1740fdacf89b528bdfa88fe966b97f09c
INFO: SHA256 (https://repo.maven.apache.org/maven2/io/grpc/grpc-netty-shaded/1.41.0/grpc-netty-shaded-1.41.0.jar) = 949f0e17ab48bc0911854580f99bdae0f252148266c1c0f96747b5afa7406549
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java-util/3.19.1/protobuf-java-util-3.19.1.jar) = 2fdeab29e8b3296a5347dd3ac2a5e03016cb877d76055d1f19e447ae9a7e90a0
INFO: SHA256 (https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.9.0/error_prone_annotations-2.9.0.jar) = f947bdc33ae27a6b4aa44799e6c21e1944797bd0010ba43eb82d11446e163694
ERROR: /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/com_google_protobuf/java/util/BUILD:7:13: no such package '@maven//': The repository '@maven' could not be resolved and referenced by '@com_google_protobuf//java/util:util'
ERROR: /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/com_google_protobuf/java/util/BUILD:7:13: no such package '@maven//': The repository '@maven' could not be resolved and referenced by '@com_google_protobuf//java/util:util'
ERROR: /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/com_google_protobuf/java/util/BUILD:7:13: no such package '@maven//': The repository '@maven' could not be resolved and referenced by '@com_google_protobuf//java/util:util'
ERROR: /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/com_google_protobuf/java/util/BUILD:7:13: no such package '@maven//': The repository '@maven' could not be resolved and referenced by '@com_google_protobuf//java/util:util'
ERROR: /github/home/.cache/bazel/_bazel_root/9e4dde399fac32001b99efa92054490b/external/com_google_protobuf/java/util/BUILD:7:13: no such package '@maven//': The repository '@maven' could not be resolved and referenced by '@com_google_protobuf//java/util:util'
ERROR: Analysis of target '//gax-grpc:com.google.api.gax.grpc.CallOptionsUtilTest' failed; build aborted: Analysis failed

@suztomo
Copy link
Member Author

suztomo commented Nov 29, 2021

This commit last month introduced @maven in the BUILD file.

protocolbuffers/protobuf@c7dfd0d#diff-12841ce8bf622286dc6cef67ca3c60d9ee42a7ee4904acbaa1b7e5956c4dc341R16

suztomo referenced this pull request in protocolbuffers/protobuf Nov 29, 2021
This commit removes the use of bind() since that function goes against
Bazel best practices:
https://docs.bazel.build/versions/main/external.html#repository-rules-1
The bind() function basically maps a dependency into //external, but
there is no good reason to do this. By mapping dependencies into
//external and relying on this in our own BUILD files, we're forcing
projects that depend on us to do the same. The one bind() call that I
did leave in place was //:python_headers. This one seems to be doing
something complicated I don't fully understand, and I don't want to risk
breaking it.

This change also moves our list of required Maven artifacts into a
constant in protobuf_deps.bzl. This way, projects that depend on us can
refer to this list when they invoke maven_install() and automatically
pull in all the necesary dependencies.

This fixes #9132.
@suztomo suztomo changed the title deps: protobuf dependency check deps: upgrade protobuf to 3.19.1 Nov 29, 2021
Comment on lines +23 to +38
RULES_JVM_EXTERNAL_TAG = "4.2"
RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = PROTOBUF_MAVEN_ARTIFACTS,
generate_compat_repositories = True,
repositories = [
"https://repo.maven.apache.org/maven2/",
],
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the usage of maven_install in rules_jvm_external shown in https://github.com/bazelbuild/rules_jvm_external#usage

@suztomo
Copy link
Member Author

suztomo commented Nov 29, 2021

All checks passed.

@suztomo suztomo merged commit 7b354e7 into googleapis:main Nov 29, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Dec 2, 2021
🤖 I have created a release \*beep\* \*boop\*
---
### [2.7.1](https://www.github.com/googleapis/gax-java/compare/v2.7.0...v2.7.1) (2021-12-02)


### Bug Fixes

* fix gRPC code conversion ([#1555](https://www.github.com/googleapis/gax-java/issues/1555)) ([09b99d5](https://www.github.com/googleapis/gax-java/commit/09b99d591497b44c3c25b1a54abb0f1cb69d7376))
* pass error message when creating ApiException ([#1556](https://www.github.com/googleapis/gax-java/issues/1556)) ([918ae41](https://www.github.com/googleapis/gax-java/commit/918ae419f84ad5721638ca10eca992333e9f7c3d))
* revert generics syntax change in MockHttpService test utility ([#1574](https://www.github.com/googleapis/gax-java/issues/1574)) ([b629488](https://www.github.com/googleapis/gax-java/commit/b629488ffc7d68158158d9197695158f97229c7b))
* update exception mapping on HTTP error responses ([#1570](https://www.github.com/googleapis/gax-java/issues/1570)) ([8a170d1](https://www.github.com/googleapis/gax-java/commit/8a170d19b42e9b13d4c69dcfbe531d4d4ca69c90))


### Dependencies

* update grpc to 1.42.1 ([#1559](https://www.github.com/googleapis/gax-java/issues/1559)) ([92b7632](https://www.github.com/googleapis/gax-java/commit/92b76325d54604c98c798c489b3a963fdf21a75c))
* upgrade protobuf to 3.19.1 ([#1571](https://www.github.com/googleapis/gax-java/issues/1571)) ([7b354e7](https://www.github.com/googleapis/gax-java/commit/7b354e73b8ce49008bed51076afb255ca5dc68e4))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants