rules-proto-grpc / rules_proto_grpc

Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets
https://rules-proto-grpc.com
Apache License 2.0
250 stars 157 forks source link

Need to bump the version of rules_proto from 5.3.0-21.5 to higher version #261

Closed youngcho22 closed 1 year ago

youngcho22 commented 1 year ago

Issue Description

When running bazel sync to set up rules_proto_grpc, I get the following error:

Error in download: java.io.IOException: Error downloading 
[https://mirror.bazel.build/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.5/protobuf-java-3.21.5.jar, 
https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.5/protobuf-java-3.21.5.jar] to 
/private/var/tmp/_bazel_youngmokcho/994b3e899f1f2de61f63ee481ccf26ec/external/com_google_protobuf_protobuf_java
/protobuf-java-3.21.5.jar: Checksum was 51febfb24af6faa7eb729c880b8ba011cbab8ce55920656a450740b73d343ee2 but 
wanted ad275e75ee79e6c6388198dcb9acf0db2edee64782e11b508f379c3a2a17d168

It looks like there are two incorrect file hashes in maven dependencies in rules_proto rulesset at the version 5.3.0-21.5. com_google_protobuf_protobuf_java com_google_protobuf_protobuf_java_util

I downloaded both jars using the urls specified in the rules_proto/proto/private/dependencies.bzl and tried getting hashes of these files:

shasum -a 256 protobuf-java-3.21.5.jar
>> 51febfb24af6faa7eb729c880b8ba011cbab8ce55920656a450740b73d343ee2
shasum -a 256 protobuf-java-util-3.21.5.jar
>> 34dc0c5bc98416e95a28b3b18caf74816eaa083b2f9c5702b2300a3763970c7b

, and confirmed that the hashes are incorrect (presumably b/c they got ruined by sha changes that rarely happened from Github?)

The rules_proto version 5.3.0-21.7 seems like they fixed the invalid sha values. sha256 value in 5.3.0-21.7: a204ec68748a7b26351ae37a311e8de468f248d1916d5f8dbe812c1289d0a0ff

vs

sha value I got from my local:

shasum -a 256 protobuf-java-3.21.7.jar
>> a204ec68748a7b26351ae37a311e8de468f248d1916d5f8dbe812c1289d0a0ff  protobuf-java-3.21.7.jar

Would it be possible to bump the version of rules_proto in later versions? (looks like rules_proto version was bumped to 5.3.0-21.5 since 4.3.0)

Log Output

No response

rules_proto_grpc Version

4.4.0

Bazel Version

6.2.0

OS

MacOS M1

Link to Demo Repo

No response

WORKSPACE Content

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_proto_grpc",
    sha256 = "507e38c8d95c7efa4f3b1c0595a8e8f139c885cb41a76cab7e20e4e67ae87731",
    strip_prefix = "rules_proto_grpc-4.1.1",
    urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.1.1.tar.gz"],
)

load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains", "rules_proto_grpc_repos")
rules_proto_grpc_toolchains()
rules_proto_grpc_repos()

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()

load("@rules_proto_grpc//python:repositories.bzl", rules_proto_grpc_python_repos = "python_repos")
rules_proto_grpc_python_repos()

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

BUILD Content

No response

Proto Content

No response

Any Other Content

No response

aaliddell commented 1 year ago

I can't seem to recreate this, even though I see the wrong hashes. So I'll bump rules_proto regardless.