Skip to content

fix: cast guest clock step seconds to c_long instead of deprecated libc::time_t - #1131

Merged
norrietaylor merged 3 commits into
mainfrom
inbox-patch/guest-clock-time-t-musl-5989b212dd344b4e
Jul 31, 2026
Merged

fix: cast guest clock step seconds to c_long instead of deprecated libc::time_t#1131
norrietaylor merged 3 commits into
mainfrom
inbox-patch/guest-clock-time-t-musl-5989b212dd344b4e

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK58D4Q

clock_step_target in crates/minimald/src/guest.rs cast the seconds argument of nix's TimeSpec::new to libc::time_t, an alias libc deprecates on musl targets (it becomes 64-bit in musl 1.2.0). The just test-cross gate runs cross clippy against *-unknown-linux-musl with -D warnings, so the deprecation is promoted to a hard error before the test step. That is the only gate compiling minimald off Linux, yet no CI lane clippies musl, so every lane stays green while the cross gate is red. The fix casts to libc::c_long instead, matching the adjacent nanoseconds argument; on the 64-bit musl targets test-cross builds, c_long and time_t are both i64, so the stepped time is unchanged. Existing clock_step_target unit tests cover the seconds/nanoseconds it produces.

Verification

  • cargo fmt --all --check — clean, no drift
  • cargo clippy --workspace --locked -- -D warnings — Finished, 0 warnings
  • cargo build --workspace --locked — Finished (dev profile)
  • cargo test --workspace --locked — 78 test binaries, all ok, 0 failed

Generated by inbox-patch ·

Note

Fix deprecated libc::time_t cast in guest::clock_step_target

Replaces the libc::time_t cast with libc::c_long when constructing nix::sys::time::TimeSpec::new in guest.rs. libc::time_t is deprecated and this cast resolves the deprecation warning with no change to runtime behavior.

Macroscope summarized f9af11f.

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.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eaa32e4f-6809-4395-bf5f-39e86f35bf87

📥 Commits

Reviewing files that changed from the base of the PR and between b9cfa7e and f9af11f.

📒 Files selected for processing (1)
  • crates/minimald/src/guest.rs

Comment @coderabbitai help to get the list of available commands.

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 08:10
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 08:10
@norrietaylor
norrietaylor merged commit c92af06 into main Jul 31, 2026
30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/guest-clock-time-t-musl-5989b212dd344b4e branch July 31, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant