Enforce a current directory being set for spawned commands

This commit is contained in:
Lukas Wirth 2024-12-29 12:51:13 +01:00
parent 0f95e60da3
commit 5ce14b0439
22 changed files with 99 additions and 75 deletions

View file

@ -74,10 +74,9 @@ pub(crate) fn cargo_config_env(
extra_env: &FxHashMap<String, String>,
sysroot: &Sysroot,
) -> FxHashMap<String, String> {
let mut cargo_config = sysroot.tool(Tool::Cargo);
let mut cargo_config = sysroot.tool(Tool::Cargo, manifest.parent());
cargo_config.envs(extra_env);
cargo_config
.current_dir(manifest.parent())
.args(["-Z", "unstable-options", "config", "get", "env"])
.env("RUSTC_BOOTSTRAP", "1");
if manifest.is_rust_manifest() {