Skip to content

Commit 18641a4

Browse files
adriencacciaclaude
andauthored
chore: bump the Rust toolchain from 1.88.0 to 1.100.0 (#632)
Current rust-analyzer releases no longer support 1.88.0. Fix the lints clippy 1.100.0 adds, mostly nested `if`s collapsed into let chains, and drop the `unsafe` around `__cpuid`, which is now safe. Remove the dependencies cargo 1.100.0 reports as unused: `which` and `perf-event-open-sys` in the workspace, `object` and the `cc` build dependency in exec-harness, `static_assertions` in memtrack. Closes COD-4371 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent da1260d commit 18641a4

23 files changed

Lines changed: 133 additions & 148 deletions

File tree

‎Cargo.lock‎

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ tabled = { version = "0.20.0", features = ["ansi"] }
7878
shell-words = "1.1.1"
7979
rmp-serde = "1.3.1"
8080
uuid = { version = "1.23.1", features = ["v4"] }
81-
which = "8.0.2"
8281
crc32fast = "1.5.0"
8382
samply = { path = "crates/samply-codspeed/samply" }
8483
bytes = "1"
@@ -129,7 +128,6 @@ ipc-channel = "0.20"
129128
itertools = "0.14.0"
130129
rayon = "1.12"
131130
linux-perf-event-reader = "0.10.2" # matches the version linux-perf-data resolves to
132-
perf-event-open-sys = "6.0"
133131
env_logger = "0.11.10"
134132
tempfile = "3.27.0"
135133
object = { version = "0.39", default-features = false, features = ["read_core", "elf"] }

‎crates/exec-harness/Cargo.toml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ serde = { workspace = true }
2020
humantime = "2.3"
2121
runner-shared = { path = "../runner-shared" }
2222
tempfile = { workspace = true }
23-
object = { workspace = true }
2423

2524
[dev-dependencies]
2625
rstest = { workspace = true }
2726

28-
[build-dependencies]
29-
cc = "1"
30-
3127
# Bundled in the runner binary, not released on its own.
3228
[package.metadata.dist]
3329
dist = false

‎crates/exec-harness/src/walltime/benchmark_loop.rs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,18 @@ where
172172
if let [(start, end)] = warmup_timestamps.as_slice() {
173173
let single_warmup_round_duration_ns = end - start;
174174
match config.max {
175-
Some(RoundOrTime::TimeNs(time_ns)) | Some(RoundOrTime::Both { time_ns, .. }) => {
176-
if time_ns <= single_warmup_round_duration_ns {
177-
info!(
178-
"A single warmup execution ({}) exceeded or met max_time ({}). No more rounds will be performed.",
179-
format_ns(single_warmup_round_duration_ns),
180-
format_ns(time_ns)
181-
);
182-
return Ok(WarmupResult::EarlyReturn {
183-
start: *start,
184-
end: *end,
185-
});
186-
}
175+
Some(RoundOrTime::TimeNs(time_ns)) | Some(RoundOrTime::Both { time_ns, .. })
176+
if time_ns <= single_warmup_round_duration_ns =>
177+
{
178+
info!(
179+
"A single warmup execution ({}) exceeded or met max_time ({}). No more rounds will be performed.",
180+
format_ns(single_warmup_round_duration_ns),
181+
format_ns(time_ns)
182+
);
183+
return Ok(WarmupResult::EarlyReturn {
184+
start: *start,
185+
end: *end,
186+
});
187187
}
188188
_ => { /* No max time constraint */ }
189189
}

‎crates/exec-harness/src/walltime/config.rs‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,22 +180,21 @@ impl TryFrom<WalltimeExecutionArgs> for ExecutionOptions {
180180
.context("Invalid min_time")?;
181181

182182
// Validation: min_xxx cannot be greater than max_xxx (for same dimension)
183-
if max_time_ns > 0 {
184-
if let Some(min) = min_time_ns {
185-
if min > max_time_ns {
186-
bail!(
187-
"min_time ({:.2}s) cannot be greater than max_time ({:.2}s)",
188-
min as f64 / 1_000_000_000.0,
189-
max_time_ns as f64 / 1_000_000_000.0
190-
);
191-
}
192-
}
183+
if max_time_ns > 0
184+
&& let Some(min) = min_time_ns
185+
&& min > max_time_ns
186+
{
187+
bail!(
188+
"min_time ({:.2}s) cannot be greater than max_time ({:.2}s)",
189+
min as f64 / 1_000_000_000.0,
190+
max_time_ns as f64 / 1_000_000_000.0
191+
);
193192
}
194193

195-
if let (Some(min), Some(max)) = (args.min_rounds, args.max_rounds) {
196-
if min > max {
197-
bail!("min_rounds ({min}) cannot be greater than max_rounds ({max})");
198-
}
194+
if let (Some(min), Some(max)) = (args.min_rounds, args.max_rounds)
195+
&& min > max
196+
{
197+
bail!("min_rounds ({min}) cannot be greater than max_rounds ({max})");
199198
}
200199

201200
// Build min/max using RoundOrTime enum

‎crates/memtrack/Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ serde_json = { workspace = true }
2929
serde = { workspace = true }
3030
runner-shared = { path = "../runner-shared" }
3131
ipc-channel = { workspace = true }
32-
static_assertions = "1.1"
3332
itertools = { workspace = true }
3433
paste = "1.0.15"
3534
libbpf-rs = { version = "0.26", features = ["vendored"], optional = true }

‎crates/memtrack/src/ebpf/events.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ pub fn fp_chain(stack_traces: &impl MapCore, stackid: i64) -> Vec<u64> {
164164

165165
// The map value is a fixed-depth array zero-padded past the last frame.
166166
value
167-
.chunks_exact(8)
168-
.map(|word| u64::from_ne_bytes(word.try_into().expect("chunks_exact yields 8 bytes")))
167+
.as_chunks::<8>()
168+
.0
169+
.iter()
170+
.map(|word| u64::from_ne_bytes(*word))
169171
.take_while(|&address| address != 0)
170172
.collect()
171173
}

‎crates/runner-shared/benches/memtrack_reader.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fn write_artifact(n: usize, payload: Payload, out: impl Write) -> usize {
109109
len: 0x8_0000,
110110
}
111111
} else if i % LIFECYCLE_INTERVAL == 0 {
112-
if (i / LIFECYCLE_INTERVAL) % 2 == 0 {
112+
if (i / LIFECYCLE_INTERVAL).is_multiple_of(2) {
113113
MemtrackEventKind::Fork { parent_pid: PID }
114114
} else {
115115
MemtrackEventKind::Exec

‎crates/runner-shared/src/perf_event.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl PerfEvent {
138138
fn is_genuine_intel() -> bool {
139139
use std::arch::x86_64::__cpuid;
140140
// CPUID leaf 0: vendor string in EBX,EDX,ECX.
141-
let leaf0 = unsafe { __cpuid(0) };
141+
let leaf0 = __cpuid(0);
142142
let mut vendor = [0u8; 12];
143143
vendor[0..4].copy_from_slice(&leaf0.ebx.to_le_bytes());
144144
vendor[4..8].copy_from_slice(&leaf0.edx.to_le_bytes());

‎rust-toolchain.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.88.0"
2+
channel = "1.100.0"
33
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)