./miri build: also build tests, to avoid rebuilds later

This commit is contained in:
Ralf Jung 2024-01-06 16:05:41 +01:00
parent d334a4bccf
commit 643e7f08da
3 changed files with 4 additions and 6 deletions

View File

@ -542,7 +542,6 @@ dependencies = [
"rand", "rand",
"regex", "regex",
"rustc_version", "rustc_version",
"serde",
"smallvec", "smallvec",
"ui_test", "ui_test",
] ]

View File

@ -39,11 +39,8 @@ libloading = "0.8"
colored = "2" colored = "2"
ui_test = "0.21.1" ui_test = "0.21.1"
rustc_version = "0.4" rustc_version = "0.4"
# Features chosen to match those required by env_logger, to avoid rebuilds regex = "1.5.5"
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
lazy_static = "1.4.0" lazy_static = "1.4.0"
# Require a version of serde without intransparent unreproducible binary blobs.
serde = { version = "1.0.185", features = ["derive"] }
[package.metadata.rust-analyzer] [package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]. # This crate uses #[feature(rustc_private)].

View File

@ -111,9 +111,11 @@ impl MiriEnv {
) -> Result<()> { ) -> Result<()> {
let MiriEnv { toolchain, cargo_extra_flags, .. } = self; let MiriEnv { toolchain, cargo_extra_flags, .. } = self;
let quiet_flag = if quiet { Some("--quiet") } else { None }; let quiet_flag = if quiet { Some("--quiet") } else { None };
// We build the tests as well, (a) to avoid having rebuilds when building the tests later
// and (b) to have more parallelism during the build of Miri and its tests.
let mut cmd = cmd!( let mut cmd = cmd!(
self.sh, self.sh,
"cargo +{toolchain} build {cargo_extra_flags...} --manifest-path {manifest_path} {quiet_flag...} {args...}" "cargo +{toolchain} build --bins --tests {cargo_extra_flags...} --manifest-path {manifest_path} {quiet_flag...} {args...}"
); );
cmd.set_quiet(quiet); cmd.set_quiet(quiet);
cmd.run()?; cmd.run()?;