Skip to content

Commit f2d78c6

Browse files
author
Emil Kattainen
committed
Upgrade googleapis to a modern version
1 parent 068363a commit f2d78c6

File tree

6 files changed

+72
-123
lines changed

6 files changed

+72
-123
lines changed

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Include comments in generated code for godoc.
22
build --experimental_proto_descriptor_sets_include_source_info
3+
4+
build --repo_env=BAZEL_CXXOPTS="-std=c++14"

WORKSPACE

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,85 @@ workspace(name = "bazel_remote_apis")
22

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

5+
_bazel_skylib_version = "1.4.0"
6+
7+
_bazel_skylib_sha256 = "f24ab666394232f834f74d19e2ff142b0af17466ea0c69a3f4c276ee75f6efce"
8+
59
http_archive(
610
name = "bazel_skylib",
7-
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
8-
urls = [
9-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
10-
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
11-
],
11+
sha256 = _bazel_skylib_sha256,
12+
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/{0}/bazel-skylib-{0}.tar.gz".format(_bazel_skylib_version)],
1213
)
1314

1415
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
1516

1617
bazel_skylib_workspace()
1718

18-
# Pull in go rules, which we need in order to selectively pull in Go dependencies.
19+
# This must be above the download of gRPC (in C++ section) and
20+
# rules_gapic_repositories because both depend on rules_go and we need to manage
21+
# our version of rules_go explicitly rather than depend on the version those
22+
# bring in transitively.
23+
_io_bazel_rules_go_version = "0.34.0"
24+
1925
http_archive(
2026
name = "io_bazel_rules_go",
21-
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
27+
sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
2228
urls = [
23-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
24-
"https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
29+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v{0}/rules_go-v{0}.zip".format(_io_bazel_rules_go_version),
30+
"https://github.com/bazelbuild/rules_go/releases/download/v{0}/rules_go-v{0}.zip".format(_io_bazel_rules_go_version),
2531
],
2632
)
2733

28-
# Gazelle, which we need in order to selectively pull in Gazelle dependencies for Go.
34+
# Gazelle dependency version should match gazelle dependency expected by gRPC
35+
_bazel_gazelle_version = "0.24.0"
36+
2937
http_archive(
3038
name = "bazel_gazelle",
31-
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
39+
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
3240
urls = [
33-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
34-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
41+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v{0}/bazel-gazelle-v{0}.tar.gz".format(_bazel_gazelle_version),
42+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v{0}/bazel-gazelle-v{0}.tar.gz".format(_bazel_gazelle_version),
3543
],
3644
)
3745

38-
# Needed for protobuf.
46+
# Explicitly declaring Protobuf version, while Protobuf dependency is already
47+
# instantiated in grpc_deps().
3948
http_archive(
4049
name = "com_google_protobuf",
41-
sha256 = "678d91d8a939a1ef9cb268e1f20c14cd55e40361dc397bb5881e4e1e532679b1",
42-
strip_prefix = "protobuf-3.10.1",
43-
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.1.zip"],
50+
sha256 = "0b0395d34e000f1229679e10d984ed7913078f3dd7f26cf0476467f5e65716f4",
51+
strip_prefix = "protobuf-23.2",
52+
urls = ["https://github.com/protocolbuffers/protobuf/archive/v23.2.tar.gz"],
4453
)
4554

46-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
55+
_grpc_version = "1.55.1"
4756

48-
protobuf_deps()
57+
_grpc_sha256 = "17c0685da231917a7b3be2671a7b13b550a85fdda5e475313264c5f51c4da3f8"
4958

50-
# Needed for C++ gRPC.
5159
http_archive(
5260
name = "com_github_grpc_grpc",
53-
sha256 = "b391a327429279f6f29b9ae7e5317cd80d5e9d49cc100e6d682221af73d984a6",
54-
strip_prefix = "grpc-93e8830070e9afcbaa992c75817009ee3f4b63a0", # v1.24.3 with fixes
55-
urls = ["https://github.com/grpc/grpc/archive/93e8830070e9afcbaa992c75817009ee3f4b63a0.zip"],
61+
sha256 = _grpc_sha256,
62+
strip_prefix = "grpc-%s" % _grpc_version,
63+
urls = ["https://github.com/grpc/grpc/archive/v%s.zip" % _grpc_version],
5664
)
5765

5866
# Pull in all gRPC dependencies.
5967
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
6068

6169
grpc_deps()
6270

71+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
72+
73+
protobuf_deps()
74+
75+
6376
# More gRPC dependencies. grpc_extra_deps does not work out of the box.
64-
load("@upb//bazel:workspace_deps.bzl", "upb_deps")
6577
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
6678
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
6779

68-
upb_deps()
69-
7080
apple_rules_dependencies()
7181

7282
apple_support_dependencies()
7383

74-
load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
75-
76-
bazel_version_repository(
77-
name = "bazel_version",
78-
)
79-
8084
bind(
8185
name = "grpc_cpp_plugin",
8286
actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
@@ -91,11 +95,31 @@ load("//:remote_apis_deps.bzl", "remote_apis_go_deps")
9195

9296
remote_apis_go_deps()
9397

98+
_rules_gapic_version = "0.28.0"
99+
100+
_rules_gapic_sha256 = "921aebfb7f26c110fcdafeb6b74b1eb2d114a6d52e1bc11d6c1c011cf1da2017"
101+
102+
http_archive(
103+
name = "rules_gapic",
104+
sha256 = _rules_gapic_sha256,
105+
strip_prefix = "rules_gapic-%s" % _rules_gapic_version,
106+
urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version],
107+
)
108+
94109
# Needed for the googleapis protos.
95110
http_archive(
96111
name = "googleapis",
97-
build_file = "BUILD.googleapis",
98-
sha256 = "7b6ea252f0b8fb5cd722f45feb83e115b689909bbb6a393a873b6cbad4ceae1d",
99-
strip_prefix = "googleapis-143084a2624b6591ee1f9d23e7f5241856642f4d",
100-
urls = ["https://github.com/googleapis/googleapis/archive/143084a2624b6591ee1f9d23e7f5241856642f4d.zip"],
112+
sha256 = "1253e1e9826fa822d709221032069dbbc5079e3d26671bfcb8485b21870941d3",
113+
strip_prefix = "googleapis-b34897064113f06083e6d5bd217826ec2c91abe3",
114+
urls = ["https://github.com/googleapis/googleapis/archive/b34897064113f06083e6d5bd217826ec2c91abe3.zip"],
115+
)
116+
117+
load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
118+
119+
switched_rules_by_language(
120+
name = "com_google_googleapis_imports",
121+
cc = True,
122+
gapic = True,
123+
go = True,
124+
java = True,
101125
)

build/bazel/remote/asset/v1/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ proto_library(
1111
"//build/bazel/remote/execution/v2:remote_execution_proto",
1212
"@com_google_protobuf//:duration_proto",
1313
"@com_google_protobuf//:timestamp_proto",
14-
"@googleapis//:google_api_annotations_proto",
15-
"@googleapis//:google_api_http_proto",
16-
"@googleapis//:google_rpc_status_proto",
14+
"@googleapis//google/api:annotations_proto",
15+
"@googleapis//google/api:http_proto",
16+
"@googleapis//google/rpc:status_proto",
1717
],
1818
)
1919

build/bazel/remote/execution/v2/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ proto_library(
1313
"@com_google_protobuf//:duration_proto",
1414
"@com_google_protobuf//:timestamp_proto",
1515
"@com_google_protobuf//:wrappers_proto",
16-
"@googleapis//:google_api_annotations_proto",
17-
"@googleapis//:google_api_http_proto",
18-
"@googleapis//:google_longrunning_operations_proto",
19-
"@googleapis//:google_rpc_status_proto",
16+
"@googleapis//google/api:annotations_proto",
17+
"@googleapis//google/api:http_proto",
18+
"@googleapis//google/longrunning:operations_proto",
19+
"@googleapis//google/rpc:status_proto",
2020
],
2121
)
2222

external/BUILD.googleapis

Lines changed: 0 additions & 78 deletions
This file was deleted.

internal/cc_grpc_library.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ or rules_cc so that the Bazel Remote APIs repository can be further decoupled
1010
from language-specific concerns.
1111
"""
1212

13-
load("@com_github_grpc_grpc//bazel:protobuf.bzl", "get_include_protoc_args")
13+
load("@com_github_grpc_grpc//bazel:protobuf.bzl", "get_proto_arguments", "get_include_directory")
1414

1515
_EXT_PROTO = ".proto"
1616
_EXT_PROTODEVEL = ".protodevel"
@@ -83,7 +83,8 @@ def _cc_grpc_codegen(ctx):
8383
protoc_args.add("--plugin", "protoc-gen-grpc=" + plugin.path)
8484
protoc_args.add("--grpc_out", protoc_out.path)
8585

86-
protoc_args.add_all(get_include_protoc_args(proto_imports))
86+
proto_paths = [get_include_directory(proto_path) for proto_path in proto_imports]
87+
protoc_args.add_all(proto_paths, format_each = "--proto_path=%s")
8788
protoc_args.add_all(proto_srcs, map_each = _proto_srcname)
8889

8990
ctx.actions.run(

0 commit comments

Comments
 (0)