Files
can1357 8facd237d5 feat(build): migrated native pipeline to bazel with remote caching
- Replaced the napi-cli/cargo-zigbuild/cargo-xwin/sccache build path with
  Bazel: rules_rust + crate_universe over Cargo.lock, hermetic zig cc
  toolchains (linux-gnu pinned to glibc 2.17, linux-musl), host Xcode for
  darwin, and a repo-local hermetic clang-cl + llvm-ml + xwin toolchain for
  windows-msvc (bazel/toolchains/msvc).
- All eight shipped addons build as //:natives-<target> via the release
  transition in bazel/defs.bzl (opt, thin LTO, cgu=16, stripped, canonical
  .node naming); scripts/bazel-natives.ts is the single driver for local
  dev and CI.
- Rust validation moved to bazel test + clippy aspects (strict workspace
  policy for opted-in crates, default lints elsewhere, mirroring cargo
  semantics) and the rustfmt aspect; cargo stays as the dev-iteration
  surface, with brush-core/brush-builtins promoted to workspace members
  and excluded from cargo dev tasks to keep their historical scope.
- CI caches through an in-cluster bazel-remote action cache (TLS + basic
  auth, cluster-internal only); GitHub-hosted runners never touch the
  infrastructure and use an actions/cache-backed disk cache instead.
- Deleted the hand-rolled caching machinery: ci-target-cache,
  ci-native-artifact-cache, ci-build-native, native-source-hash,
  find-native-artifacts, restore-linux-native, native-prewarm workflow,
  ensure-* toolchain actions, and all sccache/Swatinem wiring.
- Warm native rebuilds drop from ~20 minutes to seconds; a cold client
  with a warm remote cache rebuilds the linux x64 pair in ~2.5 minutes.
2026-07-27 12:22:19 +02:00

100 lines
2.4 KiB
Python

# Rust target-triple config_settings for crate_universe's rendered selects
# (MODULE.bazel sets platforms_template = "@@//bazel/triples:{triple}").
#
# rules_rust's builtin @rules_rust//rust/platform settings can't express musl:
# gnu and musl triples share (os, cpu), so the libc axis rides on
# @zig_sdk//libc. The gnu settings match both the zig gnu.2.17 platforms and
# libc-unconstrained platforms (host builds, GH runners); musl requires the
# explicit constraint carried by //bazel/platforms:linux-musl-*.
load("@bazel_skylib//lib:selects.bzl", "selects")
package(default_visibility = ["//visibility:public"])
_LINUX_CPUS = {
"x86_64": "x86_64",
"aarch64": "aarch64",
}
[
config_setting(
name = "_linux-{}-libc-default".format(cpu),
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:" + cv,
"@zig_sdk//libc:unconstrained",
],
)
for cpu, cv in _LINUX_CPUS.items()
]
[
config_setting(
name = "_linux-{}-libc-gnu217".format(cpu),
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:" + cv,
"@zig_sdk//libc:gnu.2.17",
],
)
for cpu, cv in _LINUX_CPUS.items()
]
selects.config_setting_group(
name = "x86_64-unknown-linux-gnu",
match_any = [
":_linux-x86_64-libc-default",
":_linux-x86_64-libc-gnu217",
],
)
selects.config_setting_group(
name = "aarch64-unknown-linux-gnu",
match_any = [
":_linux-aarch64-libc-default",
":_linux-aarch64-libc-gnu217",
],
)
config_setting(
name = "x86_64-unknown-linux-musl",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@zig_sdk//libc:musl",
],
)
config_setting(
name = "aarch64-unknown-linux-musl",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
"@zig_sdk//libc:musl",
],
)
config_setting(
name = "x86_64-apple-darwin",
constraint_values = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "aarch64-apple-darwin",
constraint_values = [
"@platforms//os:macos",
"@platforms//cpu:arm64",
],
)
config_setting(
name = "x86_64-pc-windows-msvc",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)