diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edf74603b6e..f34e92571ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,8 @@ jobs: # we cannot reuse anyway when the nightly changes (and it grows quite large # over time). - name: Add cache for cargo - uses: actions/cache@v2 + id: cache + uses: actions/cache@v3 with: path: | # Taken from . @@ -57,10 +58,11 @@ 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 + if: ${{ steps.cache.outputs.cache-hit == 'false' }} shell: bash run: | cargo install rustup-toolchain-install-master diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 373c63647c3..34904279e94 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 _; @@ -8,11 +10,10 @@ use std::ops::Not; use std::path::{Path, PathBuf}; use std::process::{self, Command}; +use rustc_version::VersionMeta; 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 00000000000..366e90df179 --- /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);