-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMODULE.bazel
More file actions
259 lines (225 loc) · 9.8 KB
/
MODULE.bazel
File metadata and controls
259 lines (225 loc) · 9.8 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
module(
name = "dashql",
version = "0.1.0",
)
# Rules for C/C++ (cc_library, cc_test, etc.)
bazel_dep(name = "rules_cc", version = "0.2.17")
# Emscripten SDK
bazel_dep(name = "emsdk", version = "5.0.5")
# Rules for Rust
bazel_dep(name = "rules_rust", version = "0.69.0")
# Patch rules_rust to fix Rust coverage under Bazel 8/9: collect_coverage.sh
# explicitly clears RUNFILES_DIR before exec-ing the LCOV merger, which caused
# collect_coverage.rs to resolve the wrong test binary path and produce an empty
# coverage.dat. The patch derives the bin dir from COVERAGE_DIR instead.
single_version_override(
module_name = "rules_rust",
version = "0.69.0",
patches = ["//bazel/patches:rules_rust_collect_coverage_fix.patch"],
patch_strip = 1,
)
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "gflags", version = "2.2.2.bcr.1")
# JS/TS/Jest (aspect rules) — used by packages/dashql-core/api
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
bazel_dep(name = "aspect_rules_js", version = "2.9.2")
bazel_dep(name = "aspect_rules_ts", version = "3.8.8")
bazel_dep(name = "aspect_rules_jest", version = "0.25.2")
bazel_dep(name = "rules_nodejs", version = "6.7.3")
bazel_dep(name = "rules_shell", version = "0.7.1")
bazel_dep(name = "rules_python", version = "1.9.0")
# OCI container image rules (packages/hyper-docker)
bazel_dep(name = "rules_oci", version = "2.3.0")
bazel_dep(name = "rules_pkg", version = "1.2.0")
# Node.js toolchain (for app_bundle postprocess script).
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain()
use_repo(node, "nodejs_toolchains")
register_toolchains("@nodejs_toolchains//:all")
# Protobuf: proto_library (rules_proto) + custom plugins (rules_proto_grpc) for protoc + protoc-gen-es
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_proto_grpc", version = "5.8.0")
bazel_dep(name = "protobuf", version = "34.1")
# protobuf 34.1 -> rules_kotlin 2.2.2 -> rules_android 0.6.4.
# rules_android 0.6.4 has two issues on Bazel 9:
# 1. Its android_sdk_repository_extension creates an @androidsdk repo whose helper.bzl
# references @local_config_platform which is not visible in bzlmod (fixed in 0.7.1 by
# upgrading rules_cc + rules_java; see bazelbuild/rules_android#374).
# 2. It pulls in rules_go 0.51.0-rc2 which uses CcInfo as a built-in symbol removed in
# newer rules_cc (fixed in rules_go >= 0.52.0).
# Override both to latest stable versions.
single_version_override(
module_name = "rules_android",
version = "0.7.1",
)
single_version_override(
module_name = "rules_go",
version = "0.60.0",
)
# copy_to_directory toolchain (assemble src + FlatBuffer TS into one tree for SWC)
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
bazel_lib_toolchains.copy_to_directory()
use_repo(bazel_lib_toolchains, "copy_to_directory_toolchains")
register_toolchains("@copy_to_directory_toolchains//:all")
# npm deps from pnpm lockfile at repo root. Single source: root package.json + workspace packages; run "pnpm install" to update.
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
data = [
"//:package.json",
],
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
# Hoist platform-specific native binaries so they can be found via Node.js module resolution
# (traversing up to the root node_modules). In aspect_rules_js v3, optional platform packages
# are linked inside each package's store via select(), but the select() may not resolve in
# the exec configuration (ST-<hash>) used by js_run_binary. Hoisting ensures the packages
# are always available at the top-level node_modules for the CI platforms.
public_hoist_packages = {
# rolldown native binaries (used by Vite 8)
"@rolldown/binding-darwin-arm64": [""],
"@rolldown/binding-darwin-x64": [""],
"@rolldown/binding-linux-x64-gnu": [""],
"@rolldown/binding-linux-arm64-gnu": [""],
# lightningcss native binaries (used by Vite 8 for CSS minification)
"lightningcss-darwin-arm64": [""],
"lightningcss-darwin-x64": [""],
"lightningcss-linux-x64-gnu": [""],
"lightningcss-linux-arm64-gnu": [""],
},
)
use_repo(npm, "npm")
core_deps = use_extension("//bazel:core_dependencies.bzl", "dashql_core_dependencies")
core_version = use_extension("//packages/dashql-core:bazel/version.bzl", "dashql_core_version_ext")
use_repo(
core_deps,
"ankerl_unordered_dense",
"apache_arrow",
"binaryen",
"bison_src",
"c4core",
"com_google_benchmark",
"com_google_flatbuffers",
"duckdb_prebuilt_linux_amd64",
"duckdb_prebuilt_osx",
"duckdb_source",
"flex_src",
"m4_src",
"rapidjson",
"rapidyaml",
"wabt",
)
use_repo(core_version, "dashql_core_version")
# Emscripten binaries (downloaded per-platform; default version is the latest bundled with emsdk 5.0.4).
emsdk_ext = use_extension("@emsdk//:emscripten_deps.bzl", "emscripten_deps")
use_repo(
emsdk_ext,
"emscripten_bin_linux",
"emscripten_bin_linux_arm64",
"emscripten_bin_mac",
"emscripten_bin_mac_arm64",
)
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
versions = ["1.93.1"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
# App version (git describe -> version.env for Vite genrules in dashql-app).
app_version = use_extension("//packages/dashql-app:bazel/version.bzl", "dashql_app_version_ext")
use_repo(app_version, "dashql_app_version")
# Native crate universe (dashql-native, dashql-pack -- no WASM).
# Root workspace at Cargo.toml with members pointing downward into packages/.
# Run CARGO_BAZEL_REPIN=1 bazel build @crates//:all after changing root Cargo.toml or Cargo.lock.
# Native crate universe: aarch64 + x86_64 macOS (for universal binary) + Linux.
# After changing triples, repin: CARGO_BAZEL_REPIN=1 bazel build @crates//:all
native_crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", isolate = True)
native_crate.from_cargo(
name = "crates",
cargo_lockfile = "//:Cargo.lock",
manifests = ["//:Cargo.toml"],
supported_platform_triples = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
],
)
# Tauri plugin crates that ship ACL permission TOML files.
# Update version suffixes in use_repo below when upgrading tauri plugin dependencies, then repin:
# CARGO_BAZEL_REPIN=1 bazel build @crates//:all
_TAURI_PLUGINS = [
"tauri-plugin-deep-link",
"tauri-plugin-dialog",
"tauri-plugin-fs",
"tauri-plugin-http",
"tauri-plugin-log",
"tauri-plugin-os",
"tauri-plugin-process",
"tauri-plugin-shell",
"tauri-plugin-updater",
]
# Filegroup added to every tauri plugin crate so tauri-aclgen can read
# permission TOML files as proper Bazel inputs (avoids sandbox path issues).
_TAURI_PERMISSION_FILEGROUP = """
filegroup(
name = "permission_files",
srcs = glob(["permissions/**/*.toml"]),
visibility = ["//visibility:public"],
)
"""
# Export permission TOML files from tauri plugin crates.
[native_crate.annotation(
crate = plugin_name,
additive_build_file_content = _TAURI_PERMISSION_FILEGROUP,
) for plugin_name in _TAURI_PLUGINS]
use_repo(
native_crate,
"crates",
# Individual plugin crate repos for permission file access by tauri-aclgen.
"crates__tauri-plugin-deep-link-2.4.8",
"crates__tauri-plugin-dialog-2.7.0",
"crates__tauri-plugin-fs-2.5.0",
"crates__tauri-plugin-http-2.5.8",
"crates__tauri-plugin-log-2.8.0",
"crates__tauri-plugin-os-2.3.2",
"crates__tauri-plugin-process-2.3.1",
"crates__tauri-plugin-shell-2.3.5",
"crates__tauri-plugin-updater-2.10.1",
)
# WASM build: use emscripten toolchain (standalone mode, same .wasm output as WASI SDK).
register_toolchains("@emsdk//emscripten_toolchain:all")
# Execution platforms: host first (default for non-wasm actions), then the neutral
# wasm_tool_exec platform used by wasm_tool exec groups in wasm_tools.bzl / rust_wasm.bzl.
# @platforms//host:host must come first so Bazel 9 (which now auto-selects the first
# registered exec platform whose toolchains all match) picks the host for regular targets
# like //proto/pb:ts_gen rather than wasm_tool_exec (which has no Node.js/shell toolchains).
register_execution_platforms(
"@platforms//host:host",
"//bazel/platforms:wasm_tool_exec",
)
# Pull ubi9-minimal base image for //packages/hyper-docker.
# Pin the digest for reproducible builds; update with:
# crane digest registry.access.redhat.com/ubi9/ubi-minimal:9.7-1773939694
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "ubi9_minimal",
image = "registry.access.redhat.com/ubi9/ubi-minimal",
# renovate: depName=registry.access.redhat.com/ubi9/ubi-minimal
digest = "sha256:7d4e47500f28ac3a2bff06c25eff9127ff21048538ae03ce240d57cf756acd00",
platforms = ["linux/amd64"],
)
use_repo(oci, "ubi9_minimal", "ubi9_minimal_linux_amd64")
# tableauhyperapi wheel (hyperd binary + shared lib for //packages/hyper-docker).
tableauhyperapi = use_extension("//bazel:external_tableauhyperapi.bzl", "tableauhyperapi_ext")
use_repo(tableauhyperapi, "tableauhyperapi_wheel")
# 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",
commit = "7fe1eab26d2b8eeb5e1c6a2f38bddb001e3f9696",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)