Debian Codegraph @

MODULE.bazel

raw
1 module(
2 name = "skia",
3 )
4
5 # Bazel and Toolchain deps
6 EMSDK_VERSION = "4.0.7"
7
8 bazel_dep(name = "bazel_skylib", version = "1.7.1")
9 bazel_dep(name = "buildifier_prebuilt", version = "8.0.3")
10 bazel_dep(name = "gazelle", version = "0.43.0")
11 bazel_dep(name = "platforms", version = "1.0.0")
12 bazel_dep(name = "rules_cc", version = "0.1.5")
13 bazel_dep(name = "rules_license", version = "1.0.0")
14 bazel_dep(name = "rules_python", version = "1.3.0")
15 bazel_dep(name = "rules_rust", version = "0.60.0")
16 bazel_dep(name = "rules_shell", version = "0.4.1")
17
18 bazel_dep(name = "rules_go", version = "0.58.3", dev_dependency = True)
19 bazel_dep(name = "rules_webtesting", version = "0.4.0", dev_dependency = True)
20 bazel_dep(name = "emsdk", version = EMSDK_VERSION, dev_dependency = True)
21
22 # C++ deps
23 bazel_dep(name = "skia_user_config") # local
24
25 # Configuration
26 git_override(
27 module_name = "emsdk",
28 remote = "https://github.com/emscripten-core/emsdk.git",
29 strip_prefix = "bazel",
30 tag = EMSDK_VERSION,
31 )
32
33 # use the go version specified in go.mod
34 # https://github.com/bazel-contrib/rules_go/blob/f0d3aa796ba9723ce89057f8f4b04f2165d38a72/docs/go/core/bzlmod.md
35 go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)
36 go_sdk.from_file(go_mod = "//:go.mod")
37 use_repo(go_sdk, go_sdk = "go_default_sdk")
38
39 # Get all the direct and indirect dependencies specified in go.mod.
40 # We only need to label the direct ones.
41 go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
42 go_deps.from_file(go_mod = "//:go.mod")
43 go_deps.gazelle_override(
44 build_file_generation = "on", # overwrite existing Bazel files (for go code)
45 directives = [
46 # This module is distributed with pre-generated .pb.go files, so we disable generation of
47 # go_proto_library targets. Trying to enable them anyway runs into issues because they
48 # copy some protos from googleapis.
49 "gazelle:proto disable",
50 ],
51 path = "go.chromium.org/luci",
52 )
53 use_repo(
54 go_deps,
55 "com_github_flynn_json5",
56 "com_github_golang_glog",
57 "com_github_google_uuid",
58 "com_github_shirou_gopsutil",
59 "com_github_stretchr_testify",
60 "com_github_trietmn_go_wiki",
61 "com_github_vektra_mockery_v2",
62 "com_google_cloud_go_storage",
63 "org_chromium_go_luci",
64 "org_golang_google_api",
65 "org_golang_google_protobuf",
66 "org_skia_go_infra",
67 )
68
69 inject_repo(
70 go_deps,
71 go_sdk = "go_sdk",
72 rules_go = "rules_go",
73 )
74
75 python = use_extension("@rules_python//python/extensions:python.bzl", "python")
76 python.toolchain(
77 python_version = "3.13",
78 )
79
80 pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
81 pip.parse(
82 hub_name = "py_deps",
83 python_version = "3.13",
84 requirements_lock = "//:requirements.txt",
85 )
86 use_repo(pip, "py_deps")
87
88 rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
89 rust.toolchain(
90 edition = "2021",
91 extra_target_triples = [
92 "x86_64-apple-darwin",
93 "aarch64-apple-darwin",
94 "aarch64-apple-ios",
95 ],
96 versions = [
97 # supported versions from https://github.com/bazelbuild/rules_rust/blob/6bdae371374a3740e97370bd9379da5b3ecab389/util/fetch_shas/fetch_shas_VERSIONS.txt
98 # The rust rules validate a toolchain by sha256 hash, as listed in https://github.com/bazelbuild/rules_rust/blob/6bdae371374a3740e97370bd9379da5b3ecab389/rust/known_shas.bzl
99 "1.86.0",
100 ],
101 )
102
103 crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
104 crate.spec(
105 features = ["derive"],
106 package = "bytemuck",
107 version = "=1.23.2",
108 )
109 crate.spec(
110 # If this is updated, be sure to update BUILD.gn also
111 package = "cxx",
112 version = "=1.0.168",
113 )
114 crate.annotation(
115 # We want a custom build rule so we can use a different include path
116 additive_build_file = "//bazel/external/cxx:BUILD.bazel.skia",
117 crate = "cxx",
118 extra_aliased_targets = {
119 "cxx_cc": "cxx_cc",
120 },
121 gen_build_script = "off",
122 )
123 crate.spec(
124 package = "font-types",
125 version = "=0.9",
126 )
127 crate.spec(
128 features = [
129 "provider_test",
130 "icu_casemap",
131 "compiled_data",
132 ],
133 git = "https://github.com/unicode-org/icu4x.git",
134 package = "icu_capi",
135 rev = "bdb3caadfc4e3e750e819f8ea5f9db8b1f8d2fa7",
136 )
137 crate.spec(
138 package = "png",
139 version = "=0.18.0-rc",
140 )
141 crate.spec(
142 default_features = False,
143 features = ["bmp"],
144 package = "image",
145 version = "=0.25.9",
146 )
147 crate.spec(
148 package = "moxcms",
149 version = "=0.8.0",
150 )
151 crate.spec(
152 features = [
153 "wgsl-in",
154 "msl-out",
155 ],
156 package = "naga",
157 version = "=0.20.0",
158 )
159 crate.spec(
160 package = "peniko",
161 version = "=0.1.1",
162 )
163 crate.spec(
164 package = "read-fonts",
165 version = "=0.34",
166 )
167 crate.spec(
168 package = "regex",
169 version = "=1.11.1",
170 )
171 crate.spec(
172 package = "skrifa",
173 version = "=0.36",
174 )
175 crate.spec(
176 package = "thiserror",
177 version = "=1.0.69",
178 )
179 crate.from_specs(
180 # by default, intel macs are not included in this list, but we have CI hardware
181 # that still uses them, so we add them to the list.
182 # https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#crate.from_specs-supported_platform_triples
183 supported_platform_triples = [
184 "aarch64-apple-darwin",
185 "aarch64-unknown-linux-gnu",
186 "wasm32-unknown-unknown",
187 "wasm32-wasip1",
188 "x86_64-apple-darwin",
189 "x86_64-pc-windows-msvc",
190 "x86_64-unknown-linux-gnu",
191 ],
192 )
193 use_repo(crate, "crates")
194
195 # cxxbridge-cmd is a binary only Rust crate, so we follow these instructions for it
196 # https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#binary-dependencies
197 cargo_bindeps = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
198 cargo_bindeps.spec(
199 artifact = "bin",
200 package = "cxxbridge-cmd",
201 version = "=1.0.168",
202 )
203 cargo_bindeps.annotation(
204 crate = "cxxbridge-cmd",
205 gen_all_binaries = True,
206 )
207 cargo_bindeps.from_specs(
208 name = "cargo_bindeps",
209 host_tools_repo = "rust_host_tools_nightly",
210 supported_platform_triples = [
211 "aarch64-apple-darwin",
212 "aarch64-unknown-linux-gnu",
213 "wasm32-unknown-unknown",
214 "wasm32-wasip1",
215 "x86_64-apple-darwin",
216 "x86_64-pc-windows-msvc",
217 "x86_64-unknown-linux-gnu",
218 ],
219 )
220 use_repo(
221 cargo_bindeps,
222 "cargo_bindeps",
223 )
224
225 # TODO(kjlubick): Switch to a release version once it's available in BCR.
226 # We should be able to clean up rules_scala also
227 git_override(
228 module_name = "rules_webtesting",
229 commit = "c884a863c09001776b001a76886e14f87ca8fd12",
230 remote = "https://github.com/bazelbuild/rules_webtesting.git",
231 )
232
233 bazel_dep(name = "rules_scala", dev_dependency = True, repo_name = "io_bazel_rules_scala")
234 git_override(
235 module_name = "rules_scala",
236 commit = "219e63983e8e483e66ebf70372969ba227382001",
237 remote = "https://github.com/mbland/rules_scala",
238 )
239
240 scala_deps = use_extension(
241 "@io_bazel_rules_scala//scala/extensions:deps.bzl",
242 "scala_deps",
243 dev_dependency = True,
244 )
245 scala_deps.settings(
246 fetch_sources = True,
247 )
248 scala_deps.toolchains(
249 scalatest = True,
250 )
251
252 # Bazel deps we make ourselves
253 local_path_override(
254 module_name = "skia_user_config",
255 path = "include/config",
256 )
257
258 cpp_modules = use_extension("//bazel:cpp_modules.bzl", "cpp_modules")
259 cpp_modules.from_file(deps_json = "//bazel:deps.json")
260 use_repo(
261 cpp_modules,
262 "dawn",
263 "delaunator",
264 "dng_sdk",
265 "expat",
266 "freetype",
267 "harfbuzz",
268 "icu",
269 "icu4x",
270 "imgui",
271 "libavif",
272 "libgav1",
273 "libjpeg_turbo",
274 "libjxl",
275 "libpng",
276 "libwebp",
277 "libyuv",
278 "perfetto",
279 "piex",
280 "spirv_cross",
281 "spirv_headers",
282 "spirv_tools",
283 "vello",
284 "vulkan_headers",
285 "vulkan_tools",
286 "vulkan_utility_libraries",
287 "vulkanmemoryallocator",
288 "wuffs",
289 "zlib",
290 )
291
292 download_linux_amd64_toolchain = use_repo_rule("//toolchain:download_linux_amd64_toolchain.bzl", "download_linux_amd64_toolchain")
293
294 download_linux_amd64_toolchain(name = "clang_linux_amd64")
295
296 download_clang_mac_toolchain = use_repo_rule("//toolchain:download_mac_toolchain.bzl", "download_mac_toolchain")
297
298 download_clang_mac_toolchain(name = "clang_mac")
299
300 download_ndk_linux_amd64_toolchain = use_extension("//toolchain:download_ndk_linux_amd64_toolchain.bzl", "download_ndk_linux_amd64_toolchain")
301 use_repo(download_ndk_linux_amd64_toolchain, "ndk_linux_amd64")
302
303 #toolchain_names = ["clang_windows_amd64", "clang_ios"],
304
305 cipd_deps = use_extension("//bazel:cipd_deps.bzl", "cipd_deps")
306 use_repo(
307 cipd_deps,
308 "git_linux_amd64",
309 "gn_linux_amd64",
310 "gn_mac_amd64",
311 "gn_mac_arm64",
312 )