Skip to content

Commit cde5f9c

Browse files
committed
Switch to bazel Module
1 parent 83e9a24 commit cde5f9c

File tree

34 files changed

+19648
-2389
lines changed

34 files changed

+19648
-2389
lines changed

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.1.1

.github/workflows/master.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
},
3030
{
3131
"name": "Gazelle",
32-
"run": "bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro go_dependencies.bzl%go_dependencies -prune && bazel run //:gazelle"
32+
"run": "bazel run //:gazelle"
3333
},
3434
{
3535
"name": "Buildifier",
36-
"run": "sed '/^$/d' go_dependencies.bzl > go_dependencies.bzl.new && mv go_dependencies.bzl.new go_dependencies.bzl && bazel run @com_github_bazelbuild_buildtools//:buildifier"
36+
"run": "bazel run //:buildifier.check"
3737
},
3838
{
3939
"name": "Gofmt",
@@ -73,35 +73,35 @@
7373
},
7474
{
7575
"name": "linux_amd64: build and test",
76-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //..."
76+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_amd64 //..."
7777
},
7878
{
7979
"name": "linux_386: build and test",
80-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_386 //..."
80+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_386 //..."
8181
},
8282
{
8383
"name": "linux_arm: build and test",
84-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_arm //..."
84+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
8585
},
8686
{
8787
"name": "linux_arm64: build and test",
88-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 //..."
88+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
8989
},
9090
{
9191
"name": "darwin_amd64: build and test",
92-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //..."
92+
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
9393
},
9494
{
9595
"name": "darwin_arm64: build and test",
96-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_arm64 //..."
96+
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
9797
},
9898
{
9999
"name": "freebsd_amd64: build and test",
100-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:freebsd_amd64 //..."
100+
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //..."
101101
},
102102
{
103103
"name": "windows_amd64: build and test",
104-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //..."
104+
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..."
105105
}
106106
]
107107
}

.github/workflows/pull-requests.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
},
3030
{
3131
"name": "Gazelle",
32-
"run": "bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro go_dependencies.bzl%go_dependencies -prune && bazel run //:gazelle"
32+
"run": "bazel run //:gazelle"
3333
},
3434
{
3535
"name": "Buildifier",
36-
"run": "sed '/^$/d' go_dependencies.bzl > go_dependencies.bzl.new && mv go_dependencies.bzl.new go_dependencies.bzl && bazel run @com_github_bazelbuild_buildtools//:buildifier"
36+
"run": "bazel run //:buildifier.check"
3737
},
3838
{
3939
"name": "Gofmt",
@@ -73,35 +73,35 @@
7373
},
7474
{
7575
"name": "linux_amd64: build and test",
76-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //..."
76+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_amd64 //..."
7777
},
7878
{
7979
"name": "linux_386: build and test",
80-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_386 //..."
80+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_386 //..."
8181
},
8282
{
8383
"name": "linux_arm: build and test",
84-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_arm //..."
84+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
8585
},
8686
{
8787
"name": "linux_arm64: build and test",
88-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 //..."
88+
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
8989
},
9090
{
9191
"name": "darwin_amd64: build and test",
92-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //..."
92+
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
9393
},
9494
{
9595
"name": "darwin_arm64: build and test",
96-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_arm64 //..."
96+
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
9797
},
9898
{
9999
"name": "freebsd_amd64: build and test",
100-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:freebsd_amd64 //..."
100+
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //..."
101101
},
102102
{
103103
"name": "windows_amd64: build and test",
104-
"run": "bazel build --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //..."
104+
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //..."
105105
}
106106
]
107107
}

BUILD.bazel

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
load("@bazel_gazelle//:def.bzl", "gazelle")
2-
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
1+
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
2+
load("@gazelle//:def.bzl", "gazelle")
33

44
# gazelle:prefix github.com/buildbarn/bb-deployments
55
# gazelle:exclude dummy_for_dependencies.go
66
gazelle(
77
name = "gazelle",
88
)
9+
10+
buildifier(
11+
name = "buildifier.check",
12+
exclude_patterns = [
13+
"./.git/*",
14+
],
15+
lint_mode = "warn",
16+
lint_warnings = ["-module-docstring"],
17+
mode = "diff",
18+
)

MODULE.bazel

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
module(name = "com_github_buildbarn_bb_deployments")
2+
3+
bazel_dep(name = "aspect_bazel_lib", version = "2.6.0")
4+
bazel_dep(name = "aspect_rules_js", version = "1.39.1")
5+
bazel_dep(name = "googletest", version = "1.14.0")
6+
bazel_dep(name = "com_github_buildbarn_bb_browser")
7+
bazel_dep(name = "abseil-cpp", version = "20240116.2")
8+
bazel_dep(name = "rules_cc", version = "0.0.9")
9+
bazel_dep(name = "com_github_buildbarn_bb_remote_execution")
10+
bazel_dep(name = "com_github_buildbarn_bb_storage")
11+
bazel_dep(name = "com_github_buildbarn_go_xdr")
12+
bazel_dep(name = "gazelle", version = "0.35.0")
13+
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5")
14+
bazel_dep(name = "jsonnet_go", version = "0.20.0")
15+
bazel_dep(name = "opentelemetry-proto", version = "1.1.0")
16+
bazel_dep(name = "protobuf", version = "23.1")
17+
bazel_dep(name = "rules_antlr")
18+
bazel_dep(name = "rules_go", version = "0.46.0")
19+
bazel_dep(name = "rules_jsonnet", version = "0.6.0")
20+
bazel_dep(name = "rules_oci", version = "1.7.5")
21+
bazel_dep(name = "rules_pkg", version = "0.10.1")
22+
bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
23+
bazel_dep(name = "toolchains_llvm", version = "1.0.0")
24+
25+
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
26+
27+
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
28+
29+
http_archive(
30+
name = "grafonnet_lib",
31+
build_file_content = """
32+
load("@rules_jsonnet//jsonnet:jsonnet.bzl", "jsonnet_library")
33+
34+
jsonnet_library(
35+
name = "grafonnet",
36+
srcs = glob(["grafonnet/*.libsonnet"]),
37+
imports = ["."],
38+
visibility = ["//visibility:public"],
39+
)
40+
""",
41+
sha256 = "ef8d75ab8633024f0a214f61e28ca8a5fe384467ce1151587eb812ddf7181e76",
42+
strip_prefix = "grafonnet-lib-04f3e87e2d524c7aba936aae525f388290d94291",
43+
urls = ["https://github.com/grafana/grafonnet-lib/archive/04f3e87e2d524c7aba936aae525f388290d94291.tar.gz"],
44+
)
45+
46+
http_archive(
47+
name = "abseil-hello",
48+
patch_cmds = [
49+
"sed -i 's/com_google_absl/abseil-cpp/' BUILD.bazel",
50+
"sed -i 's/com_google_googletest/googletest/' BUILD.bazel",
51+
],
52+
sha256 = "e676640e69e210636de795f571237bec09a9ad9af6e441bf56f0d193cfe1c9fc",
53+
strip_prefix = "abseil-hello-b4803b41ab3d58c503265148e5a7d3fd2a8e46d3/bazel-hello",
54+
urls = ["https://github.com/abseil/abseil-hello/archive/b4803b41ab3d58c503265148e5a7d3fd2a8e46d3.zip"],
55+
)
56+
57+
git_override(
58+
module_name = "com_github_buildbarn_bb_browser",
59+
commit = "a644003a557767c736d8b45c9a50e1faf9c2e024",
60+
remote = "https://github.com/buildbarn/bb-browser.git",
61+
)
62+
63+
git_override(
64+
module_name = "com_github_buildbarn_bb_remote_execution",
65+
commit = "ea22f37f62b885026ad9e1aa0d62deb15dbb454a",
66+
remote = "https://github.com/buildbarn/bb-remote-execution.git",
67+
)
68+
69+
git_override(
70+
module_name = "com_github_buildbarn_bb_storage",
71+
commit = "a9d0937955fc44f23434b450608c9ebc8405ab05",
72+
remote = "https://github.com/buildbarn/bb-storage.git",
73+
)
74+
75+
git_override(
76+
module_name = "com_github_buildbarn_go_xdr",
77+
commit = "9cb8426d3e09e301c2b12c993e54ef795a665a92",
78+
remote = "https://github.com/buildbarn/go-xdr.git",
79+
)
80+
81+
git_override(
82+
module_name = "rules_antlr",
83+
commit = "89a29cca479363a5aee53e203719510bdc6be6ff",
84+
patches = [
85+
"//:patches/rules_antlr/antlr-4.10.diff",
86+
"//:patches/rules_antlr/bzlmod.diff",
87+
],
88+
remote = "https://github.com/marcohu/rules_antlr.git",
89+
)
90+
91+
git_override(
92+
module_name = "gazelle",
93+
commit = "f5a5c5dc90b4d6a39f0f47d770eba27c6c1c1877",
94+
patches = [
95+
"//:patches/gazelle/dont-flatten-srcs.diff",
96+
"//:patches/gazelle/googleapis.diff",
97+
],
98+
remote = "https://github.com/bazelbuild/bazel-gazelle.git",
99+
)
100+
101+
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
102+
go_sdk.download(version = "1.22.1")
103+
104+
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
105+
go_deps.from_file(go_mod = "//:go.mod")
106+
use_repo(
107+
go_deps,
108+
"cc_mvdan_gofumpt",
109+
"org_golang_x_lint",
110+
)
111+
112+
go_deps_dev = use_extension("@gazelle//:extensions.bzl", "go_deps", dev_dependency = True)
113+
go_deps_dev.module_override(
114+
patches = ["//:patches/com_github_buildkite_terminal_to_html/assets.diff"],
115+
path = "github.com/buildkite/terminal-to-html",
116+
)
117+
go_deps_dev.gazelle_override(
118+
build_file_generation = "on",
119+
directives = [
120+
"gazelle:go_grpc_compilers @io_bazel_rules_go//proto:go_proto,@io_bazel_rules_go//proto:go_grpc_v2",
121+
"gazelle:resolve proto go build/bazel/semver/semver.proto //build/bazel/semver",
122+
"gazelle:resolve proto go google/api/annotations.proto @org_golang_google_genproto_googleapis_api//annotations",
123+
"gazelle:resolve proto go google/longrunning/operations.proto @com_google_cloud_go_longrunning//autogen/longrunningpb",
124+
"gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status",
125+
"gazelle:resolve proto google/api/annotations.proto @googleapis//google/api:annotations_proto",
126+
"gazelle:resolve proto google/longrunning/operations.proto @googleapis//google/longrunning:operations_proto",
127+
"gazelle:resolve proto google/rpc/status.proto @googleapis//google/rpc:status_proto",
128+
],
129+
path = "github.com/bazelbuild/remote-apis",
130+
)
131+
go_deps_dev.module_override(
132+
patches = ["//:patches/org_golang_google_genproto_googleapis_bytestream/service-registrar.diff"],
133+
path = "google.golang.org/genproto/googleapis/bytestream",
134+
)
135+
go_deps_dev.module_override(
136+
patches = [
137+
"//:patches/com_github_hanwen_go_fuse_v2/direntrylist-offsets-and-testability.diff",
138+
"//:patches/com_github_hanwen_go_fuse_v2/writeback-cache.diff",
139+
"//:patches/com_github_hanwen_go_fuse_v2/notify-testability.diff",
140+
],
141+
path = "github.com/hanwen/go-fuse/v2",
142+
)

0 commit comments

Comments
 (0)