Skip to content

Commit

Permalink
Auto merge of #115471 - RalfJung:skipping-sanity, r=onur-ozkan
Browse files Browse the repository at this point in the history
also skip musl checks when BOOTSTRAP_SKIP_TARGET_SANITY is set

Currently I cannot test musl targets in Miri via x.py; this PR fixes that.
  • Loading branch information
bors committed Sep 2, 2023
2 parents c4f2577 + 9cae47e commit 9f5fc1b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ impl Finder {
}

pub fn check(build: &mut Build) {
let skip_target_sanity =
env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some_and(|s| s == "1" || s == "true");

let path = env::var_os("PATH").unwrap_or_default();
// On Windows, quotes are invalid characters for filename paths, and if
// one is present as part of the PATH then that can lead to the system
Expand Down Expand Up @@ -166,7 +169,7 @@ than building it.
// FIXME: it would be better to refactor this code to split necessary setup from pure sanity
// checks, and have a regular flag for skipping the latter. Also see
// <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
if env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some() {
if skip_target_sanity {
continue;
}

Expand Down Expand Up @@ -205,7 +208,15 @@ than building it.
}
}

// Make sure musl-root is valid
// Some environments don't want or need these tools, such as when testing Miri.
// FIXME: it would be better to refactor this code to split necessary setup from pure sanity
// checks, and have a regular flag for skipping the latter. Also see
// <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
if skip_target_sanity {
continue;
}

// Make sure musl-root is valid.
if target.contains("musl") && !target.contains("unikraft") {
// If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up
Expand All @@ -227,14 +238,6 @@ than building it.
}
}

// Some environments don't want or need these tools, such as when testing Miri.
// FIXME: it would be better to refactor this code to split necessary setup from pure sanity
// checks, and have a regular flag for skipping the latter. Also see
// <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
if env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some() {
continue;
}

if need_cmake && target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual
Expand Down

0 comments on commit 9f5fc1b

Please sign in to comment.