forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
296 lines (272 loc) · 8.26 KB
/
MODULE.bazel
File metadata and controls
296 lines (272 loc) · 8.26 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
module(
name = "skia",
)
# Bazel and Toolchain deps
EMSDK_VERSION = "4.0.7"
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "8.0.3")
bazel_dep(name = "gazelle", version = "0.43.0")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_python", version = "1.3.0")
bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_shell", version = "0.4.1")
bazel_dep(name = "rules_webtesting", version = "0.4.0", dev_dependency = True)
bazel_dep(name = "emsdk", version = EMSDK_VERSION, dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.54.0", dev_dependency = True)
# C++ deps
bazel_dep(name = "skia_user_config") # local
# Configuration
git_override(
module_name = "emsdk",
remote = "https://github.com/emscripten-core/emsdk.git",
strip_prefix = "bazel",
tag = EMSDK_VERSION,
)
# use the go version specified in go.mod
# https://github.com/bazel-contrib/rules_go/blob/f0d3aa796ba9723ce89057f8f4b04f2165d38a72/docs/go/core/bzlmod.md
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)
go_sdk.from_file(go_mod = "//:go.mod")
# Get all the direct and indirect dependencies specified in go.mod.
# We only need to label the direct ones.
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
go_deps.gazelle_override(
build_file_generation = "on", # overwrite existing Bazel files (for go code)
directives = [
# This module is distributed with pre-generated .pb.go files, so we disable generation of
# go_proto_library targets. Trying to enable them anyway runs into issues because they
# copy some protos from googleapis.
"gazelle:proto disable",
],
path = "go.chromium.org/luci",
)
use_repo(
go_deps,
"com_github_flynn_json5",
"com_github_golang_glog",
"com_github_google_uuid",
"com_github_shirou_gopsutil",
"com_github_stretchr_testify",
"com_github_trietmn_go_wiki",
"com_github_vektra_mockery_v2",
"com_google_cloud_go_pubsub",
"com_google_cloud_go_storage",
"org_chromium_go_luci",
"org_golang_google_api",
"org_golang_google_protobuf",
"org_golang_x_exp",
"org_skia_go_infra",
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "py_deps",
python_version = "3.13",
requirements_lock = "//:requirements.txt",
)
use_repo(pip, "py_deps")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
extra_target_triples = [
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"aarch64-apple-ios",
],
versions = [
# supported versions from https://github.com/bazelbuild/rules_rust/blob/6bdae371374a3740e97370bd9379da5b3ecab389/util/fetch_shas/fetch_shas_VERSIONS.txt
# The rust rules validate a toolchain by sha256 hash, as listed in https://github.com/bazelbuild/rules_rust/blob/6bdae371374a3740e97370bd9379da5b3ecab389/rust/known_shas.bzl
"1.86.0",
],
)
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.spec(
features = ["derive"],
package = "bytemuck",
version = "1.16.0",
)
crate.spec(
package = "cxx",
version = "1.0.158",
)
crate.annotation(
# We want a custom build rule so we can use a different include path
additive_build_file = "//bazel/external/cxx:BUILD.bazel.skia",
crate = "cxx",
extra_aliased_targets = {
"cxx_cc": "cxx_cc",
},
gen_build_script = "off",
)
crate.spec(
package = "font-types",
version = "0.9",
)
crate.spec(
features = [
"provider_test",
"icu_casemap",
"compiled_data",
],
git = "https://chromium.googlesource.com/external/github.com/unicode-org/icu4x.git",
package = "icu_capi",
tag = "upstream/ind/icu_capi@1.4.1",
)
crate.spec(
package = "png",
version = "0.18.0-rc",
)
crate.spec(
features = [
"wgsl-in",
"msl-out",
],
package = "naga",
version = "0.20.0",
)
crate.spec(
package = "peniko",
version = "0.1.1",
)
crate.spec(
package = "read-fonts",
version = "0.29.2",
)
crate.spec(
package = "regex",
version = "1.8.1",
)
crate.spec(
package = "skrifa",
version = "0.31.3",
)
crate.spec(
package = "thiserror",
version = "1.0.60",
)
crate.from_specs(
# by default, intel macs are not included in this list, but we have CI hardware
# that still uses them, so we add them to the list.
# https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#crate.from_specs-supported_platform_triples
supported_platform_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"wasm32-unknown-unknown",
"wasm32-wasip1",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
],
)
use_repo(crate, "crates")
# cxxbridge-cmd is a binary only Rust crate, so we follow these instructions for it
# https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#binary-dependencies
cargo_bindeps = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
cargo_bindeps.spec(
artifact = "bin",
package = "cxxbridge-cmd",
version = "1.0.158",
)
cargo_bindeps.annotation(
crate = "cxxbridge-cmd",
gen_all_binaries = True,
)
cargo_bindeps.from_specs(
name = "cargo_bindeps",
host_tools_repo = "rust_host_tools_nightly",
supported_platform_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"wasm32-unknown-unknown",
"wasm32-wasip1",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
],
)
use_repo(
cargo_bindeps,
"cargo_bindeps",
)
# TODO(kjlubick): Switch to a release version once it's available in BCR.
# We should be able to clean up rules_scala also
git_override(
module_name = "rules_webtesting",
commit = "c884a863c09001776b001a76886e14f87ca8fd12",
remote = "https://github.com/bazelbuild/rules_webtesting.git",
)
bazel_dep(name = "rules_scala", dev_dependency = True, repo_name = "io_bazel_rules_scala")
git_override(
module_name = "rules_scala",
commit = "219e63983e8e483e66ebf70372969ba227382001",
remote = "https://github.com/mbland/rules_scala",
)
scala_deps = use_extension(
"@io_bazel_rules_scala//scala/extensions:deps.bzl",
"scala_deps",
dev_dependency = True,
)
scala_deps.settings(
fetch_sources = True,
)
scala_deps.toolchains(
scalatest = True,
)
# Bazel deps we make ourselves
local_path_override(
module_name = "skia_user_config",
path = "include/config",
)
cpp_modules = use_extension("//bazel:cpp_modules.bzl", "cpp_modules")
cpp_modules.from_file(deps_json = "//bazel:deps.json")
use_repo(
cpp_modules,
"dawn",
"delaunator",
"dng_sdk",
"expat",
"freetype",
"harfbuzz",
"icu",
"icu4x",
"imgui",
"libavif",
"libgav1",
"libjpeg_turbo",
"libjxl",
"libpng",
"libwebp",
"libyuv",
"perfetto",
"piex",
"spirv_cross",
"spirv_headers",
"spirv_tools",
"vello",
"vulkan_headers",
"vulkan_tools",
"vulkan_utility_libraries",
"vulkanmemoryallocator",
"wuffs",
"zlib",
)
download_linux_amd64_toolchain = use_repo_rule("//toolchain:download_linux_amd64_toolchain.bzl", "download_linux_amd64_toolchain")
download_linux_amd64_toolchain(name = "clang_linux_amd64")
download_clang_mac_toolchain = use_repo_rule("//toolchain:download_mac_toolchain.bzl", "download_mac_toolchain")
download_clang_mac_toolchain(name = "clang_mac")
download_ndk_linux_amd64_toolchain = use_extension("//toolchain:download_ndk_linux_amd64_toolchain.bzl", "download_ndk_linux_amd64_toolchain")
use_repo(download_ndk_linux_amd64_toolchain, "ndk_linux_amd64")
#toolchain_names = ["clang_windows_amd64", "clang_ios"],
cipd_deps = use_extension("//bazel:cipd_deps.bzl", "cipd_deps")
use_repo(
cipd_deps,
"git_linux_amd64",
"gn_linux_amd64",
"gn_mac_amd64",
"gn_mac_arm64",
)