Skip to content
New issue

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

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

Already on GitHub? # to your account

Some bootstrap tests fail with custom rustc #105766

Closed
cuviper opened this issue Dec 16, 2022 · 2 comments · Fixed by #126476
Closed

Some bootstrap tests fail with custom rustc #105766

cuviper opened this issue Dec 16, 2022 · 2 comments · Fixed by #126476
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@cuviper
Copy link
Member

cuviper commented Dec 16, 2022

Command

I tried this with Rust 1.66.0, simplified from my build for Fedora:

$ ./configure --local-rust-root=/usr
$ ./x test bootstrap

I expected to see this happen: passing tests

Instead, this happened: 20 builder::tests::... failures, all of this sort:

---- builder::tests::alias_and_path_for_library stdout ----
failed to execute command: "/builddir/build/BUILD/rustc-1.66.0-src/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "--target" "x86_64-unknown-linux-gnu" "--print" "target-libdir"
error: No such file or directory (os error 2)
thread 'main' panicked at 'status code: 1', lib.rs:1654:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

My stage0 should be using /usr/bin/rustc.

Version it worked on

It most recently worked on: Rust 1.65.0

Version with regression

rustc-1.66.0-src/version:

1.66.0 (69f9c33d7 2022-12-12)

I bisected this to #98483, commit 55c040e, which stopped using CARGO and RUSTC environment variables when building a Config.

Backtrace

Backtrace

thread 'main' panicked at 'status code: 1', lib.rs:1654:9
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: bootstrap::detail_exit
             at ./lib.rs:1654:9
   3: bootstrap::util::fail
             at ./util.rs:475:5
   4: bootstrap::util::output
             at ./util.rs:425:19
   5: bootstrap::Build::new
             at ./lib.rs:436:13
   6: bootstrap::builder::tests::configure_with_args
             at ./builder/tests.rs:18:27
   7: bootstrap::builder::tests::configure
             at ./builder/tests.rs:6:5
   8: bootstrap::builder::tests::alias_and_path_for_library
             at ./builder/tests.rs:142:55
   9: bootstrap::builder::tests::alias_and_path_for_library::{{closure}}
             at ./builder/tests.rs:140:1
  10: core::ops::function::FnOnce::call_once
             at /builddir/build/BUILD/rustc-1.65.0-src/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged +A-bootstrap

@cuviper cuviper added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Dec 16, 2022
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-untriaged Untriaged performance or correctness regression. labels Dec 16, 2022
@apiraino apiraino added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Dec 22, 2022
@KittyBorgX
Copy link
Member

@rustbot claim

@KittyBorgX KittyBorgX removed their assignment Mar 24, 2023
@nc7s
Copy link

nc7s commented Apr 11, 2023

FYI we had the same problem on Debian, worked around with a custom patch: https://salsa.debian.org/rust-team/rust/-/merge_requests/24/diffs?commit_id=f249e1b3f6a71bdf040e98214ea360f4955b0a09

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label May 16, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 8, 2024
…stc, r=<try>

Fix running bootstrap tests with a local Rust toolchain as the stage0

When configuring a local Rust toolchain as the stage0 (with `build.rustc` and `build.cargo` in `config.toml`) we noticed there were test failures (both on the Python and the Rust side) due to bootstrap not being able to find rustc and Cargo.

This was due to those two `config.toml` settings not being propagated in the tests. This PR fixes the issue by ensuring rustc and cargo are always configured in tests, using the parent bootstrap's `initial_rustc` and `initial_cargo`.

try-job: x86_64-msvc
Fixes rust-lang#105766
@bors bors closed this as completed in d17e0cf Jul 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 10, 2024
Rollup merge of rust-lang#126476 - ferrocene:pa-bootstrap-test-local-rustc, r=onur-ozkan

Fix running bootstrap tests with a local Rust toolchain as the stage0

When configuring a local Rust toolchain as the stage0 (with `build.rustc` and `build.cargo` in `config.toml`) we noticed there were test failures (both on the Python and the Rust side) due to bootstrap not being able to find rustc and Cargo.

This was due to those two `config.toml` settings not being propagated in the tests. This PR fixes the issue by ensuring rustc and cargo are always configured in tests, using the parent bootstrap's `initial_rustc` and `initial_cargo`.

try-job: x86_64-msvc
Fixes rust-lang#105766
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants