fix: cast guest clock step seconds to c_long instead of deprecated libc::time_t - #1131
Conversation
clock_step_target cast its tv_sec argument to nix's TimeSpec::new via libc::time_t, which libc deprecates on musl targets (it becomes 64-bit in musl 1.2.0). The just test-cross recipe runs cross clippy against *-unknown-linux-musl with -D warnings, so the deprecation is promoted to a hard error and the build never reaches the test step. No CI lane clippies musl, so every lane stays green while the macOS cross gate goes red. Cast to libc::c_long instead, matching the adjacent tv_nsec argument. On the 64-bit musl targets test-cross builds, c_long and time_t are both i64, so the stepped time value is unchanged.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK58D4Q
clock_step_targetincrates/minimald/src/guest.rscast the seconds argument ofnix'sTimeSpec::newtolibc::time_t, an aliaslibcdeprecates on musl targets (it becomes 64-bit in musl 1.2.0). Thejust test-crossgate runscross clippyagainst*-unknown-linux-muslwith-D warnings, so the deprecation is promoted to a hard error before the test step. That is the only gate compilingminimaldoff Linux, yet no CI lane clippies musl, so every lane stays green while the cross gate is red. The fix casts tolibc::c_longinstead, matching the adjacent nanoseconds argument; on the 64-bit musl targetstest-crossbuilds,c_longandtime_tare bothi64, so the stepped time is unchanged. Existingclock_step_targetunit tests cover the seconds/nanoseconds it produces.Verification
cargo fmt --all --check— clean, no driftcargo clippy --workspace --locked -- -D warnings— Finished, 0 warningscargo build --workspace --locked— Finished (dev profile)cargo test --workspace --locked— 78 test binaries, all ok, 0 failedNote
Fix deprecated
libc::time_tcast inguest::clock_step_targetReplaces the
libc::time_tcast withlibc::c_longwhen constructingnix::sys::time::TimeSpec::newin guest.rs.libc::time_tis deprecated and this cast resolves the deprecation warning with no change to runtime behavior.Macroscope summarized f9af11f.