8facd237d5
- 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.
105 lines
2.6 KiB
Python
105 lines
2.6 KiB
Python
load("@crates//:defs.bzl", "aliases", "all_crate_deps")
|
|
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
|
|
load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
exports_files(["Cargo.toml"])
|
|
|
|
# build.rs concatenates src/minimizer/defs/*.toml into OUT_DIR/builtin_filters.toml,
|
|
# consumed via include_str!(concat!(env!("OUT_DIR"), ...)) in minimizer/engine.rs.
|
|
cargo_build_script(
|
|
name = "build_script",
|
|
srcs = ["build.rs"],
|
|
data = glob(["src/minimizer/defs/*.toml"]),
|
|
edition = "2024",
|
|
deps = all_crate_deps(build = True),
|
|
)
|
|
|
|
rust_library(
|
|
name = "pi-shell",
|
|
srcs = glob(["src/**/*.rs"]),
|
|
aliases = aliases(),
|
|
compile_data = glob([
|
|
"src/minimizer/filters/fixtures/**",
|
|
]),
|
|
crate_name = "pi_shell",
|
|
edition = "2024",
|
|
proc_macro_deps = all_crate_deps(proc_macro = True),
|
|
version = "17.1.5",
|
|
deps = all_crate_deps(normal = True) + [
|
|
":build_script",
|
|
"//crates/pi-uu-diff",
|
|
"//crates/pi-uu-grep",
|
|
"//crates/pi-uutils-ctx",
|
|
"//crates/pi-walker",
|
|
"//crates/vendor/brush-builtins",
|
|
"//crates/vendor/brush-core",
|
|
"//crates/vendor/jaq",
|
|
] + ["//crates/vendor/" + c for c in [
|
|
"uu-b2sum",
|
|
"uu-base32",
|
|
"uu-base64",
|
|
"uu-basename",
|
|
"uu-cat",
|
|
"uu-checksum-common",
|
|
"uu-comm",
|
|
"uu-cut",
|
|
"uu-date",
|
|
"uu-dirname",
|
|
"uu-find",
|
|
"uu-head",
|
|
"uu-hostname",
|
|
"uu-ln",
|
|
"uu-ls",
|
|
"uu-md5sum",
|
|
"uu-mkdir",
|
|
"uu-mktemp",
|
|
"uu-mv",
|
|
"uu-nproc",
|
|
"uu-paste",
|
|
"uu-printenv",
|
|
"uu-readlink",
|
|
"uu-realpath",
|
|
"uu-rm",
|
|
"uu-sed",
|
|
"uu-seq",
|
|
"uu-sha1sum",
|
|
"uu-sha224sum",
|
|
"uu-sha256sum",
|
|
"uu-sha384sum",
|
|
"uu-sha512sum",
|
|
"uu-sort",
|
|
"uu-stat",
|
|
"uu-tac",
|
|
"uu-tail",
|
|
"uu-tee",
|
|
"uu-touch",
|
|
"uu-tr",
|
|
"uu-truncate",
|
|
"uu-uname",
|
|
"uu-uniq",
|
|
"uu-wc",
|
|
"uu-whoami",
|
|
"uu-xargs",
|
|
"uu-yes",
|
|
]],
|
|
)
|
|
|
|
rust_test(
|
|
name = "pi-shell_test",
|
|
crate = ":pi-shell",
|
|
edition = "2024",
|
|
proc_macro_deps = all_crate_deps(proc_macro_dev = True),
|
|
deps = all_crate_deps(normal_dev = True),
|
|
)
|
|
|
|
rust_test(
|
|
name = "minimizer_fixtures_test",
|
|
srcs = ["tests/minimizer_fixtures.rs"],
|
|
data = glob(["tests/fixtures/minimizer/**"]),
|
|
edition = "2024",
|
|
proc_macro_deps = all_crate_deps(proc_macro_dev = True),
|
|
deps = all_crate_deps(normal_dev = True) + [":pi-shell"],
|
|
)
|