diff --git a/xtask/src/bin_version.rs b/xtask/src/bin_version.rs index 8b31108a..2a179453 100644 --- a/xtask/src/bin_version.rs +++ b/xtask/src/bin_version.rs @@ -11,3 +11,4 @@ pub const TYPOS_CLI: CargoPackage = CargoPackage::new("typos-cli", "1.29.5").wit pub const DIPLOMAT_TOOL: CargoPackage = CargoPackage::new("diplomat-tool", "0.7.1"); pub const WABT_VERSION: &str = "1.0.36"; +pub const NIGHTLY_TOOLCHAIN: &str = "nightly-2025-07-28"; diff --git a/xtask/src/cov.rs b/xtask/src/cov.rs index 85ab8067..4c957d85 100644 --- a/xtask/src/cov.rs +++ b/xtask/src/cov.rs @@ -160,8 +160,12 @@ pub fn report_github(sh: &Shell, repo: &str, pr_id: u32) -> anyhow::Result<()> { pub fn grcov(sh: &Shell) -> anyhow::Result<()> { let _s = Section::new("COV-GRCOV"); - cmd!(sh, "rustup install nightly --profile=minimal").run()?; - cmd!(sh, "rustup component add --toolchain nightly llvm-tools-preview").run()?; + cmd!(sh, "rustup install {NIGHTLY_TOOLCHAIN} --profile=minimal").run()?; + cmd!( + sh, + "rustup component add --toolchain {NIGHTLY_TOOLCHAIN} llvm-tools-preview" + ) + .run()?; cmd!(sh, "rustup component add llvm-tools-preview").run()?; cargo_install(sh, &CARGO_FUZZ)?; @@ -181,7 +185,7 @@ pub fn grcov(sh: &Shell) -> anyhow::Result<()> { cmd!(sh, "{CARGO} clean").run()?; for target in FUZZ_TARGETS { - cmd!(sh, "rustup run nightly cargo fuzz coverage {target}").run()?; + cmd!(sh, "rustup run {NIGHTLY_TOOLCHAIN} cargo fuzz coverage {target}").run()?; } cmd!(sh, "cp -r ./target ../coverage/binaries/").run()?; @@ -192,7 +196,7 @@ pub fn grcov(sh: &Shell) -> anyhow::Result<()> { cmd!(sh, "{CARGO} clean").run()?; - cmd!(sh, "rustup run nightly cargo test --workspace") + cmd!(sh, "rustup run {NIGHTLY_TOOLCHAIN} cargo test --workspace") .env("CARGO_INCREMENTAL", "0") .env("RUSTFLAGS", "-C instrument-coverage") .env("LLVM_PROFILE_FILE", "./coverage/default-%m-%p.profraw") diff --git a/xtask/src/fuzz.rs b/xtask/src/fuzz.rs index 29a731c5..08acf60b 100644 --- a/xtask/src/fuzz.rs +++ b/xtask/src/fuzz.rs @@ -17,9 +17,7 @@ pub fn corpus_minify(sh: &Shell, target: Option) -> anyhow::Result<()> { }; for target in targets { - cmd!(sh, "rustup run nightly cargo fuzz cmin {target}") - .env("RUSTUP_TOOLCHAIN", "nightly") - .run()?; + cmd!(sh, "rustup run {NIGHTLY_TOOLCHAIN} cargo fuzz cmin {target}").run()?; } Ok(()) @@ -63,7 +61,7 @@ pub fn install(sh: &Shell) -> anyhow::Result<()> { cargo_install(sh, &CARGO_FUZZ)?; - cmd!(sh, "rustup install nightly --profile=minimal").run()?; + cmd!(sh, "rustup install {NIGHTLY_TOOLCHAIN} --profile=minimal").run()?; Ok(()) } @@ -86,9 +84,8 @@ pub fn run(sh: &Shell, duration: Option, target: Option) -> anyhow: for target in targets { cmd!( sh, - "rustup run nightly cargo fuzz run {target} -- -max_total_time={duration}" + "rustup run {NIGHTLY_TOOLCHAIN} cargo fuzz run {target} -- -max_total_time={duration}" ) - .env("RUSTUP_TOOLCHAIN", "nightly") .run()?; }