From 28f16d3931656a3b371d6b1f3c55d999e4af22ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Sat, 28 Dec 2024 11:28:13 +0800 Subject: [PATCH] Revert "Rollup merge of #134209 - onur-ozkan:check-skip-paths, r=jieyouxu" Unfortunately, the present logic is not quite right because `Step`s are allowed to register arbitrary *aliases* (e.g. `library/test` is aliases to `test`), which means that we incorrectly warn on ``` ./x test --exclude test ``` producing ``` WARNING: '/home/joe/repos/rust/test' does not exist. ``` even though this alias (`test`) is indeed a known and handled `--exclude` filter. A proper fix will need to do something like "collect all eligible `Step`s then check `should_run(exclude)`" in order to determine if the exclude filter will trigger for the steps. (Courtesy of jyn pointing this out.) This reverts commit 6cf13b00368f68f5cdad155e4fa919d4041db667, reversing changes made to 2846699366ac9eac997c037a8552b994daddf8bf. --- src/bootstrap/src/core/config/config.rs | 26 +------------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 435216ef534c8..47edc28dd6db2 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1320,31 +1320,7 @@ impl Config { // Set flags. config.paths = std::mem::take(&mut flags.paths); - config.skip = flags - .skip - .into_iter() - .chain(flags.exclude) - .map(|p| { - let p = if cfg!(windows) { - PathBuf::from(p.to_str().unwrap().replace('/', "\\")) - } else { - p - }; - - // Jump to top-level project path to support passing paths - // from sub directories. - let top_level_path = config.src.join(&p); - if !config.src.join(&top_level_path).exists() { - eprintln!("WARNING: '{}' does not exist.", top_level_path.display()); - } - - // Never return top-level path here as it would break `--skip` - // logic on rustc's internal test framework which is utilized - // by compiletest. - p - }) - .collect(); - + config.skip = flags.skip.into_iter().chain(flags.exclude).collect(); config.include_default_paths = flags.include_default_paths; config.rustc_error_format = flags.rustc_error_format; config.json_output = flags.json_output;