Skip to content

Commit 308b3ad

Browse files
committed
fix: don't canonicalize cargo binary path
canonicalize() resolves the cargo -> rustup symlink, causing commands like 'cargo rustc' to be invoked as 'rustup rustc' which doesn't understand cargo-specific arguments. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 8f21b64 commit 308b3ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo_cmd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl CargoBinary {
4848

4949
pub fn find_cargo() -> Result<CargoBinary> {
5050
let cargo = match env::var_os("CARGO") {
51-
Some(cargo) => Path::new(&cargo).canonicalize()?,
52-
None => which::which("cargo")?.canonicalize()?,
51+
Some(cargo) => PathBuf::from(cargo),
52+
None => which::which("cargo")?,
5353
};
5454
let rustup_toolchain = env::var_os("RUSTUP_TOOLCHAIN");
5555
Ok(CargoBinary {

0 commit comments

Comments
 (0)