Skip to content

Commit 85ff4d0

Browse files
committed
chore(bazel): add MODULE.bazel files for bzlmod
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent ff41eb3 commit 85ff4d0

10 files changed

+86
-12
lines changed

.bazelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# https://github.com/bazelbuild/rules_fuzzing/blob/f6062a88d83463e2900e47bc218547ba046dad44/.bazelrc
1717

1818
# Force the use of Clang for all builds.
19-
build --action_env=CC=clang-10
20-
build --action_env=CXX=clang++-10
19+
build --action_env=CC=clang-14
20+
build --action_env=CXX=clang++-14
2121

2222
build --cxxopt=-std=c++14
2323
build --host_cxxopt=-std=c++14

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0
1+
6.5.0

MODULE.bazel

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
module(
2+
name = "grpc-httpjson-transcoding",
3+
version = "0.0.0-20230607-ff41eb3",
4+
)
5+
6+
bazel_dep(
7+
name = "abseil-cpp",
8+
version = "20240116.2",
9+
repo_name = "com_google_absl",
10+
)
11+
bazel_dep(
12+
name = "googletest",
13+
version = "1.14.0.bcr.1",
14+
repo_name = "com_google_googletest",
15+
dev_dependency = True,
16+
)
17+
bazel_dep(
18+
name = "google_benchmark",
19+
version = "1.8.3",
20+
repo_name = "com_google_benchmark",
21+
dev_dependency = True,
22+
)
23+
bazel_dep(
24+
name = "nlohmann_json",
25+
version = "3.11.3",
26+
repo_name = "com_github_nlohmann_json",
27+
)
28+
bazel_dep(
29+
name = "proto-converter",
30+
version = "0.0.0-20230607-d77ff30",
31+
repo_name = "com_google_protoconverter",
32+
)
33+
bazel_dep(
34+
name = "protobuf",
35+
version = "26.0.bcr.1",
36+
repo_name = "com_google_protobuf",
37+
)
38+
bazel_dep(
39+
name = "rules_cc",
40+
version = "0.0.9",
41+
)
42+
bazel_dep(
43+
name = "rules_fuzzing",
44+
version = "0.5.2",
45+
dev_dependency = True,
46+
)
47+
bazel_dep(
48+
name = "rules_proto",
49+
version = "5.3.0-21.7",
50+
)
51+
bazel_dep(
52+
name = "zlib",
53+
version = "1.2.13",
54+
)
55+
56+
# -- bazel_dep definitions -- #
57+
58+
non_module_deps = use_extension("//:extensions.bzl", "non_module_deps")
59+
use_repo(non_module_deps, "com_google_googleapis")
60+
61+
googleapis_ext = use_extension("//:googleapis_ext.bzl", "googleapis_ext")
62+
use_repo(googleapis_ext, "com_google_googleapis_imports")

WORKSPACE

+5-6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
################################################################################
1616
#
1717

18+
# See
19+
# https://github.com/bazelbuild/rules_fuzzing/blob/master/README.md#configuring-the-workspace.
20+
# The fuzzing rules must be first because if they are not, bazel will
21+
# pull in incompatible versions of absl and rules_python.
22+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1823
load(
1924
"//:repositories.bzl",
2025
"absl_repositories",
@@ -27,12 +32,6 @@ load(
2732
"protoconverter_repositories",
2833
)
2934

30-
# See
31-
# https://github.com/bazelbuild/rules_fuzzing/blob/master/README.md#configuring-the-workspace.
32-
# The fuzzing rules must be first because if they are not, bazel will
33-
# pull in incompatible versions of absl and rules_python.
34-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
35-
3635
http_archive(
3736
name = "rules_fuzzing",
3837
sha256 = "d9002dd3cd6437017f08593124fdd1b13b3473c7b929ceb0e60d317cb9346118",

WORKSPACE.bzlmod

Whitespace-only changes.

extensions.bzl

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
def _non_module_deps_impl(_ctx):
4+
http_archive(
5+
name = "com_google_googleapis",
6+
url = "https://github.com/googleapis/googleapis/archive/1d5522ad1056f16a6d593b8f3038d831e64daeea.tar.gz",
7+
sha256 = "cd13e547cffaad217c942084fd5ae0985a293d0cce3e788c20796e5e2ea54758",
8+
strip_prefix = "googleapis-1d5522ad1056f16a6d593b8f3038d831e64daeea",
9+
)
10+
11+
non_module_deps = module_extension(implementation = _non_module_deps_impl)

googleapis_ext.bzl

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
2+
3+
googleapis_ext = module_extension(implementation = lambda x: switched_rules_by_language(
4+
name = "com_google_googleapis_imports",
5+
))

perf_benchmark/BUILD

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
################################################################################
1616
#
1717
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
18-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1918
load("@io_bazel_rules_docker//cc:image.bzl", "cc_image")
2019
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
2120

repositories.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
################################################################################
1616
#
1717
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
18-
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
1918

2019
def absl_repositories(bind = True):
2120
http_archive(

test/BUILD

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#
1515
################################################################################
1616
#
17-
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
1817
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
1918

2019
package(default_visibility = ["//visibility:public"])

0 commit comments

Comments
 (0)