mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: Set RUSTUP_TOOLCHAIN and invoke the proxies instead of directly invoking sysroot binaries
This commit is contained in:
parent
000ce5d29c
commit
465ddef7cc
9 changed files with 82 additions and 79 deletions
|
@ -28,8 +28,8 @@ pub fn get(
|
|||
};
|
||||
let sysroot = match config {
|
||||
RustcDataLayoutConfig::Cargo(sysroot, cargo_toml) => {
|
||||
let cargo = Sysroot::discover_tool(sysroot, toolchain::Tool::Cargo)?;
|
||||
let mut cmd = Command::new(cargo);
|
||||
let mut cmd = Command::new(toolchain::Tool::Cargo.path());
|
||||
Sysroot::set_rustup_toolchain_env(&mut cmd, sysroot);
|
||||
cmd.envs(extra_env);
|
||||
cmd.current_dir(cargo_toml.parent())
|
||||
.args(["rustc", "--", "-Z", "unstable-options", "--print", "target-spec-json"])
|
||||
|
@ -48,8 +48,8 @@ pub fn get(
|
|||
RustcDataLayoutConfig::Rustc(sysroot) => sysroot,
|
||||
};
|
||||
|
||||
let rustc = Sysroot::discover_tool(sysroot, toolchain::Tool::Rustc)?;
|
||||
let mut cmd = Command::new(rustc);
|
||||
let mut cmd = Command::new(toolchain::Tool::Rustc.path());
|
||||
Sysroot::set_rustup_toolchain_env(&mut cmd, sysroot);
|
||||
cmd.envs(extra_env)
|
||||
.args(["-Z", "unstable-options", "--print", "target-spec-json"])
|
||||
.env("RUSTC_BOOTSTRAP", "1");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue