From 0428dd5586f3c90d7e7229ffbeb505d3b33dce34 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 11 Dec 2025 18:51:58 +0100 Subject: [PATCH] miri: add -Zbinary-dep-depinfo to dependency builds --- src/tools/clippy/tests/compile-test.rs | 4 ++++ src/tools/miri/tests/ui.rs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs index 1ac6889352786..fa2b6cf268063 100644 --- a/src/tools/clippy/tests/compile-test.rs +++ b/src/tools/clippy/tests/compile-test.rs @@ -173,6 +173,10 @@ impl TestContext { p.envs.push(("RUSTC_SNAPSHOT".into(), Some(rustc.into()))); p.envs.push(("RUSTC_SNAPSHOT_LIBDIR".into(), Some(libdir.into()))); p.envs.push(("RUSTC_SYSROOT".into(), Some(sysroot.into()))); + // Ensure we rebuild the dependencies when the sysroot changes. + // (Bootstrap usually sets this automatically, but since we invoke cargo + // ourselves we have to do it.) + p.args.push("-Zbinary-dep-depinfo".into()); } p }, diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index c2cbdd5480788..338d55b9d773b 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -133,7 +133,11 @@ fn miri_config( program: miri_path() .with_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX)), // There is no `cargo miri build` so we just use `cargo miri run`. - args: ["miri", "run"].into_iter().map(Into::into).collect(), + // Add `-Zbinary-dep-depinfo` since it is needed for bootstrap builds (and doesn't harm otherwise). + args: ["miri", "run", "--quiet", "-Zbinary-dep-depinfo"] + .into_iter() + .map(Into::into) + .collect(), // Reset `RUSTFLAGS` to work around . envs: vec![("RUSTFLAGS".into(), None)], ..CommandBuilder::cargo()