From a6f7628ea28a74e09002e430609b6e6ce52fd0ba Mon Sep 17 00:00:00 2001 From: Paul Faria Date: Sat, 8 Apr 2017 18:53:57 -0400 Subject: [PATCH] Use the existing path when removing the prefix fails. This allows the use of out-of-tree paths to be specified --- src/bootstrap/step.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index 5560b5b0333c..74c9ae983737 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -137,7 +137,9 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { while let Some(krate) = list.pop() { let default = krate == name; let krate = &build.crates[krate]; - let path = krate.path.strip_prefix(&build.src).unwrap(); + let path = krate.path.strip_prefix(&build.src) + // This handles out of tree paths + .unwrap_or(&krate.path); ret.push((krate, path.to_str().unwrap(), default)); for dep in krate.deps.iter() { if visited.insert(dep) && dep != "build_helper" {