From 9cae47ee87ba438119409dd6d7556c5095b01de3 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 2 Sep 2023 10:23:03 +0200 Subject: [PATCH] also skip musl checks when BOOTSTRAP_SKIP_TARGET_SANITY is set --- src/bootstrap/sanity.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 7e83b508e94c1..144e2acd09e89 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -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 @@ -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 // . - if env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some() { + if skip_target_sanity { continue; } @@ -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 + // . + 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 @@ -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 - // . - 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