Skip to content
Closed
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: 8 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@ fn compile_probe() -> Option<ExitStatus> {
let probefile = Path::new(&out_dir).join("probe.rs");
fs::write(&probefile, PROBE).ok()?;

// Make sure to pick up Cargo rustc configuration.
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
// Make sure to pick up Cargo rustc configuration, while working around
// <https://github.com/rust-lang/rust-analyzer/issues/12973>.
let wrapper = env::var_os("RUSTC_WRAPPER").filter(|w| {
let wrapper_filename = Path::new(w).file_name().unwrap_or_default();
// Ignore wrappers with these filenames.
wrapper_filename != "rust-analyzer" && wrapper_filename != "rust-analyzer.exe"
});
let mut cmd = if let Some(wrapper) = wrapper {
let mut cmd = Command::new(wrapper);
// The wrapper's first argument is supposed to be the path to rustc.
cmd.arg(rustc);
Expand Down