Skip to content

Commit 58a8e0c

Browse files
committed
Auto merge of #48252 - Mark-Simulacrum:exclude-paths, r=alexcrichton
Fix not running some steps in CI We'd previously assumed that these paths would be relative to the src dir, and that for example our various CI scripts would, when calling x.py, use `../x.py build ../src/tools/...` but this isn't the case -- they use `../x.py` without using the relevant source-relative path. We eventually may want to make this (actually somewhat logical) change, but this is not that time. r? @kennytm
2 parents 5570cdc + c788433 commit 58a8e0c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: src/bootstrap/builder.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl StepDescription {
217217
}
218218

219219
if !attempted_run {
220-
eprintln!("Warning: no rules matched {}.", path.display());
220+
panic!("Error: no rules matched {}.", path.display());
221221
}
222222
}
223223
}
@@ -385,6 +385,12 @@ impl<'a> Builder<'a> {
385385
Subcommand::Clean { .. } => panic!(),
386386
};
387387

388+
if let Some(path) = paths.get(0) {
389+
if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
390+
return;
391+
}
392+
}
393+
388394
let builder = Builder {
389395
build,
390396
top_stage: build.config.stage.unwrap_or(2),

Diff for: src/bootstrap/flags.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ Arguments:
278278
let src = matches.opt_str("src").map(PathBuf::from)
279279
.or_else(|| env::var_os("SRC").map(PathBuf::from))
280280
.unwrap_or(cwd.clone());
281-
let paths = matches.free[1..].iter().map(|p| {
282-
cwd.join(p).strip_prefix(&src).expect("paths passed to be inside checkout").into()
283-
}).collect::<Vec<PathBuf>>();
281+
let paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
284282

285283
let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
286284
if fs::metadata("config.toml").is_ok() {
@@ -380,9 +378,7 @@ Arguments:
380378
cmd,
381379
incremental: matches.opt_present("incremental"),
382380
exclude: split(matches.opt_strs("exclude"))
383-
.into_iter().map(|p| {
384-
cwd.join(p).strip_prefix(&src).expect("paths to be inside checkout").into()
385-
}).collect::<Vec<_>>(),
381+
.into_iter().map(|p| p.into()).collect::<Vec<_>>(),
386382
src,
387383
}
388384
}

0 commit comments

Comments
 (0)