Skip to content

Commit f053dda

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

File tree

26 files changed

+19574
-2358
lines changed

26 files changed

+19574
-2358
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

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
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": "sed '/^$/d' go_dependencies.bzl > go_dependencies.bzl.new && mv go_dependencies.bzl.new go_dependencies.bzl && 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

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
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": "sed '/^$/d' go_dependencies.bzl > go_dependencies.bzl.new && mv go_dependencies.bzl.new go_dependencies.bzl && 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

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

0 commit comments

Comments
 (0)