From 081065d369d2654fafb7a17a266647889773113a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 19 May 2015 21:43:41 -0700 Subject: [PATCH] Fix a relative `rustc` spec to .cargo/config The paths were mistakenly relative to .cargo/config, not the directory containing .cargo/config --- src/cargo/util/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cargo/util/config.rs b/src/cargo/util/config.rs index 65f119bae..7681bc0cb 100644 --- a/src/cargo/util/config.rs +++ b/src/cargo/util/config.rs @@ -209,7 +209,12 @@ impl Config { fn get_tool(&self, tool: &str) -> CargoResult { let var = format!("build.{}", tool); if let Some((tool, path)) = try!(self.get_string(&var)) { + // If this tool has a path separator in it, calculate the path + // relative to the config file (specified by `path`). To do that we + // chop off the `.cargo/config` at the end of the path and then join + // on the tool. if tool.contains("/") || (cfg!(windows) && tool.contains("\\")) { + let path = path.parent().unwrap().parent().unwrap(); return Ok(path.join(tool)) } return Ok(PathBuf::from(tool)) -- 2.39.5