Skip to content

Miri fails to run in presence of RUSTC environment variable #2238

Closed
@CraftSpider

Description

@CraftSpider

Currently, if the RUSTC environment variable is set, miri errors out with 'failed to run rustc to learn about target-specific information'. This appears to be because, in cargo-miri, the arg 'rustc' is being checked for exactly, but with RUSTC set, it may actually be set to any binary.

Some("rustc") => phase_rustc(args, RustcPhase::Build),

I found this out due to the Jetbrains rust plugin failing to run miri, as it unconditionally sets the RUSTC environment variable. I'm not sure the best solution. Looking for a path ending in rustc would make an okay patch, but to truly fix the issue, there would need to be a way to distinguish any particular path from being a rustc executable vs a JSON file (for phase_runner). A possible way to do that is to just attempt to execute the provided path?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargoArea: affects the cargo wrapper (cargo miri)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions