From 366a65665aed84fda50e4ea8bc905153ffcc1287 Mon Sep 17 00:00:00 2001 From: Mark Simulacrum Date: Thu, 15 Feb 2018 18:12:04 -0700 Subject: Consider paths passed to x.py to be root-relative. 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. --- src/bootstrap/builder.rs | 4 ++++ src/bootstrap/flags.rs | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 22a128e38e8..7345b284dc7 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -385,6 +385,10 @@ impl<'a> Builder<'a> { Subcommand::Clean { .. } => panic!(), }; + if paths[0] == Path::new("nonexistent/path/to/trigger/cargo/metadata") { + return; + } + let builder = Builder { build, top_stage: build.config.stage.unwrap_or(2), diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 8a38fedc613..42b949527e0 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -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::>(); + let paths = matches.free[1..].iter().map(|p| p.into()).collect::>(); let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| { if fs::metadata("config.toml").is_ok() { @@ -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::>(), + .into_iter().map(|p| p.into()).collect::>(), src, } } -- cgit 1.4.1-3-g733a5