-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMODULE.bazel
More file actions
253 lines (208 loc) · 8.46 KB
/
MODULE.bazel
File metadata and controls
253 lines (208 loc) · 8.46 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
"""Donner SVG: Embeddable browser-grade SVG2 engine for your application.
A C++20 SVG rendering library providing full SVG DOM access with complete rendering
support including text, filters, and animation."""
module(name = "donner", version = "0.5.1")
# Donner build-time feature configuration.
# Downstream consumers can override these defaults via donner.configure() in their MODULE.bazel.
donner = use_extension("//config:extensions.bzl", "donner")
donner.configure()
use_repo(donner, "donner_config")
local_repository = use_repo_rule("//third_party:bazel/local.bzl", "local_repository")
new_local_repository = use_repo_rule("//third_party:bazel/local.bzl", "new_local_repository")
git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# Build dependencies
bazel_dep(name = "apple_support", version = "2.5.2", repo_name = "build_bazel_apple_support") # Must be before rules_cc
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.0.0")
# rules_foreign_cc historically drove Dawn's CMake build. The Geode backend
# now consumes prebuilt `wgpu-native` tarballs via `http_archive`, so the
# rule is no longer load-bearing — it is kept only because other vendored
# third-party projects still import it. Revisit if it goes completely unused.
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
##
## Non-BCR dependencies (dev-only extension)
##
# harfbuzz, woff2, wgpu-native, resvg-test-suite, and bazel_clang_tidy all live
# behind `git_repository`/`new_git_repository` calls that are not permitted in
# modules published to the Bazel Central Registry. We hide them behind a
# module extension flagged `dev_dependency = True`, so downstream BCR consumers
# never see them. When donner is the root module (local dev or CI), the
# extension runs and fetches everything exactly as before.
#
# Every target in donner that references one of these repos MUST be behind a
# `target_compatible_with` guard on the corresponding config_setting, so that
# BCR consumers doing `bazel build @donner//...` simply skip those targets
# rather than failing to resolve the missing repos. See
# third_party/bazel/non_bcr_deps.bzl for the list.
non_bcr_deps = use_extension("//third_party:bazel/non_bcr_deps.bzl", "non_bcr_deps", dev_dependency = True)
use_repo(
non_bcr_deps,
"bazel_clang_tidy",
"harfbuzz",
"resvg-test-suite",
"sysroot_linux_aarch64",
"sysroot_linux_x86_64",
"tracy",
"wgpu_native_linux_aarch64",
"wgpu_native_linux_x86_64",
"wgpu_native_macos_aarch64",
"wgpu_native_macos_x86_64",
"woff2",
)
##
## Third-party dependencies
##
# Tiny-skia dependencies
local_repository(
name = "tiny-skia-cpp",
path = "third_party/tiny-skia-cpp",
)
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "freetype", version = "2.13.3.bcr.1")
bazel_dep(name = "libpng", version = "1.6.54")
# Enable FreeType's PNG support for CBDT color emoji bitmaps.
single_version_override(
module_name = "freetype",
version = "2.13.3.bcr.1",
patches = [
"//third_party/patches:freetype-enable-png-module.patch",
"//third_party/patches:freetype-enable-png-build.patch",
],
patch_strip = 1,
)
# entt is vendored as a git subtree under third_party/entt (pinned at upstream
# tag v3.16.0). Using local_repository keeps entt's own BUILD.bazel, which
# already exposes an `//:entt` alias to `//src:entt`. When we need to bump
# entt, use `git subtree pull --prefix=third_party/entt https://github.com/skypjack/entt <tag> --squash`.
local_repository(
name = "entt",
path = "third_party/entt",
)
local_repository(
name = "frozen",
path = "third_party/frozen",
)
new_local_repository(
name = "stb",
build_file = "//third_party:BUILD.stb",
path = "third_party/stb",
)
bazel_dep(name = "zlib", version = "1.3.2")
# brotli is required by @woff2 (see non_bcr_deps.bzl); text-full only.
bazel_dep(name = "brotli", version = "1.2.0")
##
## Test dependencies
##
# re2 is not used directly, but needs to use this version to resolve a build error in deps (googletest)
bazel_dep(name = "re2", version = "2024-07-02.bcr.1", dev_dependency = True)
bazel_dep(name = "googletest", repo_name = "com_google_gtest", version = "1.17.0.bcr.2", dev_dependency = True)
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1", dev_dependency = True)
bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.7.1", dev_dependency = True)
bazel_dep(name = "pixelmatch-cpp17", version = "1.0.3", dev_dependency = True)
new_local_repository(
name = "css-parsing-tests",
build_file = "//third_party:BUILD.css-parsing-tests",
path = "third_party/css-parsing-tests",
)
# resvg-test-suite and the wgpu-native prebuilts are fetched via the
# non_bcr_deps module extension declared above — they are not available when
# donner is consumed from BCR.
bazel_dep(name = "rules_python", version = "1.9.0", dev_dependency = True)
# Hermetic Python toolchain. Without this, rules_python's py_binary targets
# fall back to `/usr/bin/env python3` on the host — which is fine for local
# dev on dev1, but on the Bazel remote-execution sandbox (NixOS) no such
# host interpreter is available. Registering `python.toolchain()` makes
# rules_python ship a prebuilt CPython through the action cache so RE
# workers execute the same interpreter as local builds.
python = use_extension(
"@rules_python//python/extensions:python.bzl",
"python",
dev_dependency = True,
)
python.defaults(python_version = "3.12")
python.toolchain(python_version = "3.12")
use_repo(python, "python_3_12")
#
# Toolchain
#
bazel_dep(name = "toolchains_llvm", version = "1.7.0", dev_dependency = True)
# To use a local copy of the toolchains_llvm repository, uncomment the following.
# local_path_override(
# module_name = "toolchains_llvm",
# path = "../toolchains_llvm",
# )
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
name = "llvm_toolchain",
llvm_version = "21.1.6",
)
# Hermetic Linux sysroots: keep the toolchain self-contained on Bazel
# remote-execution workers (bazel-re1, NixOS) that lack system glibc
# headers. See third_party/bazel/non_bcr_deps.bzl for the tarballs.
llvm.sysroot(
name = "llvm_toolchain",
targets = ["linux-aarch64"],
label = "@sysroot_linux_aarch64//:sysroot",
)
llvm.sysroot(
name = "llvm_toolchain",
targets = ["linux-x86_64"],
label = "@sysroot_linux_x86_64//:sysroot",
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")
# NOTE: This to use this toolchain specify --config=latest_llvm
# This is enabled by default on Linux, disabled by default on macOS
# register_toolchains("@llvm_toolchain//:all", dev_dependency = True)
bazel_dep(name = "zstd", version = "1.5.7.bcr.1", dev_dependency = True)
#
# Devtools
#
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor",
commit = "abb61a688167623088f8768cc9264798df6a9d10",
)
bazel_dep(name = "rules_proto", version = "7.1.0", dev_dependency = True)
bazel_dep(name = "protobuf", version = "30.2", dev_dependency = True)
single_version_override(
module_name = "protobuf",
version = "30.2",
)
bazel_dep(name = "bloaty", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "bloaty",
remote = "https://github.com/jwmcglynn/bloaty",
commit = "a655c418811ef5097e37a562ce62f925bda72d88",
)
#
# WebAssembly (Emscripten SDK)
#
bazel_dep(name = "emsdk", version = "5.0.5", dev_dependency = True)
#
# SVG Viewer
#
bazel_dep(name = "imgui", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "imgui",
remote = "https://github.com/ocornut/imgui",
commit = "ee1deccc08c14ab1e6abcfa6aae11d915763cdb7",
patches = [
"//third_party/patches:imgui_bazel_build_files.patch",
],
patch_strip = 1,
)
bazel_dep(name = "glfw", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "glfw",
remote = "https://github.com/glfw/glfw",
commit = "4df5129529b1af57d04a51f09145da5079822c3e",
patches = [
"//third_party/patches:glfw_bazel_build_files.patch",
],
patch_strip = 1,
)