Skip to content

Add miri.toml config file for ./miri script - #5289

Open
RalfJung wants to merge 4 commits into
rust-lang:masterfrom
RalfJung:miri.toml
Open

Add miri.toml config file for ./miri script#5289
RalfJung wants to merge 4 commits into
rust-lang:masterfrom
RalfJung:miri.toml

Conversation

@RalfJung

Copy link
Copy Markdown
Member

As discussed in #4700, this adds a miri.toml config file for our ./miri build script. The supported config flags in this PR are:

[toolchain]
# Overwrite the default toolchain name used by `./miri toolchain`.
# Note that all other commands will just use the currently active rustup toolchain!
# (Though note that if you have `auto.toolchain` enabled, most commands will run `./miri toolchain`
# first, which will activate the toolchain given here.)
name = "miri"
# Additional components to install with the toolchain. Note that if you remove `clippy` or `rustfmt`
# from this list then obviously `./miri clippy`/`./miri fmt` will not work.
# Only takes effect when a new toolchain is installed. Run `rustup toolchain remove <name>` followed
# by `./miri toolchain` to force this to have effect.
components = ["clippy", "rustfmt"]

[auto]
# Automatically run `./miri toolchain` before most commands.
# Uses the toolchain name configured above, if any.
toolchain = false
# Automatically run `./miri clippy` before most commands.
clippy = false
# Automatically run `./miri fmt` before most commands.
fmt = false

The old .auto* files are still supported: they are used as fallback if there is no miri.toml file.

@rust-lang/miri what do you think? Any feedback on the names for stuff in the config file?

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Aug 26, 2026
Comment thread miri-script/src/commands.rs Outdated
let name = name.as_deref().or(config.toolchain.name.as_deref()).unwrap_or("miri");
// Compute rustup-toolchain-install-master flags for additional components.
let component_flags =
config.toolchain.components.iter().flat_map(|component| ["-c", component]);

@RalfJung RalfJung Aug 26, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I absolutely love how I don't even have to store these in a Vec, I can just directly pass the iterator to cmd!. :D

View changes since the review

@RalfJung
RalfJung force-pushed the miri.toml branch 2 times, most recently from 78fe373 to 1415dcd Compare August 26, 2026 21:56
@RalfJung
RalfJung force-pushed the miri.toml branch 2 times, most recently from f2f76ab to 1395cc3 Compare August 26, 2026 22:16
@saethlin

Copy link
Copy Markdown
Member

@rust-lang/miri what do you think? Any feedback on the names for stuff in the config file?

I'll probably just set-and-forget. Looks good to me.

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting for a review to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants