From 2f55cedf501e06f932787248a17e6aaffd9785f1 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 23 Jul 2024 20:28:19 +0300 Subject: ensure std step before preparing sysroot When using download-rustc, any stage other than 0 or 1 (e.g., cargo +stage2 build/doc) will fail to find std while compiling on simple rust sources. Ensuring the rustc step fixes this issue. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/compile.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 3e79acad1c4..9bbebf9b870 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1700,6 +1700,7 @@ impl Step for Assemble { // If we're downloading a compiler from CI, we can use the same compiler for all stages other than 0. if builder.download_rustc() { + builder.ensure(Std::new(target_compiler, target_compiler.host)); let sysroot = builder.ensure(Sysroot { compiler: target_compiler, force_recompile: false }); // Ensure that `libLLVM.so` ends up in the newly created target directory, -- cgit 1.4.1-3-g733a5 From 0728c155a3141a96abf648306c7ad11e30a49d65 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 23 Jul 2024 20:14:33 +0200 Subject: Allow to pass a full path for `run-make` tests --- src/tools/compiletest/src/lib.rs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 0cf05b32e96..81a5acb5cf2 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -25,7 +25,7 @@ use build_helper::git::{get_git_modified_files, get_git_untracked_files}; use core::panic; use getopts::Options; use std::collections::HashSet; -use std::ffi::OsString; +use std::ffi::{OsStr, OsString}; use std::fs; use std::io::{self, ErrorKind}; use std::path::{Path, PathBuf}; @@ -225,6 +225,29 @@ pub fn parse_config(args: Vec) -> Config { // Avoid spawning an external command when we know tidy won't be used. false }; + let filters = if mode == Mode::RunMake { + matches + .free + .iter() + .map(|f| { + let path = Path::new(f); + let mut iter = path.iter().skip(1); + + // We skip the test folder and check if the user passed `rmake.rs` or `Makefile`. + if iter + .next() + .is_some_and(|s| s == OsStr::new("rmake.rs") || s == OsStr::new("Makefile")) + && iter.next().is_none() + { + path.parent().unwrap().to_str().unwrap().to_string() + } else { + f.to_string() + } + }) + .collect::>() + } else { + matches.free.clone() + }; Config { bless: matches.opt_present("bless"), compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")), @@ -249,7 +272,7 @@ pub fn parse_config(args: Vec) -> Config { debugger: None, run_ignored, with_debug_assertions, - filters: matches.free.clone(), + filters, skip: matches.opt_strs("skip"), filter_exact: matches.opt_present("exact"), force_pass_mode: matches.opt_str("pass").map(|mode| { -- cgit 1.4.1-3-g733a5