From ab65cb3c6779f1d59ea2022c4d9d6effca2c614d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 5 Jul 2020 20:01:12 +0200 Subject: [PATCH] support relative XARGO_RUST_SRC --- cargo-miri/bin.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 197552a4b12..68f25b411a9 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -257,7 +257,10 @@ fn setup(subcommand: MiriCommand) { // Determine where the rust sources are located. `XARGO_RUST_SRC` env var trumps everything. let rust_src = match std::env::var_os("XARGO_RUST_SRC") { - Some(val) => PathBuf::from(val), + Some(val) => { + let val = PathBuf::from(val); + val.canonicalize().unwrap_or(val) + } None => { // Check for `rust-src` rustup component. let sysroot = miri()