Skip to content

Zig CC toolchain#386

Draft
agentydragon wants to merge 1 commit intodevelfrom
claude/profile-bazel-build-TcoGy
Draft

Zig CC toolchain#386
agentydragon wants to merge 1 commit intodevelfrom
claude/profile-bazel-build-TcoGy

Conversation

@agentydragon
Copy link
Copy Markdown
Owner

toolchains_llvm eagerly downloads ~8.2 GB of LLVM on first build (838s), even for targets that don't need a CC toolchain. Uber's hermetic_cc_toolchain uses Zig as the CC backend (~301 MB, ~40s fetch) — a 10x speedup on cold builds (919s → 93s for //tools/format:format).

Both toolchains provide hermetic C/C++ compilation, preventing Nix store paths from leaking into RBE actions.

Known: Go CGo tree-sitter (Gazelle dep) has a link error with Zig's stricter symbol resolution. Only affects //tools:gazelle_python_manifest.test which passes from cache. Rust targets blocked by unrelated cargo-bazel network timeout in sandbox, not by the toolchain change.

https://claude.ai/code/session_01V9orqRt5ug5iz2jYg6V6Fg

@agentydragon agentydragon force-pushed the claude/profile-bazel-build-TcoGy branch 2 times, most recently from 03a13bd to d977701 Compare February 2, 2026 22:23
toolchains_llvm eagerly downloads ~8.2 GB of LLVM on first build (838s),
even for targets that don't need a CC toolchain. Uber's hermetic_cc_toolchain
uses Zig as the CC backend (~301 MB, ~40s fetch) — a 10x speedup on cold
builds (919s → 93s for //tools/format:format).

Both toolchains provide hermetic C/C++ compilation, preventing Nix store
paths from leaking into RBE actions.

Known: Go CGo tree-sitter (Gazelle dep) has a link error with Zig's
stricter symbol resolution. Only affects bazel run //tools:gazelle (BUILD
file regeneration), not the manifest integrity test or normal builds.

Also adds TODO for pinning Cargo.Bazel.lock (cargo-bazel splice timeout
is a separate proxy issue in gVisor sandbox) and a migration writeup in
docs/hermetic-cc-toolchain-migration.md.

https://claude.ai/code/session_01V9orqRt5ug5iz2jYg6V6Fg
@agentydragon agentydragon force-pushed the claude/profile-bazel-build-TcoGy branch from d977701 to a97498a Compare February 3, 2026 01:28
@agentydragon agentydragon changed the title Replace toolchains_llvm with hermetic_cc_toolchain (Zig) Zig CC toolchain Feb 7, 2026
@agentydragon agentydragon force-pushed the devel branch 3 times, most recently from cb3df7d to 2a0568e Compare February 20, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants