rust-lang / rust-lang/rust

rust 1.89.0 fails to bootstrap on x86_64

Open
#145,635 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Hi,

This is a spinoff of #145587 . I'm encountering the same error as described there, but the difference is that I'm not doing a cross compilation.

This is the error I'm getting:

...
2025/08/19 21:50:06 WARN    Compiling build_helper v0.1.0 (/home/build/rustc-1.89.0-src/src/build_helper)
2025/08/19 21:50:22 WARN     Finished `dev` profile [unoptimized] target(s) in 24.30s
2025/08/19 21:50:23 INFO WARNING: The `change-id` is missing in the `bootstrap.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
2025/08/19 21:50:23 INFO NOTE: to silence this warning, add `change-id = 142379` or `change-id = "ignore"` at the top of `bootstrap.toml`
2025/08/19 21:50:23 INFO Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
2025/08/19 21:50:24 WARN    Compiling proc-macro2 v1.0.95
2025/08/19 21:50:24 WARN    Compiling unicode-ident v1.0.18
2025/08/19 21:50:24 WARN    Compiling cfg-if v1.0.1
2025/08/19 21:50:24 WARN    Compiling libc v0.2.174
2025/08/19 21:50:24 WARN    Compiling memchr v2.7.5
2025/08/19 21:50:24 WARN    Compiling shlex v1.3.0
2025/08/19 21:50:24 WARN    Compiling stable_deref_trait v1.2.0
2025/08/19 21:50:24 WARN    Compiling smallvec v1.15.1
2025/08/19 21:50:24 WARN    Compiling bitflags v2.9.1
2025/08/19 21:50:24 WARN    Compiling foldhash v0.1.5
2025/08/19 21:50:24 WARN    Compiling once_cell v1.21.3
2025/08/19 21:50:24 WARN    Compiling equivalent v1.0.2
2025/08/19 21:50:24 WARN    Compiling allocator-api2 v0.2.21
2025/08/19 21:50:24 WARN    Compiling getrandom v0.3.3
2025/08/19 21:50:24 WARN    Compiling autocfg v1.4.0
2025/08/19 21:50:24 WARN    Compiling parking_lot_core v0.9.11
2025/08/19 21:50:24 WARN error[E0463]: can't find crate for `core`
2025/08/19 21:50:24 WARN   |
2025/08/19 21:50:24 WARN   = note: the `x86_64-unknown-linux-gnu` target may not be installed
2025/08/19 21:50:24 WARN   = help: consider downloading the target with `rustup target add x86_64-unknown-linux-gnu`
2025/08/19 21:50:24 WARN   = help: consider building the standard library from source with `cargo build -Zbuild-std`
2025/08/19 21:50:24 WARN
2025/08/19 21:50:24 WARN For more information about this error, try `rustc --explain E0463`.
2025/08/19 21:50:24 WARN error[E0463]: can't find crate for `std`
2025/08/19 21:50:24 WARN   |
2025/08/19 21:50:24 WARN   = note: the `x86_64-unknown-linux-gnu` target may not be installed
2025/08/19 21:50:24 WARN   = help: consider downloading the target with `rustup target add x86_64-unknown-linux-gnu`
2025/08/19 21:50:24 WARN   = help: consider building the standard library from source with `cargo build -Zbuild-std`
2025/08/19 21:50:24 WARN
2025/08/19 21:50:24 WARN error: could not compile `cfg-if` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN warning: build failed, waiting for other jobs to finish...
2025/08/19 21:50:24 WARN error: could not compile `stable_deref_trait` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `smallvec` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `foldhash` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `bitflags` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `memchr` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `equivalent` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `once_cell` (lib) due to 1 previous error
2025/08/19 21:50:24 WARN error: could not compile `allocator-api2` (lib) due to 1 previous error
2025/08/19 21:50:25 WARN Build completed unsuccessfully in 0:00:26

Basically, we're bootstrapping rust 1.89.0 (using our own packaged rust 1.88.0). Our rust 1.89 package definition can be found here:

https://github.com/wolfi-dev/os/pull/62378/files

but I'm pasting below the full sequence of commands we're using:

# wget https://static.rust-lang.org/dist/rustc-1.88.0-src.tar.xz
# tar -xJf rustc-1.88.0-src.tar.xz
# export CFLAGS="$CFLAGS -O2 -I/usr/lib/llvm-20/include"
# export CXXFLAGS="$CXXFLAGS -O2 -I/usr/lib/llvm-20/include"
# export OPENSSL_NO_VENDOR=1
# export RUST_BACKTRACE=full
# export ARCH="x86_64-unknown-linux-gnu"
# cd rustc-1.88.0-src
# cat > config.toml << EOF
[rust]
deny-warnings = false
EOF
# ./configure \
        --host="${ARCH}" \
        --target="${ARCH}" \
        --prefix="/usr" \
        --release-channel="stable" \
        --enable-local-rust \
        --local-rust-root="/usr" \
        --llvm-root="/usr/lib/llvm-20" \
        --llvm-config="/usr/lib/llvm-20/bin/llvm-config" \
        --disable-docs \
        --enable-extended \
        --tools="cargo,src,clippy,rustfmt,rustdoc" \
        --enable-llvm-link-shared \
        --enable-option-checking \
        --enable-locked-deps \
        --enable-profiler \
        --enable-vendor \
        --dist-compression-formats=gz \
        --python="python3" \
        --set="rust.musl-root=/usr" \
        --set="rust.codegen-units=1" \
        --set="rust.codegen-units-std=1" \
        --set="target.${ARCH}.musl-root=/usr" \
        --set="target.${ARCH}.crt-static=false" \
        --set="target.${ARCH}.musl-root=/usr" \
        --set="target.${ARCH}.crt-static=false"
# sed -i '/^\[rust\]$/a lld=false' bootstrap.toml
# sed 's|deny(warnings,|deny(|' -i src/bootstrap/src/lib.rs
# export RUSTC_BOOTSTRAP=1
# DESTDIR="/something" python3 ./x.py install --jobs $(nproc)

Here's the rustc version I'm using to bootstrap:

# rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23) (built from a source tarball)

As I said, this is not a cross compilation; I'm bootstrapping the package in a x86_64 machine.

Initially I thought this could be related to https://github.com/rust-lang/rust/pull/141729 and tested by reverting the commit, but that doesn't work either (I see another error).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the bootstrap.toml and config.toml settings, then review src/bootstrap/src/lib.rs and the provided python3 ./x.py install command. Reproduce the x86_64-unknown-linux-gnu bootstrap using the listed Rust 1.88.0 setup and inspect the missing core/std errors. Done means identifying why the target is unavailable during the stage0-to-stage1 build and defining a verified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.