From 888948e5229d094021b2329347098bf376141921 Mon Sep 17 00:00:00 2001 From: jif Date: Fri, 25 Sep 2026 19:56:22 +0000 Subject: [PATCH] Optimize `blake3` in Bazel fastbuilds (#48197) Daemon tests repeatedly hash large CLI binaries, even in `fastbuild` mode. Set `blake3`'s build-script `OPT_LEVEL` to `3` and Rust compiler flag to `-Copt-level=3` so both the native backends and Rust implementation are optimized. GitOrigin-RevId: ebf9b96255e68ba775443077ebf3fd897282795d --- MODULE.bazel | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index d12eb69fa7..001bb19ff7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -351,11 +351,15 @@ crate.from_cargo( bazel_dep(name = "zstd", version = "1.5.7") crate.annotation( + # Daemon tests repeatedly hash large CLI binaries, even in fastbuild mode. + # Optimize the native backends as well as the Rust implementation. + build_script_env = {"OPT_LEVEL": "3"}, # The Windows lint toolchain cannot reliably materialize blake3's native x86 assembly archives. crate = "blake3", crate_features_select = { "x86_64-pc-windows-gnullvm": ["pure"], }, + rustc_flags = ["-Copt-level=3"], ) crate.annotation( crate = "zstd-sys",