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

"sanity" checks are not very #136759

Closed
workingjubilee opened this issue Feb 9, 2025 · 2 comments · Fixed by #136916
Closed

"sanity" checks are not very #136759

workingjubilee opened this issue Feb 9, 2025 · 2 comments · Fixed by #136916
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@workingjubilee
Copy link
Member

# config.toml
profile = "compiler"
change-id = 133068

[build]
target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
 RUST_BACKTRACE=1 ./x.py test
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.03s

thread 'main' panicked at src/bootstrap/src/core/sanity.rs:79:13:


couldn't find required command: "x86_64-linux-gnu-ar"


stack backtrace:
   0: rust_begin_unwind
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/std/src/panicking.rs:692:5
   1: core::panicking::panic_fmt
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/panicking.rs:75:14
   2: bootstrap::core::sanity::Finder::must_have::{{closure}}
             at ./src/bootstrap/src/core/sanity.rs:79:13
   3: core::option::Option<T>::unwrap_or_else
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/option.rs:1023:21
   4: bootstrap::core::sanity::Finder::must_have
             at ./src/bootstrap/src/core/sanity.rs:78:9
   5: bootstrap::core::sanity::check
             at ./src/bootstrap/src/core/sanity.rs:288:17
   6: bootstrap::Build::new
             at ./src/bootstrap/src/lib.rs:422:13
   7: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:97:5
   8: core::ops::function::FnOnce::call_once
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:00:00
$ RUST_BACKTRACE=1 ./x.py clean
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.03s

thread 'main' panicked at src/bootstrap/src/lib.rs:1178:25:
no entry found for key
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/std/src/panicking.rs:692:5
   1: core::panicking::panic_fmt
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_display
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/panicking.rs:261:5
   3: core::option::expect_failed
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/option.rs:2024:5
   4: core::option::Option<T>::expect
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/option.rs:933:21
   5: <std::collections::hash::map::HashMap<K,V,S> as core::ops::index::Index<&Q>>::index
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/std/src/collections/hash/map.rs:1428:23
   6: bootstrap::Build::cc
             at ./src/bootstrap/src/lib.rs:1178:25
   7: bootstrap::core::sanity::check
             at ./src/bootstrap/src/core/sanity.rs:286:34
   8: bootstrap::Build::new
             at ./src/bootstrap/src/lib.rs:422:13
   9: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:97:5
  10: core::ops::function::FnOnce::call_once
             at /rustc/e30eefff41038ceea427009023627d6d66b36715/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:00:00

Note that I am on an x86_64-unknown-linux-gnu host.

@workingjubilee workingjubilee added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 9, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 9, 2025
@saethlin
Copy link
Member

saethlin commented Feb 9, 2025

There are up to 4 problems here, and this issue should be clarified to explain which of the problems it is about

  1. Bootstrap shouldn't panic like this during x clean when a target tool is missing
  2. The target sanity checks should recognize when the target is the host and be okay with just using the host tools
  3. The target sanity checks don't know that the host tools on x86_64-unknown-linux-gnu can work on i686-unknown-linux-gnu (this is not illustrated above but if anyone starts fixing the errors above based on the reproducer, they'll see this immediately)
  4. "sanity checks" is rather icky as a name and it would be very cool to have a more clear name that implies what these checks are actually checking for

@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 9, 2025
@onur-ozkan
Copy link
Member

The target sanity checks should recognize when the target is the host and be okay with just using the host tools

It's unfortunate if this isn't the case already..

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 12, 2025
use cc archiver as default in `cc2ar`

We should remove entire `cc2ar` but `cc` doesn't seem to cover all the conditions that `cc2ar` handles. For now, I replaced the `else` logic only, which is a bit hacky and unstable.

Fixes rust-lang#136759
@bors bors closed this as completed in 8567fbb Feb 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 12, 2025
Rollup merge of rust-lang#136916 - onur-ozkan:fix-cc2ar, r=jieyouxu

use cc archiver as default in `cc2ar`

We should remove entire `cc2ar` but `cc` doesn't seem to cover all the conditions that `cc2ar` handles. For now, I replaced the `else` logic only, which is a bit hacky and unstable.

Fixes rust-lang#136759
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants