Skip to content

Commit 51961ac

Browse files
committed
cargo/config: Don't canonicalize joined [env] relative paths
Cargo doesn't do this either, and canonicalization requires the path to exist which it does not have to.
1 parent adc955f commit 51961ac

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

xbuild/src/cargo/config.rs

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{Context, Result};
1+
use anyhow::Result;
22
use serde::Deserialize;
33
use std::{
44
borrow::Cow,
@@ -113,16 +113,13 @@ impl EnvOption {
113113
value,
114114
relative: true,
115115
force: _,
116-
} => {
117-
let value = config_parent.as_ref().join(value);
118-
let value = dunce::canonicalize(&value)
119-
.with_context(|| format!("Failed to canonicalize `{}`", value.display()))?;
120-
value
121-
.into_os_string()
122-
.into_string()
123-
.map_err(VarError::NotUnicode)?
124-
.into()
125-
}
116+
} => config_parent
117+
.as_ref()
118+
.join(value)
119+
.into_os_string()
120+
.into_string()
121+
.map_err(VarError::NotUnicode)?
122+
.into(),
126123
Self::String(value) | Self::Value { value, .. } => value.into(),
127124
})
128125
}

0 commit comments

Comments
 (0)