-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMODULE.bazel
More file actions
213 lines (189 loc) · 9.86 KB
/
MODULE.bazel
File metadata and controls
213 lines (189 loc) · 9.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Copyright 2025 Stack AV Co.
# SPDX-License-Identifier: Apache-2.0
module(name = "clockwork")
SINGLE_VERSION_OVERRIDE = "SINGLE_VERSION_OVERRIDE"
LOCAL_PATH_OVERRIDE = "LOCAL_PATH_OVERRIDE"
PATCH = True
NO_PATCH = False
PYTHON_VERSION = "3.10"
dependencies = [
# keep-sorted start
("abseil-cpp", SINGLE_VERSION_OVERRIDE, "20250127.1", PATCH),
("aspect_bazel_lib", SINGLE_VERSION_OVERRIDE, "2.21.2", PATCH),
("aspect_rules_js", SINGLE_VERSION_OVERRIDE, "2.5.0", PATCH),
("aspect_rules_py", SINGLE_VERSION_OVERRIDE, "1.1.0", PATCH),
("aspect_rules_ts", SINGLE_VERSION_OVERRIDE, "3.7.0", NO_PATCH),
("au", "https://github.com/aurora-opensource/au.git", "49e3e0e2b7cc67164379bce323761c260370f8f0", PATCH), # main
("aws_sdk_cpp", "https://github.com/aws/aws-sdk-cpp.git", "713aebfea4705e7437bb0874c47e44ddf13b9b31", PATCH), # 1.11.185
("bazel_skylib", SINGLE_VERSION_OVERRIDE, "1.8.1", NO_PATCH),
("bazel_skylib_gazelle_plugin", SINGLE_VERSION_OVERRIDE, "1.8.1", PATCH),
("build_stack_rules_proto", "https://github.com/stackb/rules_proto.git", "e3215cd105255f1a65f5447899671b000d96721e", PATCH), # v2.0.1
("buildifier_prebuilt", SINGLE_VERSION_OVERRIDE, "8.2.0.2", None),
("c-ares", SINGLE_VERSION_OVERRIDE, "1.34.5", NO_PATCH),
("catch2", SINGLE_VERSION_OVERRIDE, "3.8.1", PATCH),
("clang", "https://github.com/stackav-oss/clockwork/releases/download/sysroot/clang_sysroot_4.tar.zst", "sha256-OjeMjqEcjT8UuQYlLpQBJYjnZPssy+GVAVmBJrI8ftk=", NO_PATCH),
("com_github_nanopb_nanopb", "https://github.com/nanopb/nanopb.git", "cad3c18ef15a663e30e3e43e3a752b66378adec1", PATCH), # 0.4.9.1
("curl", SINGLE_VERSION_OVERRIDE, "8.8.0.bcr.3", None),
("fltk", "https://github.com/rnortman/fltk.git", "802cea356b36a7c99c949fb59922e59eaa66f036", PATCH), # main
("fmt", "https://github.com/fmtlib/fmt.git", "40626af88bd7df9a5fb80be7b25ac85b122d6c21", PATCH), # 11.2.0
("gazelle", "https://github.com/bazelbuild/bazel-gazelle.git", "669939453cba5ac2874407245f02a0d281fd13fa", NO_PATCH), # v0.42.0
("grpc", SINGLE_VERSION_OVERRIDE, "1.73.1", NO_PATCH),
("gsl", "https://github.com/microsoft/GSL.git", "caae4dd0f8343efb879369dcd08a2b18aae59f3b", PATCH), # main
("liburing", "https://github.com/axboe/liburing.git", "6b5f5bc9a2e43ad3ee330a093d53d7a81816f676", PATCH), # liburing-2.4
("lz4", SINGLE_VERSION_OVERRIDE, "1.10.0.bcr.1", NO_PATCH),
("mcap", "https://github.com/foxglove/mcap.git", "741841ba9c09752de6b867a666688672fba23ab4", PATCH), # releases/mcap-cli/v0.0.30
("nanobind", "https://github.com/wjakob/nanobind.git", "8894eb0116b38a4a1355b79d18c3a833ce3d9dff", PATCH), # v2.2.0
("openssl", SINGLE_VERSION_OVERRIDE, "3.3.1.bcr.1", None),
("platforms", SINGLE_VERSION_OVERRIDE, "1.0.0", NO_PATCH),
("protobuf", SINGLE_VERSION_OVERRIDE, "31.1", PATCH),
("protoc-gen-validate", SINGLE_VERSION_OVERRIDE, "1.2.1.bcr.1", NO_PATCH), # indirect dependency from go's xds
("re2", SINGLE_VERSION_OVERRIDE, "2021-09-01", NO_PATCH),
("rules_boost", "https://github.com/nelhage/rules_boost.git", "2a7a2ad203e469276540cb7d260e8bd46f6cc030", PATCH), # master
("rules_cc", SINGLE_VERSION_OVERRIDE, "0.2.8", NO_PATCH),
("rules_go", SINGLE_VERSION_OVERRIDE, "0.57.0", PATCH),
("rules_java", SINGLE_VERSION_OVERRIDE, "8.15.2", NO_PATCH),
("rules_multirun", SINGLE_VERSION_OVERRIDE, "0.13.0", NO_PATCH),
("rules_proto", SINGLE_VERSION_OVERRIDE, "7.1.0", NO_PATCH),
("rules_proto_grpc", SINGLE_VERSION_OVERRIDE, "5.3.0", NO_PATCH),
("rules_proto_grpc_buf", SINGLE_VERSION_OVERRIDE, "5.7.1", NO_PATCH),
("rules_python", SINGLE_VERSION_OVERRIDE, "1.5.4", PATCH),
("rules_python_gazelle_plugin", SINGLE_VERSION_OVERRIDE, "1.5.3", PATCH),
("rules_shell", SINGLE_VERSION_OVERRIDE, "0.6.1", NO_PATCH),
("sha1", "https://github.com/vog/sha1.git", "76953a8057515a3d29f7f593efe789a2d1122a34", PATCH), # 1.4
("stardoc", SINGLE_VERSION_OVERRIDE, "0.8.0", NO_PATCH),
("tclap", "https://github.com/mirror/tclap.git", "61cfae16ceba4cadc3d74439fa1e9fd4fce16bc9", PATCH), # 1.4
("tl_expected", "https://github.com/TartanLlama/expected.git", "1770e3559f2f6ea4a5fb4f577ad22aeb30fbd8e4", PATCH), # v1.3.1
("trompeloeil", "https://github.com/rollbear/trompeloeil.git", "eaeb89c1ce9d354b0ba7eb921fd5712cdbd78adf", PATCH), # v49
("upb", SINGLE_VERSION_OVERRIDE, "0.0.0-20230907-e7430e6", NO_PATCH),
("wise_enum", "https://github.com/quicknir/wise_enum.git", "34ac79f7ea2658a148359ce82508cc9301e31dd3", PATCH), # 3.1.0
("xxhash", "https://github.com/Cyan4973/xxHash.git", "e626a72bc2321cd320e953a0ccf1584cad60f363", PATCH), # v0.8.3
("zstd", SINGLE_VERSION_OVERRIDE, "1.5.7", NO_PATCH),
# keep-sorted end
]
patch_strip = {
# keep-sorted start
# The rules_python Gazelle plugin is a subdir of the rules_python repo.
"rules_python_gazelle_plugin": 1,
# keep-sorted end
}
patch_cmds = {
# keep-sorted start block=yes
"fmt": [
# Move the include dir
"""find . -type f -print0 | LC_ALL=C xargs -0 sed -i'' -e 's%#include "fmt%#include "fmt10%g'""",
"mv include/fmt include/fmt10",
],
"protobuf": ["""find . -name *.h -print0 | xargs -0 sed -i'' -e '1 i\\\n#pragma GCC system_header'"""],
# keep-sorted end
}
# Git repositories that require submodules to be checked out
has_submodules = ["aws_sdk_cpp"]
[bazel_dep(name = name) for name, _, _, _ in dependencies]
[git_override(
module_name = name,
commit = commit,
patch_cmds = patch_cmds.get(name, []),
patches = ["//third_party/patches:" + name + ".patch"] if should_patch else [],
recursive_init_submodules = name in has_submodules,
remote = remote,
) for name, remote, commit, should_patch in dependencies if remote.endswith(".git")]
# In bazel 7 we will be able to call http_archive from MODULE.bazel, which is preferred for some use-cases.
# In the meanwhile use archive_override.
[archive_override(
module_name = name,
# How could anyone have guessed this: https://github.com/bazelbuild/bazel/issues/17803
# To get checksum you need to pipe the file through `openssl dgst -sha256 -binary | openssl base64 -A` and prefix "sha256-"
integrity = integrity,
patch_cmds = patch_cmds.get(name, []),
patches = ["//third_party/patches:" + name + ".patch"] if should_patch else [],
urls = [url],
) for name, url, integrity, should_patch in dependencies if url.endswith((".tar.gz", ".tar.zst", ".tar.xz"))]
[single_version_override(
module_name = name,
patch_cmds = patch_cmds.get(name, []),
patch_strip = patch_strip.get(name, 0),
patches = ["//third_party/patches:" + name + ".patch"] if should_patch else [],
version = version,
) for name, remote, version, should_patch in dependencies if remote == SINGLE_VERSION_OVERRIDE]
[local_path_override(
module_name = lib,
path = ("third_party/" + lib) if custom_path == None else custom_path,
) for lib, remote, custom_path, _ in dependencies if remote == LOCAL_PATH_OVERRIDE]
non_module_boost_repositories = use_extension("@rules_boost//:boost/repositories.bzl", "non_module_dependencies")
use_repo(non_module_boost_repositories, "boost")
register_toolchains(
"@clang//:clang-aarch64-gnu-linux",
"@clang//:clang-x86_64-gnu-linux",
dev_dependency = True,
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
ignore_root_user_error = True,
python_version = "3.10",
)
use_repo(python, "python_3_10")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.whl_mods(
# Works around this issue https://github.com/bazelbuild/rules_python/issues/1000
additive_build_content = """
filegroup(
name = "bin_uv",
srcs = ["bin/uv"],
)
""",
data = [":bin_uv"],
hub_name = "clockwork_whl_mods_hub",
whl_name = "uv",
)
use_repo(pip, "clockwork_whl_mods_hub")
pip.parse(
# The default conversion of native namespace packages into pkg-util namespace packages by automatically generating
# __init__.py files in every directory breaks pyright's import resolution for type-checking, so we override it here
enable_implicit_namespace_pkgs = True,
extra_hub_aliases = {"uv": ["bin_uv"]},
hub_name = "clockwork_pip",
python_version = PYTHON_VERSION,
requirements_lock = "//tools/language_support:requirements.txt",
whl_modifications = {
# keep-sorted start
"@clockwork_whl_mods_hub//:uv.json": "uv",
# keep-sorted end
},
)
use_repo(pip, "clockwork_pip")
pip.parse(
# The default conversion of native namespace packages into pkg-util namespace packages by automatically generating
# __init__.py files in every directory breaks pyright's import resolution for type-checking, so we override it here
enable_implicit_namespace_pkgs = True,
hub_name = "clockwork_pip310",
python_version = "3.10",
requirements_lock = "//tools/language_support:requirements_310.txt",
)
use_repo(pip, "clockwork_pip310")
## Protobuf
register_toolchains("@build_stack_rules_proto//toolchain:standard")
# golang
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.nogo(nogo = "//tools/golang:clockwork_nogo")
go_sdk.from_file(go_mod = "//:go.mod")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
# keep-sorted start
"com_github_bazelbuild_buildtools",
"com_github_emirpasic_gods",
"com_github_stretchr_testify",
"org_golang_google_genproto_googleapis_api",
"org_golang_google_protobuf",
"org_skia_go_infra",
# keep-sorted end
)
go_deps_dev = use_extension("@gazelle//:extensions.bzl", "go_deps", dev_dependency = True)
go_deps_dev.module_override(
patches = ["third_party/patches/go_tree_sitter.patch"],
path = "github.com/dougthor42/go-tree-sitter",
)
root_repo = use_extension("//tools/repo:root_repo.bzl", "root_repo")
use_repo(root_repo, "root_repo")