Skip to content

Commit 76b82b4

Browse files
ChrisDentonsyphar
authored andcommitted
Don't canonicalize binaries
This avoids resolving rustup shims to their real name
1 parent ebd0821 commit 76b82b4

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/cmd/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,15 @@ impl<'w, 'pl> Command<'w, 'pl> {
437437
// global paths should never be normalized
438438
Binary::Global(path) => (path, false),
439439
Binary::ManagedByRustwide(path) => {
440-
let binary = self
441-
.workspace
442-
.expect("calling rustwide bins without a workspace is not supported")
443-
.cargo_home()
444-
.join("bin")
445-
.join(exe_suffix(path.as_os_str()));
446440
// `cargo_home()` might a relative path
447-
(crate::utils::normalize_path(&binary), true)
441+
let cargo_home = crate::utils::normalize_path(
442+
&self
443+
.workspace
444+
.expect("calling rustwide bins without a workspace is not supported")
445+
.cargo_home(),
446+
);
447+
let binary = cargo_home.join("bin").join(exe_suffix(path.as_os_str()));
448+
(binary, true)
448449
}
449450
};
450451

src/tools/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ trait Tool: Send + Sync {
3838
fn update(&self, workspace: &Workspace, fast_install: bool) -> anyhow::Result<()>;
3939

4040
fn binary_path(&self, workspace: &Workspace) -> PathBuf {
41-
crate::utils::normalize_path(&workspace.cargo_home().join("bin").join(format!(
42-
"{}{}",
43-
self.name(),
44-
EXE_SUFFIX
45-
)))
41+
// `cargo_home()` might a relative path
42+
let cargo_home = crate::utils::normalize_path(&workspace.cargo_home());
43+
cargo_home
44+
.join("bin")
45+
.join(format!("{}{}", self.name(), EXE_SUFFIX))
4646
}
4747
}
4848

0 commit comments

Comments
 (0)