Skip to content

Commit

Permalink
Update rules_go and gazelle to 0.42 & 0.33 (latest releases) (#13021)
Browse files Browse the repository at this point in the history
* Provide @go_googleapis, update gazelle

* fix pb build failures

Fix build issues with grpc-gateway
  • Loading branch information
prestonvanloon authored Oct 10, 2023
1 parent 0bd2326 commit 8eb82dd
Show file tree
Hide file tree
Showing 71 changed files with 588 additions and 527 deletions.
28 changes: 22 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ bazel_skylib_workspace()

http_archive(
name = "bazel_gazelle",
sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
],
)

Expand Down Expand Up @@ -110,10 +110,10 @@ http_archive(
# Expose internals of go_test for custom build transitions.
"//third_party:io_bazel_rules_go_test.patch",
],
sha256 = "bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a",
sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip",
],
)

Expand Down Expand Up @@ -374,6 +374,22 @@ http_archive(
)

# External dependencies
http_archive(
name = "googleapis",
sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
urls = [
"https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
],
)

load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
name = "com_google_googleapis_imports",
go = True,
)

load("//:deps.bzl", "prysm_deps")

# gazelle:repository_macro deps.bzl%prysm_deps
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/beacon/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ go_library(
"//runtime/version:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_golang_protobuf//ptypes/empty",
"@com_github_gorilla_mux//:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_opencensus_go//trace:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/debug/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ go_test(
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
"//testing/util:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@com_github_golang_protobuf//ptypes/empty",
"@org_golang_google_protobuf//types/known/emptypb:go_default_library",
],
)
4 changes: 2 additions & 2 deletions beacon-chain/rpc/prysm/v1alpha1/debug/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ go_library(
"//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/attestation:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
"@com_github_golang_protobuf//ptypes/empty",
"@com_github_ipfs_go_log_v2//:go_default_library",
"@com_github_libp2p_go_libp2p//core/network:go_default_library",
"@com_github_libp2p_go_libp2p//core/peer:go_default_library",
"@com_github_libp2p_go_libp2p//core/protocol:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
Expand Down Expand Up @@ -58,7 +58,7 @@ go_test(
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
"//testing/util:go_default_library",
"@com_github_golang_protobuf//ptypes/empty",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
],
)
4 changes: 2 additions & 2 deletions beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ go_library(
"//io/logs:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/version:go_default_library",
"@com_github_golang_protobuf//ptypes/empty",
"@com_github_golang_protobuf//ptypes/timestamp",
"@com_github_libp2p_go_libp2p//core/network:go_default_library",
"@com_github_libp2p_go_libp2p//core/peer:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion cmd/validator/accounts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ go_library(
"//validator/keymanager/local:go_default_library",
"//validator/keymanager/remote-web3signer:go_default_library",
"//validator/node:go_default_library",
"@com_github_golang_protobuf//ptypes/empty",
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_urfave_cli_v2//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//:go_default_library",
],
)
Expand Down
6 changes: 6 additions & 0 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,12 @@ def prysm_deps():
replace = "github.com/prysmaticlabs/grpc-gateway/v2",
sum = "h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28=",
version = "v2.3.1-0.20230315201114-09284ba20446",
repo_mapping = {"@go_googleapis": "@googleapis"},
patch_args = ["-p1"],
patches = [
"//third_party:com_github_grpc_ecosystem_grpc_gateway_v2.patch",
"//third_party:com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch",
],
)
go_repository(
name = "com_github_guptarohit_asciigraph",
Expand Down
3 changes: 3 additions & 0 deletions proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ load(
"string_flag",
)

# gazelle:resolve proto proto google/api/annotations.proto @googleapis//google/api:annotations_proto
# gazelle:resolve proto go google/api/annotations.proto @googleapis//google/api:annotations_go_proto

# Example flag: --//proto:network=minimal
string_flag(
name = "network",
Expand Down
6 changes: 3 additions & 3 deletions proto/engine/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ proto_library(
visibility = ["//visibility:public"],
deps = [
"//proto/eth/ext:proto",
"@go_googleapis//google/api:annotations_proto",
"@googleapis//google/api:annotations_proto",
],
)

Expand Down Expand Up @@ -59,7 +59,7 @@ go_proto_library(
"//consensus-types/primitives:go_default_library",
"//proto/eth/ext:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
Expand Down Expand Up @@ -91,7 +91,7 @@ go_library(
"@com_github_pkg_errors//:go_default_library",
"@com_github_prysmaticlabs_fastssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@org_golang_google_protobuf//encoding/protojson:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion proto/engine/v1/execution_engine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/eth/ext/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ go_proto_library(
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//proto:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions proto/eth/ext/options.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions proto/eth/service/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ proto_library(
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@go_googleapis//google/api:annotations_proto",
"@googleapis//google/api:annotations_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto",
],
)
Expand All @@ -40,9 +40,11 @@ go_proto_library(
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"//consensus-types/primitives:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@googleapis//google/api:annotations_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
"@org_golang_google_protobuf//types/descriptorpb:go_default_library",
"@org_golang_google_protobuf//types/known/emptypb:go_default_library",
],
)

Expand Down Expand Up @@ -82,7 +84,7 @@ go_proto_library(
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
Expand All @@ -94,4 +96,8 @@ go_library(
embed = [":go_grpc_gateway_library"],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/eth/service",
visibility = ["//visibility:public"],
deps = [
"@org_golang_google_protobuf//types/descriptorpb",
"@org_golang_google_protobuf//types/known/emptypb",
],
)
Loading

0 comments on commit 8eb82dd

Please sign in to comment.