Fix CI bench compile check (#14728)

# Objective

- Fixes #14723 

## Solution

- add the manifest path to the cargo command

## Testing

- ran `cargo run -p ci -- bench-check` locally
This commit is contained in:
Mike 2024-08-14 06:23:00 -07:00 committed by GitHub
parent 46e8c6b662
commit 3d460e98ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View file

@ -13,13 +13,16 @@ criterion = { version = "0.3", features = ["html_reports"] }
bevy_app = { path = "../crates/bevy_app" }
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
bevy_hierarchy = { path = "../crates/bevy_hierarchy" }
bevy_internal = { path = "../crates/bevy_internal" }
bevy_math = { path = "../crates/bevy_math" }
bevy_reflect = { path = "../crates/bevy_reflect", features = ["functions"] }
bevy_render = { path = "../crates/bevy_render" }
bevy_tasks = { path = "../crates/bevy_tasks" }
bevy_utils = { path = "../crates/bevy_utils" }
# make bevy_render compile on linux. x11 vs wayland does not matter here as the benches do not actually use a window
[target.'cfg(target_os = "linux")'.dev-dependencies]
bevy_winit = { path = "../crates/bevy_winit", features = ["x11"] }
[profile.release]
opt-level = 3
lto = true

View file

@ -1,6 +1,6 @@
use std::time::Duration;
use bevy_reflect::{DynamicStruct, GetField, Reflect, Struct};
use bevy_reflect::{DynamicStruct, GetField, PartialReflect, Reflect, Struct};
use criterion::{
black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput,
};
@ -62,7 +62,7 @@ fn concrete_struct_apply(criterion: &mut Criterion) {
// Use functions that produce trait objects of varying concrete types as the
// input to the benchmark.
let inputs: &[fn() -> (Box<dyn Struct>, Box<dyn Reflect>)] = &[
let inputs: &[fn() -> (Box<dyn Struct>, Box<dyn PartialReflect>)] = &[
|| (Box::new(Struct16::default()), Box::new(Struct16::default())),
|| (Box::new(Struct32::default()), Box::new(Struct32::default())),
|| (Box::new(Struct64::default()), Box::new(Struct64::default())),
@ -240,7 +240,7 @@ fn dynamic_struct_apply(criterion: &mut Criterion) {
group.warm_up_time(WARM_UP_TIME);
group.measurement_time(MEASUREMENT_TIME);
let patches: &[(fn() -> Box<dyn Reflect>, usize)] = &[
let patches: &[(fn() -> Box<dyn PartialReflect>, usize)] = &[
(|| Box::new(Struct16::default()), 16),
(|| Box::new(Struct32::default()), 32),
(|| Box::new(Struct64::default()), 64),

View file

@ -10,7 +10,10 @@ pub struct BenchCheckCommand {}
impl Prepare for BenchCheckCommand {
fn prepare<'a>(&self, sh: &'a xshell::Shell, _flags: Flag) -> Vec<PreparedCommand<'a>> {
vec![PreparedCommand::new::<Self>(
cmd!(sh, "cargo check --benches --target-dir ../target"),
cmd!(
sh,
"cargo check --benches --target-dir ../target --manifest-path ./benches/Cargo.toml"
),
"Failed to check the benches.",
)]
}