./x.py dist cargo rustc rust-std doesn't build std before cargo #139993
Labels
C-bug
Category: This is a bug.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Summary
When using
x.py dist
with a list of paths, the order of the paths matters. In particular, ifcargo
is listed beforerust-std
, the build failsCommand used
Expected behaviour
The tarballs for
cargo
,rustc
andrust-std
are createdActual behaviour
The build fails. See
build-log.txt
belowBootstrap configuration (bootstrap.toml)
Operating system
macOS 15.4 arm64
HEAD
a594829
Additional context
Starting from a clean clone, but using
./x.py dist rustc rust-std cargo
results in a successful build.Here's the full log of a failed run:
Output of
RUST_BACKTRACE=1 ./x dist -v cargo rustc rust-std > build-log.txt 2>&1
, attached:build-log.txt
Here's a summary of what's in the build-log
and here's just the part where things go wrong
Build log excerpts
Additionally, I tried instrumenting this line:
rust/src/bootstrap/src/core/build_steps/dist.rs
Lines 1166 to 1173 in a594829
Like this:
And I see this output
Which I think interacts poorly with this code:
rust/src/bootstrap/src/core/build_steps/tool.rs
Lines 123 to 129 in a594829
I don't think this is macOS specific - at work we're building across a number of platforms and they all fail at building
cargo
for stage 2 (Those builds have a more elaboratebootstrap.toml
and with more components:./x.py dist cargo rustfmt rust-src rustc-src rustc rust-std rust-analysis rustc-dev llvm-tools clippy
but they all havecargo
first in the list). Unfortunately we just started setting up our infrastructure to build thebeta
branch so I can't pinpoint when things went wrong.stable
(1.86.0) builds as expected in our environment.The text was updated successfully, but these errors were encountered: