From 7bd3f48d94b0e92843738e957687ac10a29dbba2 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:08:26 -0500 Subject: [PATCH] fix: force rustup to add `rustc_driver.dll` to the `PATH` --- bevy_lint/src/bin/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bevy_lint/src/bin/main.rs b/bevy_lint/src/bin/main.rs index 60827f58..8543a9f7 100644 --- a/bevy_lint/src/bin/main.rs +++ b/bevy_lint/src/bin/main.rs @@ -33,6 +33,12 @@ fn main() -> anyhow::Result { // This instructs `rustc` to call `bevy_lint_driver` instead of its default routine. // This lets us register custom lints. .env("RUSTC_WORKSPACE_WRAPPER", driver_path) + // Rustup on Windows does not modify the `PATH` variable by default so a toolchain-specific + // version of `cargo` or `rustc` is not accidentally run instead of Rustup's proxy version. + // This isn't desired for us, however, because we need the `PATH` modified to discover and + // link to `rustc_driver.dll`. Setting `RUSTUP_WINDOWS_PATH_ADD_BIN=1` forces Rustup to + // modify the path. For more info, please see . + .env("RUSTUP_WINDOWS_PATH_ADD_BIN", "1") .status() .context("Failed to spawn `cargo check`.")?;