Skip to content

RUSTUP_TOOLCHAIN override prevents rustup overrides from being respected #16932

@makspll

Description

@makspll

As seen here:
https://github.com/rust-lang/rust-analyzer/blob/e265e3d5189513c42d037999d41a696369af9388/crates/flycheck/src/lib.rs#L408C1-L408C80

With the given settings.json:

    "rust-analyzer.check.invocationStrategy": "per_workspace",
    "rust-analyzer.check.invocationLocation": "workspace",
    "rust-analyzer.check.overrideCommand": [
        "cargo",
        "clippy",
        "--message-format=json"
    ],
    "rust-analyzer.linkedProjects": [
        "./crates/another_crate/Cargo.toml",
        "Cargo.toml"
    ],

I believe cargo clippy will be run from the root instead of the workspace location, meaning that rustup overrides are not respected, and hence checking fails for projects using different toolchains in each linked project.

Is there any work around?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions