Skip to content

Commit

Permalink
cargo/config: Don't canonicalize joined [env] relative paths
Browse files Browse the repository at this point in the history
Cargo doesn't do this either, and canonicalization requires the path to
exist which it does not have to.
  • Loading branch information
MarijnS95 committed May 15, 2023
1 parent 2f3aefb commit ff3cc28
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions xbuild/src/cargo/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,13 @@ impl EnvOption {
value,
relative: true,
force: _,
} => {
let value = config_parent.as_ref().join(value);
let value = dunce::canonicalize(&value)
.with_context(|| format!("Failed to canonicalize `{}`", value.display()))?;
value
.into_os_string()
.into_string()
.map_err(VarError::NotUnicode)?
.into()
}
} => config_parent
.as_ref()
.join(value)
.into_os_string()
.into_string()
.map_err(VarError::NotUnicode)?
.into(),
Self::String(value) | Self::Value { value, .. } => value.into(),
})
}
Expand Down

0 comments on commit ff3cc28

Please # to comment.