Repository navigation
Pin zerocopy to 0.8.59 in the cargo-kani tests that depend on rand - #4989
Closed
feliperodri wants to merge 1 commit into
Closed
feliperodri wants to merge 1 commit into
feliperodri wants to merge 1 commit into
Conversation
zerocopy 0.8.60 added a `#[cfg(any(test, kani))]` module that uses `#[derive(KnownLayout)]`, which only exists with zerocopy's `derive` feature, so it doesn't compile under Kani as a dependency. rand 0.8 pulls zerocopy in through ppv-lite86, so these three tests fail, and with them the regression check on every PR. Remove the pin once a fixed zerocopy release is out (model-checking#4988).
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted pins consistently address the documented upstream regression without unrelated changes.
Review effort: Balanced
Findings: None
What changed in this PR
Pins zerocopy to 0.8.59 in three isolated cargo-kani test projects, restoring CI while upstream issue #4988 remains unresolved.
Changes:
- Adds the temporary exact dependency pin.
- Documents the failure and removal condition.
| File | Description |
|---|---|
tests/cargo-kani/stubbing-validate-random/Cargo.toml |
Pins zerocopy for the rand-based test. |
tests/cargo-kani/dependencies/Cargo.toml |
Pins zerocopy for dependency verification. |
tests/cargo-kani/cbmc-unknown-lang-mode/Cargo.toml |
Pins zerocopy for the language-mode test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
Closing: zerocopy fixed this upstream in 0.8.61 (google/zerocopy#3792), and these tests now resolve to 0.8.62 and pass without a pin. I checked the three tests on the toolchain-bump branch (#4987) with no pin: all pass. |
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.
The required regression check currently fails on every PR, and on main's nightly runs, in three
cargo-kanitests:cbmc-unknown-lang-mode,dependenciesandstubbing-validate-random. The cause is azerocopyrelease, not Kani (#4988).zerocopy0.8.60, released 2026-10-05, added a#[cfg(any(test, kani))]module that uses#[derive(KnownLayout)]. That derive only exists withzerocopy'sderivefeature. Kani compiles dependencies with--cfg kani, so the module gets built without the feature and fails. These three tests depend onrand0.8, which pulls inzerocopythroughppv-lite86. The test projects have no lockfile, so they picked up 0.8.60 as soon as it was published.This PR adds
zerocopy = "=0.8.59"to the three tests'Cargo.toml, with a comment pointing at #4988. Cargo has to resolve the whole tree to that version, and nothing else is pinned. It's a stopgap: oncezerocopypublishes a fixed release, revert this.Testing. The
cargo-kanisuite passes locally onmainwith this change (71 of 71). Before it, those three tests fail withcannot find derive macro KnownLayout. In a one-dependency crate on Kanimain,zerocopy = "=0.8.60"fails and=0.8.59verifies.For reviewers. The alternative is to enable
zerocopy'sderivefeature in these tests, which also compiles. I went with the pin because it keeps the tests on the exact dependency code they had before 2026-10-05.Towards #4988 (the issue stays open until
zerocopyis fixed and the pin removed).