diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-14 03:54:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-14 03:54:32 +0100 |
| commit | 6cf13b00368f68f5cdad155e4fa919d4041db667 (patch) | |
| tree | 909269fb60f0530e7605f161ffd089d397f4553b /src/bootstrap | |
| parent | 2846699366ac9eac997c037a8552b994daddf8bf (diff) | |
| parent | 65a609b4f21b53f55535f0f6cf51e0381ac0f95b (diff) | |
| download | rust-6cf13b00368f68f5cdad155e4fa919d4041db667.tar.gz rust-6cf13b00368f68f5cdad155e4fa919d4041db667.zip | |
Rollup merge of #134209 - onur-ozkan:check-skip-paths, r=jieyouxu
validate `--skip` and `--exclude` paths Fixes #134198 cc ``@ChrisDenton``
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index c6800aedca9..22d361ff091 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1320,7 +1320,31 @@ impl Config { // Set flags. config.paths = std::mem::take(&mut flags.paths); - config.skip = flags.skip.into_iter().chain(flags.exclude).collect(); + 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.include_default_paths = flags.include_default_paths; config.rustc_error_format = flags.rustc_error_format; config.json_output = flags.json_output; |
