Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

fix: Explicitly provide the host-triple of the version to install #22

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ pub fn native_install(
} else {
debug!("Detected a broken toolchain, uninstalling it");

exec_command!(inherit, "rustup", ["toolchain", "uninstall", &channel]);
exec_command!(inherit, "rustup", ["toolchain", "uninstall", &triple]);
}
}

if do_install {
exec_command!(
inherit,
"rustup",
["toolchain", "install", &channel, "--force"]
["toolchain", "install", &triple, "--force"]
);
}

Expand All @@ -197,9 +197,11 @@ pub fn native_install(
pub fn native_uninstall(
Json(input): Json<NativeUninstallInput>,
) -> FnResult<Json<NativeUninstallOutput>> {
let env = get_host_environment()?;
let channel = get_channel_from_version(&input.context.version);
let triple = format!("{}-{}", channel, get_target_triple(&env, NAME)?);

exec_command!(inherit, "rustup", ["toolchain", "uninstall", &channel]);
exec_command!(inherit, "rustup", ["toolchain", "uninstall", &triple]);

Ok(Json(NativeUninstallOutput {
uninstalled: true,
Expand Down
Loading