From 1b5143ae13c50aeb3d8a84d838e4db54a57e8a5b Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 6 Jun 2023 11:55:02 +0200 Subject: stop using a macro for the mir-opt test suite --- src/bootstrap/test.rs | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index f31ba946099..699b7f0be85 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1261,8 +1261,6 @@ default_test!(RunPassValgrind { suite: "run-pass-valgrind" }); -default_test!(MirOpt { path: "tests/mir-opt", mode: "mir-opt", suite: "mir-opt" }); - default_test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen" }); default_test!(CodegenUnits { @@ -1299,6 +1297,39 @@ host_test!(RunMakeFullDeps { default_test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly" }); +// For the mir-opt suite we do not use macros, as we need custom behavior when blessing. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct MirOpt { + pub compiler: Compiler, + pub target: TargetSelection, +} + +impl Step for MirOpt { + type Output = (); + const DEFAULT: bool = true; + const ONLY_HOSTS: bool = false; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.suite_path("tests/mir-opt") + } + + fn make_run(run: RunConfig<'_>) { + let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple()); + run.builder.ensure(MirOpt { compiler, target: run.target }); + } + + fn run(self, builder: &Builder<'_>) { + builder.ensure(Compiletest { + compiler: self.compiler, + target: self.target, + mode: "mir-opt", + suite: "mir-opt", + path: "tests/mir-opt", + compare_mode: None, + }); + } +} + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] struct Compiletest { compiler: Compiler, -- cgit 1.4.1-3-g733a5 From 68d458bb402b873b9ae80423710c2672967479df Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 6 Jun 2023 12:37:54 +0200 Subject: allow mutating the c compilers detected by bootstrap This will be needed to create synthetic targets in future commits. --- src/bootstrap/builder.rs | 2 +- src/bootstrap/cc_detect.rs | 10 +++++----- src/bootstrap/compile.rs | 11 ++++++++--- src/bootstrap/lib.rs | 48 +++++++++++++++++++++++----------------------- src/bootstrap/llvm.rs | 12 ++++++------ src/bootstrap/test.rs | 2 +- src/bootstrap/tool.rs | 2 +- 7 files changed, 46 insertions(+), 41 deletions(-) (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 51d94c48f7f..fb0d1811f2d 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1650,7 +1650,7 @@ impl<'a> Builder<'a> { } }; cargo.env(profile_var("DEBUG"), debuginfo_level.to_string()); - if self.cc[&target].args().iter().any(|arg| arg == "-gz") { + if self.cc.borrow()[&target].args().iter().any(|arg| arg == "-gz") { rustflags.arg("-Clink-arg=-gz"); } cargo.env( diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs index db3b69d18c8..ec06e75ac4a 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -89,7 +89,7 @@ fn new_cc_build(build: &Build, target: TargetSelection) -> cc::Build { cfg } -pub fn find(build: &mut Build) { +pub fn find(build: &Build) { // For all targets we're going to need a C compiler for building some shims // and such as well as for being a linker for Rust code. let targets = build @@ -115,7 +115,7 @@ pub fn find(build: &mut Build) { cc2ar(compiler.path(), target) }; - build.cc.insert(target, compiler.clone()); + build.cc.borrow_mut().insert(target, compiler.clone()); let cflags = build.cflags(target, GitRepo::Rustc, CLang::C); // If we use llvm-libunwind, we will need a C++ compiler as well for all targets @@ -136,7 +136,7 @@ pub fn find(build: &mut Build) { // for VxWorks, record CXX compiler which will be used in lib.rs:linker() if cxx_configured || target.contains("vxworks") { let compiler = cfg.get_compiler(); - build.cxx.insert(target, compiler); + build.cxx.borrow_mut().insert(target, compiler); } build.verbose(&format!("CC_{} = {:?}", &target.triple, build.cc(target))); @@ -148,11 +148,11 @@ pub fn find(build: &mut Build) { } if let Some(ar) = ar { build.verbose(&format!("AR_{} = {:?}", &target.triple, ar)); - build.ar.insert(target, ar); + build.ar.borrow_mut().insert(target, ar); } if let Some(ranlib) = config.and_then(|c| c.ranlib.clone()) { - build.ranlib.insert(target, ranlib); + build.ranlib.borrow_mut().insert(target, ranlib); } } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index c28fe9022ec..12ca6c79b34 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -314,7 +314,7 @@ fn copy_self_contained_objects( } } else if target.ends_with("windows-gnu") { for obj in ["crt2.o", "dllcrt2.o"].iter() { - let src = compiler_file(builder, builder.cc(target), target, CLang::C, obj); + let src = compiler_file(builder, &builder.cc(target), target, CLang::C, obj); let target = libdir_self_contained.join(obj); builder.copy(&src, &target); target_deps.push((target, DependencyType::TargetSelfContained)); @@ -995,8 +995,13 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect && !target.contains("apple") && !target.contains("solaris") { - let file = - compiler_file(builder, builder.cxx(target).unwrap(), target, CLang::Cxx, "libstdc++.a"); + let file = compiler_file( + builder, + &builder.cxx(target).unwrap(), + target, + CLang::Cxx, + "libstdc++.a", + ); cargo.env("LLVM_STATIC_STDCPP", file); } if builder.llvm_link_shared() { diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 7a16189926b..b0026aedca1 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -226,10 +226,10 @@ pub struct Build { // Runtime state filled in later on // C/C++ compilers and archiver for all targets - cc: HashMap, - cxx: HashMap, - ar: HashMap, - ranlib: HashMap, + cc: RefCell>, + cxx: RefCell>, + ar: RefCell>, + ranlib: RefCell>, // Miscellaneous // allow bidirectional lookups: both name -> path and path -> name crates: HashMap, Crate>, @@ -451,10 +451,10 @@ impl Build { miri_info, rustfmt_info, in_tree_llvm_info, - cc: HashMap::new(), - cxx: HashMap::new(), - ar: HashMap::new(), - ranlib: HashMap::new(), + cc: RefCell::new(HashMap::new()), + cxx: RefCell::new(HashMap::new()), + ar: RefCell::new(HashMap::new()), + ranlib: RefCell::new(HashMap::new()), crates: HashMap::new(), crate_paths: HashMap::new(), is_sudo, @@ -482,7 +482,7 @@ impl Build { } build.verbose("finding compilers"); - cc_detect::find(&mut build); + cc_detect::find(&build); // When running `setup`, the profile is about to change, so any requirements we have now may // be different on the next invocation. Don't check for them until the next time x.py is // run. This is ok because `setup` never runs any build commands, so it won't fail if commands are missing. @@ -1103,16 +1103,16 @@ impl Build { } /// Returns the path to the C compiler for the target specified. - fn cc(&self, target: TargetSelection) -> &Path { - self.cc[&target].path() + fn cc(&self, target: TargetSelection) -> PathBuf { + self.cc.borrow()[&target].path().into() } /// Returns a list of flags to pass to the C compiler for the target /// specified. fn cflags(&self, target: TargetSelection, which: GitRepo, c: CLang) -> Vec { let base = match c { - CLang::C => &self.cc[&target], - CLang::Cxx => &self.cxx[&target], + CLang::C => self.cc.borrow()[&target].clone(), + CLang::Cxx => self.cxx.borrow()[&target].clone(), }; // Filter out -O and /O (the optimization flags) that we picked up from @@ -1153,19 +1153,19 @@ impl Build { } /// Returns the path to the `ar` archive utility for the target specified. - fn ar(&self, target: TargetSelection) -> Option<&Path> { - self.ar.get(&target).map(|p| &**p) + fn ar(&self, target: TargetSelection) -> Option { + self.ar.borrow().get(&target).cloned() } /// Returns the path to the `ranlib` utility for the target specified. - fn ranlib(&self, target: TargetSelection) -> Option<&Path> { - self.ranlib.get(&target).map(|p| &**p) + fn ranlib(&self, target: TargetSelection) -> Option { + self.ranlib.borrow().get(&target).cloned() } /// Returns the path to the C++ compiler for the target specified. - fn cxx(&self, target: TargetSelection) -> Result<&Path, String> { - match self.cxx.get(&target) { - Some(p) => Ok(p.path()), + fn cxx(&self, target: TargetSelection) -> Result { + match self.cxx.borrow().get(&target) { + Some(p) => Ok(p.path().into()), None => { Err(format!("target `{}` is not configured as a host, only as a target", target)) } @@ -1173,21 +1173,21 @@ impl Build { } /// Returns the path to the linker for the given target if it needs to be overridden. - fn linker(&self, target: TargetSelection) -> Option<&Path> { - if let Some(linker) = self.config.target_config.get(&target).and_then(|c| c.linker.as_ref()) + fn linker(&self, target: TargetSelection) -> Option { + if let Some(linker) = self.config.target_config.get(&target).and_then(|c| c.linker.clone()) { Some(linker) } else if target.contains("vxworks") { // need to use CXX compiler as linker to resolve the exception functions // that are only existed in CXX libraries - Some(self.cxx[&target].path()) + Some(self.cxx.borrow()[&target].path().into()) } else if target != self.config.build && util::use_host_linker(target) && !target.contains("msvc") { Some(self.cc(target)) } else if self.config.use_lld && !self.is_fuse_ld_lld(target) && self.build == target { - Some(&self.initial_lld) + Some(self.initial_lld.clone()) } else { None } diff --git a/src/bootstrap/llvm.rs b/src/bootstrap/llvm.rs index 19e595650cf..4752b1f7ea1 100644 --- a/src/bootstrap/llvm.rs +++ b/src/bootstrap/llvm.rs @@ -605,7 +605,7 @@ fn configure_cmake( } let (cc, cxx) = match builder.config.llvm_clang_cl { - Some(ref cl) => (cl.as_ref(), cl.as_ref()), + Some(ref cl) => (cl.into(), cl.into()), None => (builder.cc(target), builder.cxx(target).unwrap()), }; @@ -656,9 +656,9 @@ fn configure_cmake( .define("CMAKE_CXX_COMPILER_LAUNCHER", ccache); } } - cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc)) - .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx)) - .define("CMAKE_ASM_COMPILER", sanitize_cc(cc)); + cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc)) + .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx)) + .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc)); } cfg.build_arg("-j").build_arg(builder.jobs().to_string()); @@ -698,7 +698,7 @@ fn configure_cmake( if ar.is_absolute() { // LLVM build breaks if `CMAKE_AR` is a relative path, for some reason it // tries to resolve this path in the LLVM build directory. - cfg.define("CMAKE_AR", sanitize_cc(ar)); + cfg.define("CMAKE_AR", sanitize_cc(&ar)); } } @@ -706,7 +706,7 @@ fn configure_cmake( if ranlib.is_absolute() { // LLVM build breaks if `CMAKE_RANLIB` is a relative path, for some reason it // tries to resolve this path in the LLVM build directory. - cfg.define("CMAKE_RANLIB", sanitize_cc(ranlib)); + cfg.define("CMAKE_RANLIB", sanitize_cc(&ranlib)); } } diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 699b7f0be85..c04567f92b2 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1698,7 +1698,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the // Note that if we encounter `PATH` we make sure to append to our own `PATH` // rather than stomp over it. if target.contains("msvc") { - for &(ref k, ref v) in builder.cc[&target].env() { + for &(ref k, ref v) in builder.cc.borrow()[&target].env() { if k != "PATH" { cmd.env(k, v); } diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 962cbf758d4..96341b69df0 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -855,7 +855,7 @@ impl<'a> Builder<'a> { if compiler.host.contains("msvc") { let curpaths = env::var_os("PATH").unwrap_or_default(); let curpaths = env::split_paths(&curpaths).collect::>(); - for &(ref k, ref v) in self.cc[&compiler.host].env() { + for &(ref k, ref v) in self.cc.borrow()[&compiler.host].env() { if k != "PATH" { continue; } -- cgit 1.4.1-3-g733a5 From 9ec370d40ceb86249b303c9d26f576229ad0b318 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 7 Jun 2023 12:04:53 +0200 Subject: bless both 32bit and 64bit variants of mir-opt when available --- src/bootstrap/test.rs | 78 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 8 deletions(-) (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index c04567f92b2..5ecac833d27 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -30,6 +30,22 @@ use crate::{envify, CLang, DocTests, GitRepo, Mode}; const ADB_TEST_DIR: &str = "/data/local/tmp/work"; +// mir-opt tests have different variants depending on whether a target is 32bit or 64bit, and +// blessing them requires blessing with each target. To aid developers, when blessing the mir-opt +// test suite the corresponding target of the opposite pointer size is also blessed. +// +// This array serves as the known mappings between 32bit and 64bit targets. If you're developing on +// a target where a target with the opposite pointer size exists, feel free to add it here. +const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[ + // (32bit, 64bit) + ("i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"), + ("i686-unknown-linux-musl", "x86_64-unknown-linux-musl"), + ("i686-pc-windows-msvc", "x86_64-pc-windows-msvc"), + ("i686-pc-windows-gnu", "x86_64-pc-windows-gnu"), + ("i686-apple-darwin", "x86_64-apple-darwin"), + ("i686-apple-darwin", "aarch64-apple-darwin"), +]; + fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { if !builder.fail_fast { if !builder.try_run(cmd) { @@ -1319,14 +1335,60 @@ impl Step for MirOpt { } fn run(self, builder: &Builder<'_>) { - builder.ensure(Compiletest { - compiler: self.compiler, - target: self.target, - mode: "mir-opt", - suite: "mir-opt", - path: "tests/mir-opt", - compare_mode: None, - }); + let run = |target| { + builder.ensure(Compiletest { + compiler: self.compiler, + target: target, + mode: "mir-opt", + suite: "mir-opt", + path: "tests/mir-opt", + compare_mode: None, + }) + }; + + // We use custom logic to bless the mir-opt suite: mir-opt tests have multiple variants + // (32bit vs 64bit), and all of them needs to be blessed. When blessing, we try best-effort + // to also bless the other variants, to aid developers. + if builder.config.cmd.bless() { + let targets = MIR_OPT_BLESS_TARGET_MAPPING + .iter() + .filter(|(target_32bit, target_64bit)| { + *target_32bit == &*self.target.triple || *target_64bit == &*self.target.triple + }) + .next() + .map(|(target_32bit, target_64bit)| { + let target_32bit = TargetSelection::from_user(target_32bit); + let target_64bit = TargetSelection::from_user(target_64bit); + + // Running compiletest requires a C compiler to be available, but it might not + // have been detected by bootstrap if the target we're testing wasn't in the + // --target flags. + if !builder.cc.borrow().contains_key(&target_32bit) { + crate::cc_detect::find_target(builder, target_32bit); + } + if !builder.cc.borrow().contains_key(&target_64bit) { + crate::cc_detect::find_target(builder, target_64bit); + } + + vec![target_32bit, target_64bit] + }) + .unwrap_or_else(|| { + eprintln!( + "\ +Note that not all variants of mir-opt tests are going to be blessed, as no mapping between +a 32bit and a 64bit target was found for {target}. +You can add that mapping by changing MIR_OPT_BLESS_TARGET_MAPPING in src/bootstrap/test.rs", + target = self.target, + ); + vec![self.target] + }); + + for target in targets { + run(target); + } + } else { + run(self.target); + } } } -- cgit 1.4.1-3-g733a5 From 9de3c29319a42bbfdf3c61f1bced9e2e79373452 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 7 Jun 2023 15:05:54 +0200 Subject: add support for blessing panic=abort mir-opt tests --- src/bootstrap/config.rs | 16 +++++++- src/bootstrap/lib.rs | 1 + src/bootstrap/synthetic_targets.rs | 82 ++++++++++++++++++++++++++++++++++++++ src/bootstrap/test.rs | 11 ++++- 4 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 src/bootstrap/synthetic_targets.rs (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index b521ad75d63..8ee63e561ba 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -429,6 +429,7 @@ impl std::str::FromStr for RustcLto { pub struct TargetSelection { pub triple: Interned, file: Option>, + synthetic: bool, } /// Newtype over `Vec` so we can implement custom parsing logic @@ -460,7 +461,15 @@ impl TargetSelection { let triple = INTERNER.intern_str(triple); let file = file.map(|f| INTERNER.intern_str(f)); - Self { triple, file } + Self { triple, file, synthetic: false } + } + + pub fn create_synthetic(triple: &str, file: &str) -> Self { + Self { + triple: INTERNER.intern_str(triple), + file: Some(INTERNER.intern_str(file)), + synthetic: true, + } } pub fn rustc_target_arg(&self) -> &str { @@ -478,6 +487,11 @@ impl TargetSelection { pub fn ends_with(&self, needle: &str) -> bool { self.triple.ends_with(needle) } + + // See src/bootstrap/synthetic_targets.rs + pub fn is_synthetic(&self) -> bool { + self.synthetic + } } impl fmt::Display for TargetSelection { diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index c9d256028d4..d7e77aeb338 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -61,6 +61,7 @@ mod run; mod sanity; mod setup; mod suggest; +mod synthetic_targets; mod tarball; mod test; mod tool; diff --git a/src/bootstrap/synthetic_targets.rs b/src/bootstrap/synthetic_targets.rs new file mode 100644 index 00000000000..7eeac9025c9 --- /dev/null +++ b/src/bootstrap/synthetic_targets.rs @@ -0,0 +1,82 @@ +//! In some cases, parts of bootstrap need to change part of a target spec just for one or a few +//! steps. Adding these targets to rustc proper would "leak" this implementation detail of +//! bootstrap, and would make it more complex to apply additional changes if the need arises. +//! +//! To address that problem, this module implements support for "synthetic targets". Synthetic +//! targets are custom target specs generated using builtin target specs as their base. You can use +//! one of the target specs already defined in this module, or create new ones by adding a new step +//! that calls create_synthetic_target. + +use crate::builder::{Builder, ShouldRun, Step}; +use crate::config::TargetSelection; +use crate::Compiler; +use std::process::{Command, Stdio}; + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub(crate) struct MirOptPanicAbortSyntheticTarget { + pub(crate) compiler: Compiler, + pub(crate) base: TargetSelection, +} + +impl Step for MirOptPanicAbortSyntheticTarget { + type Output = TargetSelection; + const DEFAULT: bool = true; + const ONLY_HOSTS: bool = false; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.never() + } + + fn run(self, builder: &Builder<'_>) -> Self::Output { + create_synthetic_target(builder, self.compiler, "miropt-abort", self.base, |spec| { + spec.insert("panic-strategy".into(), "abort".into()); + }) + } +} + +fn create_synthetic_target( + builder: &Builder<'_>, + compiler: Compiler, + suffix: &str, + base: TargetSelection, + customize: impl FnOnce(&mut serde_json::Map), +) -> TargetSelection { + if base.contains("synthetic") { + // This check is not strictly needed, but nothing currently needs recursive synthetic + // targets. If the need arises, removing this in the future *SHOULD* be safe. + panic!("cannot create synthetic targets with other synthetic targets as their base"); + } + + let name = format!("{base}-synthetic-{suffix}"); + let path = builder.out.join("synthetic-target-specs").join(format!("{name}.json")); + std::fs::create_dir_all(path.parent().unwrap()).unwrap(); + + if builder.config.dry_run() { + std::fs::write(&path, b"dry run\n").unwrap(); + return TargetSelection::create_synthetic(&name, path.to_str().unwrap()); + } + + let mut cmd = Command::new(builder.rustc(compiler)); + cmd.arg("--target").arg(base.rustc_target_arg()); + cmd.args(["-Zunstable-options", "--print", "target-spec-json"]); + cmd.stdout(Stdio::piped()); + + let output = cmd.spawn().unwrap().wait_with_output().unwrap(); + if !output.status.success() { + panic!("failed to gather the target spec for {base}"); + } + + let mut spec: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); + let spec_map = spec.as_object_mut().unwrap(); + + // The `is-builtin` attribute of a spec needs to be removed, otherwise rustc will complain. + spec_map.remove("is-builtin"); + + customize(spec_map); + + std::fs::write(&path, &serde_json::to_vec_pretty(&spec).unwrap()).unwrap(); + let target = TargetSelection::create_synthetic(&name, path.to_str().unwrap()); + crate::cc_detect::find_target(builder, target); + + target +} diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 5ecac833d27..d7f0205cbed 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -23,6 +23,7 @@ use crate::doc::DocumentationFormat; use crate::flags::Subcommand; use crate::llvm; use crate::render_tests::add_flags_and_try_run_tests; +use crate::synthetic_targets::MirOptPanicAbortSyntheticTarget; use crate::tool::{self, SourceType, Tool}; use crate::toolstate::ToolState; use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t, up_to_date}; @@ -1347,8 +1348,8 @@ impl Step for MirOpt { }; // We use custom logic to bless the mir-opt suite: mir-opt tests have multiple variants - // (32bit vs 64bit), and all of them needs to be blessed. When blessing, we try best-effort - // to also bless the other variants, to aid developers. + // (32bit vs 64bit, and panic=abort vs panic=unwind), and all of them needs to be blessed. + // When blessing, we try best-effort to also bless the other variants, to aid developers. if builder.config.cmd.bless() { let targets = MIR_OPT_BLESS_TARGET_MAPPING .iter() @@ -1385,6 +1386,12 @@ You can add that mapping by changing MIR_OPT_BLESS_TARGET_MAPPING in src/bootstr for target in targets { run(target); + + let panic_abort_target = builder.ensure(MirOptPanicAbortSyntheticTarget { + compiler: self.compiler, + base: target, + }); + run(panic_abort_target); } } else { run(self.target); -- cgit 1.4.1-3-g733a5 From 47b67327664c7bdc80ca447ba3c790f4bd898db7 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 13 Jun 2023 14:54:42 +0200 Subject: add another check for empty `cc`s --- src/bootstrap/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bootstrap/test.rs') diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index d7f0205cbed..904f27f472d 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1792,7 +1792,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the cmd.arg("--adb-path").arg("adb"); cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR); - if target.contains("android") { + if target.contains("android") && !builder.config.dry_run() { // Assume that cc for this target comes from the android sysroot cmd.arg("--android-cross-path") .arg(builder.cc(target).parent().unwrap().parent().unwrap()); -- cgit 1.4.1-3-g733a5