Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xtask): use canonical cargo_home location #1539

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2024"
anyhow = "1.0"
clap = { version = "4", features = ["derive"] }
goblin = { version = "0.9", default-features = false, features = ["archive", "elf32", "elf64", "std"] }
home = "0.5"
sysinfo = "0.33"
ureq = "2"
wait-timeout = "0.2"
Expand Down
10 changes: 3 additions & 7 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod clippy;
mod doc;

use std::env;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::process::Command;

use anyhow::Result;
Expand Down Expand Up @@ -71,14 +71,10 @@ fn sanitize(cmd: &str) -> Command {
let exe = format!("{cmd}{}", env::consts::EXE_SUFFIX);
// On windows, the userspace toolchain ends up in front of the rustup proxy in $PATH.
// To reach the rustup proxy nonetheless, we explicitly query $CARGO_HOME.
let mut cargo_home = PathBuf::from(env::var_os("CARGO_HOME").unwrap());
let mut cargo_home = home::cargo_home().unwrap();
cargo_home.push("bin");
cargo_home.push(&exe);
if cargo_home.exists() {
cargo_home
} else {
PathBuf::from(exe)
}
cargo_home
};

let mut cmd = Command::new(cmd);
Expand Down
Loading