Skip to content

Remove dependency on Rustup for bevy_lint #338

@BD103

Description

@BD103

Our NixOS friends don't use Rustup, so they currently have no way to use the linter! We may be able to get around this, but we'll have to find a replacement that works without Rustup for the following lines:

let status = Command::new("rustup")
.arg("run")
.arg(RUST_TOOLCHAIN_CHANNEL)
.arg("cargo")
.arg("check")
// Forward all arguments to `cargo check` except for the first, which is the path to the
// current executable.
.args(std::env::args().skip(1))
// 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 <https://github.com/rust-lang/rustup/pull/3703>.
.env("RUSTUP_WINDOWS_PATH_ADD_BIN", "1")
.status()
.context("Failed to spawn `cargo check`.")?;

Metadata

Metadata

Assignees

Labels

A-LinterRelated to the linter and custom lintsC-DependenciesA change related to dependenciesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongX-BlessedHas a large architectural impact or tradeoffs, but the design has been endorsed by decision makers

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions