diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edf74603b6e1..84bf54246e1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,14 +57,15 @@ jobs: # contains package information of crates installed via `cargo install`. ~/.cargo/.crates.toml ~/.cargo/.crates2.json - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-xargo0.3.25 + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'cargo-miri/version.rs') }} restore-keys: ${{ runner.os }}-cargo - name: Install rustup-toolchain-install-master and xargo shell: bash run: | cargo install rustup-toolchain-install-master - cargo install xargo + # Only install xargo if we don't have it cached + if ! which xargo; then cargo install xargo; fi - name: Install "master" toolchain shell: bash diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 373c63647c35..fd4af14e7ded 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -1,3 +1,5 @@ +mod version; + use std::env; use std::ffi::{OsStr, OsString}; use std::fmt::Write as _; @@ -9,10 +11,9 @@ use std::path::{Path, PathBuf}; use std::process::{self, Command}; use serde::{Deserialize, Serialize}; - use rustc_version::VersionMeta; -const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 23); +use version::*; const CARGO_MIRI_HELP: &str = r#"Runs binary crates and tests in Miri diff --git a/cargo-miri/version.rs b/cargo-miri/version.rs new file mode 100644 index 000000000000..366e90df1798 --- /dev/null +++ b/cargo-miri/version.rs @@ -0,0 +1,2 @@ +// We put this in a separate file so that it can be hashed for GHA caching. +pub const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 26);