Skip to content

Commit 9856bfe

Browse files
authored
Bazel bzlmod support for grpc-web. (#1456)
* Bazel bzlmod support for grpc-web. Updates the bazel-based build of grpc-web to use bzlmod. The WORKSPACE file is retained for now, but it should probably be deleted since it should be unused. * Delete WORKSPACE files. * bazel mod tidy * MODULE.bazel fixups * Update version to 1.6.0.rc1 in MODULE.bazel * Update module and dockerfile in response to pr comments about build failure and protobuf version * Fix lint issue with MODULE.bazel
1 parent 8ba8fbe commit 9856bfe

File tree

5 files changed

+8927
-41
lines changed

5 files changed

+8927
-41
lines changed

.bazelrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
build --copt=-Wno-error=deprecated-declarations --host_copt=-Wno-error=deprecated-declarations
2+
3+
# Required until this is the default; expected in Bazel 7
4+
common --enable_bzlmod
5+
6+
# Load any settings specific to the current user.
7+
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
8+
# This needs to be last statement in this
9+
# config, as the user configuration should be able to overwrite flags from this file.
10+
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
11+
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
12+
# rather than user.bazelrc as suggested in the Bazel docs)
13+
try-import %workspace%/.bazelrc.user
14+

MODULE.bazel

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
A bazel module for the grpc-web project.
3+
4+
Visit https://grpc.io/ and https://github.com/grpc/grpc-web for
5+
more information about the project.
6+
"""
7+
8+
module(
9+
name = "grpc-web",
10+
version = "1.6.0",
11+
compatibility_level = 1,
12+
repo_name = "com_github_grpc_grpc_web",
13+
)
14+
15+
bazel_dep(name = "protobuf", version = "27.1", repo_name = "com_google_protobuf")
16+
bazel_dep(name = "grpc", version = "1.65.0", repo_name = "com_github_grpc_grpc")
17+
bazel_dep(name = "rules_cc", version = "0.0.2")
18+
bazel_dep(name = "rules_proto", version = "6.0.2")
19+
20+
# Needed to resolve https://github.com/bazelbuild/bazel-central-registry/issues/2538.
21+
single_version_override(
22+
module_name = "grpc-java",
23+
version = "1.64.0",
24+
)

0 commit comments

Comments
 (0)