Skip to content

Commit eee22ff

Browse files
committed
Auto merge of #1474 - RalfJung:canonical, r=RalfJung
go back to using canonicalize() Newer xargo should hopefully work with the paths this produces on Windows.
2 parents ade99c3 + 15466e0 commit eee22ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cargo-miri/bin.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::process::Command;
1010

1111
use rustc_version::VersionMeta;
1212

13-
const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 20);
13+
const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 21);
1414

1515
const CARGO_MIRI_HELP: &str = r#"Interprets bin crates and tests in Miri
1616
@@ -258,8 +258,9 @@ fn setup(subcommand: MiriCommand) {
258258
// Determine where the rust sources are located. `XARGO_RUST_SRC` env var trumps everything.
259259
let rust_src = match std::env::var_os("XARGO_RUST_SRC") {
260260
Some(path) => {
261-
// Make path absolute, but not via `canonicalize` (which does not work very well on Windows).
262-
env::current_dir().unwrap().join(path)
261+
let path = PathBuf::from(path);
262+
// Make path absolute if possible.
263+
path.canonicalize().unwrap_or(path)
263264
}
264265
None => {
265266
// Check for `rust-src` rustup component.

0 commit comments

Comments
 (0)