Skip to content

Commit 3d460e9

Browse files
authored
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
1 parent 46e8c6b commit 3d460e9

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

benches/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ criterion = { version = "0.3", features = ["html_reports"] }
1313
bevy_app = { path = "../crates/bevy_app" }
1414
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
1515
bevy_hierarchy = { path = "../crates/bevy_hierarchy" }
16-
bevy_internal = { path = "../crates/bevy_internal" }
1716
bevy_math = { path = "../crates/bevy_math" }
1817
bevy_reflect = { path = "../crates/bevy_reflect", features = ["functions"] }
1918
bevy_render = { path = "../crates/bevy_render" }
2019
bevy_tasks = { path = "../crates/bevy_tasks" }
2120
bevy_utils = { path = "../crates/bevy_utils" }
2221

22+
# make bevy_render compile on linux. x11 vs wayland does not matter here as the benches do not actually use a window
23+
[target.'cfg(target_os = "linux")'.dev-dependencies]
24+
bevy_winit = { path = "../crates/bevy_winit", features = ["x11"] }
25+
2326
[profile.release]
2427
opt-level = 3
2528
lto = true

benches/benches/bevy_reflect/struct.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::time::Duration;
22

3-
use bevy_reflect::{DynamicStruct, GetField, Reflect, Struct};
3+
use bevy_reflect::{DynamicStruct, GetField, PartialReflect, Reflect, Struct};
44
use criterion::{
55
black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput,
66
};
@@ -62,7 +62,7 @@ fn concrete_struct_apply(criterion: &mut Criterion) {
6262

6363
// Use functions that produce trait objects of varying concrete types as the
6464
// input to the benchmark.
65-
let inputs: &[fn() -> (Box<dyn Struct>, Box<dyn Reflect>)] = &[
65+
let inputs: &[fn() -> (Box<dyn Struct>, Box<dyn PartialReflect>)] = &[
6666
|| (Box::new(Struct16::default()), Box::new(Struct16::default())),
6767
|| (Box::new(Struct32::default()), Box::new(Struct32::default())),
6868
|| (Box::new(Struct64::default()), Box::new(Struct64::default())),
@@ -240,7 +240,7 @@ fn dynamic_struct_apply(criterion: &mut Criterion) {
240240
group.warm_up_time(WARM_UP_TIME);
241241
group.measurement_time(MEASUREMENT_TIME);
242242

243-
let patches: &[(fn() -> Box<dyn Reflect>, usize)] = &[
243+
let patches: &[(fn() -> Box<dyn PartialReflect>, usize)] = &[
244244
(|| Box::new(Struct16::default()), 16),
245245
(|| Box::new(Struct32::default()), 32),
246246
(|| Box::new(Struct64::default()), 64),

tools/ci/src/commands/bench_check.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ pub struct BenchCheckCommand {}
1010
impl Prepare for BenchCheckCommand {
1111
fn prepare<'a>(&self, sh: &'a xshell::Shell, _flags: Flag) -> Vec<PreparedCommand<'a>> {
1212
vec![PreparedCommand::new::<Self>(
13-
cmd!(sh, "cargo check --benches --target-dir ../target"),
13+
cmd!(
14+
sh,
15+
"cargo check --benches --target-dir ../target --manifest-path ./benches/Cargo.toml"
16+
),
1417
"Failed to check the benches.",
1518
)]
1619
}

0 commit comments

Comments
 (0)