Skip to content

"sanity" checks are not very #136759

Closed

Description

@workingjubilee
# 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.

Activity

  1. added
    C-bugCategory: This is a bug.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Feb 9, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 9, 2025
  3. saethlin commented on Feb 9, 2025

    @saethlin
    Member

    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
  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 9, 2025
  5. onur-ozkan commented on Feb 9, 2025

    @onur-ozkan
    Contributor

    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..

  6. added 2 commits that reference this issue on Feb 12, 2025
    9fe4c6a
    8567fbb
  7. added a commit that references this issue on Feb 12, 2025
    3547177
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