Skip to content

Some way to pass Miri flags without MIRIFLAGS? #2051

Open
@RalfJung

Description

@RalfJung

@Gankra points out that the recommended way to pass flags to Miri -- MIRIFLAGS=-Zmiri-strict-provenance cargo miri test -- does not work on Windows. Also I have to admit this style of flag passing is somewhat verbose.

Is there a way we can pass flags via the CLI while also still being compatible with all cargo test invocations? One suggestion is to "grab" all flags starting with -Zmiri before cargo even sees then, and populate MIRIFLAGS with that. This could break in some corner cases (like when a feature is called -Zmiri-me and someone calls cargo miri test --feature -Zmiri-me), but that seems very unlikely. This does also assume cargo will never have a -Z flag starting with miri, which sounds like a reasonable assumption. Then we could do cargo miri test -Zmiri-strict-provenance, which works on Windows and looks nicer even on non-Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargoArea: affects the cargo wrapper (cargo miri)C-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions