diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6df75834..3ec0b066 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,9 +59,18 @@ jobs: - uses: moonrepo/setup-rust@v1 with: targets: ${{ matrix.job.target }} + # moonrepo/setup-rust does not allow for different cache keys per matrix job + # This causes cache to be shared between `linux-gnu` and `linux-musl` builds which can cause build failures for native dependencies + # We disable the cache here and use Swatinem/rust-cache instead + cache: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Use this in place of the moonrepo/setup-rust cache, see above for explanation + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ matrix.job.target }} + - uses: taiki-e/install-action@v2 with: tool: cross@0.2.5 diff --git a/crates/cargo-codspeed/src/build.rs b/crates/cargo-codspeed/src/build.rs index 70e88a66..4cc28b83 100644 --- a/crates/cargo-codspeed/src/build.rs +++ b/crates/cargo-codspeed/src/build.rs @@ -225,8 +225,8 @@ See `cargo codspeed build --help` for more information."); "-Cstrip=none".to_owned(), ]; - // Add the codspeed cfg flag if instrumentation mode is enabled - if measurement_mode == MeasurementMode::Instrumentation { + // Add the codspeed cfg flag if simulation mode is enabled + if measurement_mode == MeasurementMode::Simulation { flags.push("--cfg=codspeed".to_owned()); } diff --git a/crates/cargo-codspeed/src/measurement_mode.rs b/crates/cargo-codspeed/src/measurement_mode.rs index 3416adeb..171ac611 100644 --- a/crates/cargo-codspeed/src/measurement_mode.rs +++ b/crates/cargo-codspeed/src/measurement_mode.rs @@ -6,7 +6,8 @@ use std::fmt; #[serde(rename_all = "lowercase")] pub enum MeasurementMode { #[default] - Instrumentation, + #[value(alias = "instrumentation")] + Simulation, Walltime, } @@ -16,7 +17,7 @@ impl fmt::Display for MeasurementMode { f, "{}", match self { - MeasurementMode::Instrumentation => "instrumentation", + MeasurementMode::Simulation => "simulation", MeasurementMode::Walltime => "walltime", } ) diff --git a/crates/cargo-codspeed/tests/simple-bencher.rs b/crates/cargo-codspeed/tests/simple-bencher.rs index d1643a05..1a1a1037 100644 --- a/crates/cargo-codspeed/tests/simple-bencher.rs +++ b/crates/cargo-codspeed/tests/simple-bencher.rs @@ -13,7 +13,7 @@ fn test_simple_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); + .stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/simple-criterion.rs b/crates/cargo-codspeed/tests/simple-criterion.rs index 3dc3e2e6..5dddb940 100644 --- a/crates/cargo-codspeed/tests/simple-criterion.rs +++ b/crates/cargo-codspeed/tests/simple-criterion.rs @@ -15,7 +15,7 @@ fn test_criterion_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); + .stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/simple-divan.rs b/crates/cargo-codspeed/tests/simple-divan.rs index 46a72fcd..b9101a41 100644 --- a/crates/cargo-codspeed/tests/simple-divan.rs +++ b/crates/cargo-codspeed/tests/simple-divan.rs @@ -15,7 +15,7 @@ fn test_divan_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); + .stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first.")); teardown(dir); } diff --git a/crates/cargo-codspeed/tests/workspace.rs b/crates/cargo-codspeed/tests/workspace.rs index 4bbae74e..f86be9a0 100644 --- a/crates/cargo-codspeed/tests/workspace.rs +++ b/crates/cargo-codspeed/tests/workspace.rs @@ -12,7 +12,7 @@ fn test_workspace_run_without_build() { .arg("run") .assert() .failure() - .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); + .stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first.")); teardown(dir); } @@ -62,7 +62,7 @@ fn test_workspace_build_subpackage_and_run_other() { .args(["--package", "package-b"]) .assert() .failure() - .stderr(contains("Error: No benchmarks found for the instrumentation mode. Run `cargo codspeed build -m instrumentation` first.")); + .stderr(contains("Error: No benchmarks found for the simulation mode. Run `cargo codspeed build -m simulation` first.")); teardown(dir); }