Skip to content

Commit

Permalink
Auto merge of rust-lang#48252 - Mark-Simulacrum:exclude-paths, r=alex…
Browse files Browse the repository at this point in the history
…crichton

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
  • Loading branch information
bors committed Feb 16, 2018
2 parents 5570cdc + c788433 commit 58a8e0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl StepDescription {
}

if !attempted_run {
eprintln!("Warning: no rules matched {}.", path.display());
panic!("Error: no rules matched {}.", path.display());
}
}
}
Expand Down Expand Up @@ -385,6 +385,12 @@ impl<'a> Builder<'a> {
Subcommand::Clean { .. } => panic!(),
};

if let Some(path) = paths.get(0) {
if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
return;
}
}

let builder = Builder {
build,
top_stage: build.config.stage.unwrap_or(2),
Expand Down
8 changes: 2 additions & 6 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ Arguments:
let src = matches.opt_str("src").map(PathBuf::from)
.or_else(|| env::var_os("SRC").map(PathBuf::from))
.unwrap_or(cwd.clone());
let paths = matches.free[1..].iter().map(|p| {
cwd.join(p).strip_prefix(&src).expect("paths passed to be inside checkout").into()
}).collect::<Vec<PathBuf>>();
let paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();

let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
if fs::metadata("config.toml").is_ok() {
Expand Down Expand Up @@ -380,9 +378,7 @@ Arguments:
cmd,
incremental: matches.opt_present("incremental"),
exclude: split(matches.opt_strs("exclude"))
.into_iter().map(|p| {
cwd.join(p).strip_prefix(&src).expect("paths to be inside checkout").into()
}).collect::<Vec<_>>(),
.into_iter().map(|p| p.into()).collect::<Vec<_>>(),
src,
}
}
Expand Down

0 comments on commit 58a8e0c

Please sign in to comment.