Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo run -p bootstrap -- test tidy fails because it can't find the sysroot #94797

Closed
jyn514 opened this issue Mar 10, 2022 · 0 comments · Fixed by #94806
Closed

cargo run -p bootstrap -- test tidy fails because it can't find the sysroot #94797

jyn514 opened this issue Mar 10, 2022 · 0 comments · Fixed by #94806
Labels
C-bug Category: This is a bug.

Comments

@jyn514
Copy link
Member

jyn514 commented Mar 10, 2022

I tried this:

cargo run -p bootstrap -- test tidy

I expected to see this happen: Tidy runs fine, just as if I'd run x test tidy.

Instead, this happened:

Building stage0 tool tidy (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu))
   Compiling itoa v0.4.6
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.25
   Compiling same-file v1.0.6
   Compiling cfg-if v1.0.0
   Compiling memchr v2.4.1
   Compiling ryu v1.0.5
   Compiling serde v1.0.125
error[E0463]: can't find crate for `core`

error[E0463]: can't find crate for `compiler_builtins`

error[E0463]: can't find crate for `core`
 --> /home/jnelson/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:8:1
  |
8 | extern crate core;
  | ^^^^^^^^^^^^^^^^^^ can't find crate

error[E0463]: can't find crate for `std`
 --> /home/jnelson/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:9:1
  |
9 | extern crate std;
  | ^^^^^^^^^^^^^^^^^ can't find crate

The problem is that src/bootstrap/build.rs is setting RUSTC to ~/.cargo/bin/rustc, not ~/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/rustc, which breaks because rustbuild then can't find the appropriate sysroot.

cc #92260

@rustbot label: +A-bootstrap

@jyn514 jyn514 added the C-bug Category: This is a bug. label Mar 10, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 30, 2022
…acrum

Fix `cargo run tidy`

When I implemented rust-only bootstrapping in rust-lang#92260,
I neglected to test stage0 tools - it turns out they were broken because
they couldn't find the sysroot of the initial bootstrap compiler.

This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a
sysroot and hard-coding the relative directory.

Fixes rust-lang#94797 (properly, without having to change rustup).
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 30, 2022
…acrum

Fix `cargo run tidy`

When I implemented rust-only bootstrapping in rust-lang#92260,
I neglected to test stage0 tools - it turns out they were broken because
they couldn't find the sysroot of the initial bootstrap compiler.

This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a
sysroot and hard-coding the relative directory.

Fixes rust-lang#94797 (properly, without having to change rustup).
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 30, 2022
…acrum

Fix `cargo run tidy`

When I implemented rust-only bootstrapping in rust-lang#92260,
I neglected to test stage0 tools - it turns out they were broken because
they couldn't find the sysroot of the initial bootstrap compiler.

This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a
sysroot and hard-coding the relative directory.

Fixes rust-lang#94797 (properly, without having to change rustup).
@bors bors closed this as completed in 943ea7f Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant