fix MIRI_AUTO_OPS not having an effect any more
This commit is contained in:
parent
5615562b68
commit
2f6ffa923e
@ -458,8 +458,8 @@ Some native rustc `-Z` flags are also very relevant for Miri:
|
|||||||
Moreover, Miri recognizes some environment variables:
|
Moreover, Miri recognizes some environment variables:
|
||||||
|
|
||||||
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
|
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and toolchain setup
|
||||||
should be skipped. If it is set to any value, they are skipped. This is used for avoiding infinite
|
should be skipped. If it is set to `no`, they are skipped. This is used to allow automated IDE
|
||||||
recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
|
actions to avoid the auto ops.
|
||||||
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
|
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
|
||||||
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
|
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
|
||||||
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra
|
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra
|
||||||
|
@ -57,6 +57,10 @@ impl MiriEnv {
|
|||||||
|
|
||||||
impl Command {
|
impl Command {
|
||||||
fn auto_actions() -> Result<()> {
|
fn auto_actions() -> Result<()> {
|
||||||
|
if env::var_os("MIRI_AUTO_OPS").is_some_and(|x| x == "no") {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let miri_dir = miri_dir()?;
|
let miri_dir = miri_dir()?;
|
||||||
let auto_everything = path!(miri_dir / ".auto-everything").exists();
|
let auto_everything = path!(miri_dir / ".auto-everything").exists();
|
||||||
let auto_toolchain = auto_everything || path!(miri_dir / ".auto-toolchain").exists();
|
let auto_toolchain = auto_everything || path!(miri_dir / ".auto-toolchain").exists();
|
||||||
@ -78,6 +82,7 @@ impl Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn exec(self) -> Result<()> {
|
pub fn exec(self) -> Result<()> {
|
||||||
|
// First, and crucially only once, run the auto-actions -- but not for all commands.
|
||||||
match &self {
|
match &self {
|
||||||
Command::Install { .. }
|
Command::Install { .. }
|
||||||
| Command::Build { .. }
|
| Command::Build { .. }
|
||||||
@ -93,6 +98,7 @@ impl Command {
|
|||||||
| Command::Bench { .. }
|
| Command::Bench { .. }
|
||||||
| Command::RustcPush { .. } => {}
|
| Command::RustcPush { .. } => {}
|
||||||
}
|
}
|
||||||
|
// Then run the actual command.
|
||||||
match self {
|
match self {
|
||||||
Command::Install { flags } => Self::install(flags),
|
Command::Install { flags } => Self::install(flags),
|
||||||
Command::Build { flags } => Self::build(flags),
|
Command::Build { flags } => Self::build(flags),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user