From c905fd285a4bbec0c1fdbb823c1825ca0493ab66 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 30 Oct 2022 10:28:46 +0100 Subject: [PATCH 1/2] skip bootstrap target sanity checks when testing Miri --- src/bootstrap/sanity.rs | 10 ++++++++++ .../docker/host-x86_64/x86_64-gnu-tools/checktools.sh | 11 ++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index e905517253c0a..9890480709bd7 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -155,6 +155,11 @@ than building it. continue; } + // Some environments don't want or need these tools, such as when testing Miri. + if env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some() { + continue; + } + if !build.config.dry_run { cmd_finder.must_have(build.cc(*target)); if let Some(ar) = build.ar(*target) { @@ -212,6 +217,11 @@ than building it. } } + // Some environments don't want or need these tools, such as when testing Miri. + 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 diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh index d87384556106d..7dde6370904bb 100755 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh @@ -27,10 +27,7 @@ python3 "$X_PY" test --stage 2 src/tools/rustfmt python3 "$X_PY" test --stage 2 src/tools/miri # We natively run this script on x86_64-unknown-linux-gnu and x86_64-pc-windows-msvc. # Also cover some other targets (on both of these hosts) via cross-testing. -# -# Currently disabled -- we end up pulling in a cross-compile of LLVM (maybe -# just overly eager sanity checks), but in any case this won't work when -# building LLVM as of this comment. -#python3 "$X_PY" test --stage 2 src/tools/miri --target i686-pc-windows-msvc -#FIXME(https://github.com/rust-lang/rust/issues/103519): macOS testing is currently disabled -# python3 "$X_PY" test --stage 2 src/tools/miri --target aarch64-apple-darwin +export BOOTSTRAP_SKIP_TARGET_SANITY=1 # we don't need `cc` for these targets +python3 "$X_PY" test --stage 2 src/tools/miri --target i686-pc-windows-msvc +python3 "$X_PY" test --stage 2 src/tools/miri --target aarch64-apple-darwin +unset BOOTSTRAP_SKIP_TARGET_SANITY From 397e5bb8c84acb58c7f3bf21be5a85e6f615af1a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 7 Nov 2022 09:14:49 +0100 Subject: [PATCH 2/2] add FIXME to replace this env var in the future --- src/bootstrap/sanity.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 9890480709bd7..bdfd5fe5c421c 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -156,6 +156,9 @@ 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; } @@ -218,6 +221,9 @@ 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; }