Skip to content

Commit 6cf13b0

Browse files
authored
Rollup merge of #134209 - onur-ozkan:check-skip-paths, r=jieyouxu
validate `--skip` and `--exclude` paths Fixes #134198 cc ``@ChrisDenton``
2 parents 2846699 + 65a609b commit 6cf13b0

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Diff for: src/bootstrap/src/core/config/config.rs

+25-1
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,31 @@ impl Config {
13201320

13211321
// Set flags.
13221322
config.paths = std::mem::take(&mut flags.paths);
1323-
config.skip = flags.skip.into_iter().chain(flags.exclude).collect();
1323+
config.skip = flags
1324+
.skip
1325+
.into_iter()
1326+
.chain(flags.exclude)
1327+
.map(|p| {
1328+
let p = if cfg!(windows) {
1329+
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1330+
} else {
1331+
p
1332+
};
1333+
1334+
// Jump to top-level project path to support passing paths
1335+
// from sub directories.
1336+
let top_level_path = config.src.join(&p);
1337+
if !config.src.join(&top_level_path).exists() {
1338+
eprintln!("WARNING: '{}' does not exist.", top_level_path.display());
1339+
}
1340+
1341+
// Never return top-level path here as it would break `--skip`
1342+
// logic on rustc's internal test framework which is utilized
1343+
// by compiletest.
1344+
p
1345+
})
1346+
.collect();
1347+
13241348
config.include_default_paths = flags.include_default_paths;
13251349
config.rustc_error_format = flags.rustc_error_format;
13261350
config.json_output = flags.json_output;

0 commit comments

Comments
 (0)