Only the toolchains this repo uses, copied from the prelude's system_demo_toolchains and configured, as that macro's docstring asks.
3load("@prelude//tests:test_toolchain.bzl", "noop_test_toolchain") 4load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain") 5load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain") 6load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain", "system_python_toolchain") 7load("@prelude//toolchains:remote_test_execution.bzl", "remote_test_execution_toolchain") 8load("@prelude//toolchains:rust.bzl", "system_rust_toolchain") 9load("@prelude//toolchains:zip_file.bzl", "zip_file_toolchain") 10load("@root//build:defs.bzl", "RUST_EDITION")
Tool paths come from .buckconfig.local [toolchain] (tools/configure.sh writes it).
The machine's python (mise installs one), not the prelude's downloaded cpython archive.
The prelude's system toolchain invokes the bare name rustc, so the action
key never records WHICH rustc compiled a crate. With the shared BuildBuddy
cache, a library built by another repo's older rustc is served back and fails
with E0514 "compiled by an incompatible version of rustc" (hit in ~/aifleet,
2026-09-30). tools/configure.sh writes the compiler's identity to .buckconfig.local;
passing it as an inert --cfg makes it part of every compile's key, so
different compilers never share cache entries. No code reads the cfg.
read_root_config, not read_config: this file is in the toolchains cell,
whose own config never sees the root's .buckconfig.local. A missing value
fails the build rather than falling back to a shared placeholder, which
would silently reintroduce the collision.
Build scripts read OPT_LEVEL, and the prelude derives it only from an explicit -Copt-level here; cc-rs (ring) fails without it.
59system_rust_toolchain( 60 name = "rust", 61 default_edition = RUST_EDITION, 62 rustc_flags = [ 63 "-Copt-level=3", 64 "-Cdebuginfo=line-tables-only", 65 # Dev and test builds keep debug assertions: the executor's 66 # backend-thread and one-waker-per-fd checks are debug_asserts. 67 # Release packaging (nix, contract §3) builds without them. 68 "-Cdebug-assertions=on", 69 ] + _RUSTC_IDENTITY_FLAGS, 70 visibility = ["PUBLIC"], 71)