Skip to content

rust 1.89.0 fails to bootstrap on x86_64 #145635

Description

@sergiodj

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 #141729 and tested by reverting the commit, but that doesn't work either (I see another error).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions