Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
4 changes: 2 additions & 2 deletions crates/cargo-codspeed/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
5 changes: 3 additions & 2 deletions crates/cargo-codspeed/src/measurement_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use std::fmt;
#[serde(rename_all = "lowercase")]
pub enum MeasurementMode {
#[default]
Instrumentation,
#[value(alias = "instrumentation")]
Simulation,
Walltime,
}

Expand All @@ -16,7 +17,7 @@ impl fmt::Display for MeasurementMode {
f,
"{}",
match self {
MeasurementMode::Instrumentation => "instrumentation",
MeasurementMode::Simulation => "simulation",
MeasurementMode::Walltime => "walltime",
}
)
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-codspeed/tests/simple-bencher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-codspeed/tests/simple-criterion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-codspeed/tests/simple-divan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions crates/cargo-codspeed/tests/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
Loading