Hotfix CI: collapsible_else_if + tooling-job Rust versions#9
Merged
Conversation
PR #6's CI failed on first run after merge. Three concrete fixes: 1. `wohl-leak/plain/src/engine.rs`: clippy 1.85 catches collapsible_else_if in the wet/dry branch. Refactored to early-return style — same logic, no nested else. (My local clippy 1.95 didn't fire the lint, which is why the merge slipped through. Now verified with `cargo +1.85.0 clippy` to match CI.) 2. `kani` job toolchain: 1.85.0 → stable. kani-verifier 0.67's transitive dep `home@0.5.12` requires rustc 1.88+. Kani itself uses its own internal nightly for the proofs; the outer toolchain only needs to build the installer. 3. `rivet-validate` job toolchain: 1.85.0 → stable. rivet-cli 0.10.1 declares rust-version 1.89 (darling 0.23, smol_str 0.3.6, rivet-core 0.10.1 all need 1.88-1.89). MSRV doesn't apply to tooling. `lint` and `test` jobs keep 1.85.0 — that's the project MSRV and we want CI to verify the project still builds against it. `fuzz-smoke` job kept on `nightly` — log was unretrievable due to GitHub API TLS hiccups; if it still fails, separate follow-up. Verification (local, +1.85.0 toolchain matching CI's lint/test): - cargo +1.85.0 clippy --workspace --all-targets -- -D warnings: clean - cargo +1.85.0 fmt -p <each> --check: clean for all 8 members - cargo +1.85.0 test --workspace: pass - YAML parse: OK Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo install --locked cargo-fuzz pins cargo-fuzz 0.13.1's Cargo.lock,
which pins rustix 0.36.5. That old rustix uses unstable rustc_attrs:
#[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0xf001))]
Current nightly compilers don't accept this without `--cfg=rustc_attrs`,
so the install step fails with:
error: cannot find attribute `rustc_layout_scalar_valid_range_start`
in this scope
Removing --locked lets cargo resolve rustix to a newer version that
compiles cleanly. Mild reproducibility cost (no Cargo.lock pin for the
fuzz tool install), but the alternative is having no fuzz job at all.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo-fuzz on wohl-temp panicked at engine.rs:106 because
`zone_id * 2` overflows for zone_id > u32::MAX / 2. Same pattern in
wohl-air (`zone_id * 6` at engine.rs:120, 151).
Kani's `verify_no_panic` harnesses on these crates have
`kani::assume(zone_id < 100)`, so they only proved no-panic for small
zone_ids. Fuzz exposed the unproven range — exactly what fuzz is for.
Fix: `.saturating_mul(N)` and `.saturating_add(1)` so adversarial u32
zone_ids cannot panic. Since MAX_ZONES is 32 (16 for air), real
zone_ids cannot reach the saturation point — the collision bucket only
affects pathological inputs.
Verified:
- cargo +1.85.0 clippy: clean
- cargo +1.85.0 fmt -p wohl-{temp,air}: clean
- cargo test -p wohl-temp -p wohl-air: pass
- cargo +nightly fuzz run fuzz_temp -- -max_total_time=15: 863k runs,
no crash (previously panicked within seconds)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this PR exists
PR #6 (foundation) just merged but CI on main failed on 4 of 5 jobs. This hotfix addresses three concrete root causes. The fourth (
fuzz-smoke) had its log truncated by a GitHub API TLS hiccup at investigation time — keeping it onnightlyand will diagnose separately if it still fails after this lands.Fixes
1.
wohl-leak/plain/src/engine.rs—clippy::collapsible_else_ifClippy on Rust 1.85.0 flagged a
} else { if ... } else { ... }pattern at line 83 that clippy 1.95 (my local) doesn't fire. The fix is to use early-return style instead of nested else. Logic is identical.2.
kanijob: Rust toolchain 1.85.0 → stable```
error: rustc 1.85.0 is not supported by the following package:
home@0.5.12 requires rustc 1.88
```
`kani-verifier@0.67`'s transitive dep
homeneeds Rust 1.88+. Kani itself uses an internal nightly for proofs; the outer toolchain only needs to build the installer.3.
rivet-validatejob: Rust toolchain 1.85.0 → stable```
error: rustc 1.85.0 is not supported by the following packages:
darling@0.23.0 requires rustc 1.88.0
rivet-cli@0.10.1 requires rustc 1.89
```
MSRV doesn't apply to tooling. Keep `lint` and `test` jobs on 1.85.0 to verify project MSRV.
Why local missed the collapsible_else_if
My local toolchain (clippy 1.95) doesn't fire `collapsible_else_if` on this pattern; clippy 1.85 (which CI runs) does. Installed Rust 1.85.0 locally to match CI's lint job exactly. Repro now reproducible:
Verification (local, +1.85.0 matching CI)
CI on this PR will be the real test for Kani install + fuzz + rivet-cli build.
Out of scope
🤖 Generated with Claude Code