Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newest proc_macro2 version does not work with kani-0.49.0 #3138

Closed
tautschnig opened this issue Apr 15, 2024 · 11 comments · Fixed by #3144 or google/zerocopy#1117
Closed

Newest proc_macro2 version does not work with kani-0.49.0 #3138

tautschnig opened this issue Apr 15, 2024 · 11 comments · Fixed by #3144 or google/zerocopy#1117
Labels
[C] Internal Tracks some internal work. I.e.: Users should not be affected. [I] CI / Infrastructure Work done to CI, tests and infrastructure.

Comments

@tautschnig
Copy link
Member

See https://github.com/model-checking/kani/actions/runs/8683193890/job/23808816781:

  1. It seems that, on this occasion, a manual PR with cargo updates will be required.
  2. We need to fix the CI job to make sure that compilation failures do not trigger an early abort, but instead automatically cut an issue.
@tautschnig tautschnig added the [C] Bug This is a bug. Something isn't working. label Apr 15, 2024
@tautschnig
Copy link
Member Author

Actually it seems that, even without any cargo update, suddenly various build actions fail: https://github.com/model-checking/kani/actions/runs/8692459550. No idea what changed here.

@celinval celinval added [C] Internal Tracks some internal work. I.e.: Users should not be affected. [I] CI / Infrastructure Work done to CI, tests and infrastructure. and removed [C] Bug This is a bug. Something isn't working. labels Apr 15, 2024
@joshlf
Copy link

joshlf commented Apr 15, 2024

@celinval
Copy link
Contributor

See this thread for the details: https://users.rust-lang.org/t/cannot-compile-simple-tokio-example/109956/3

But basically our nightly version matches the latest released Rust compiler, which has now stabilized proc_macro_byte_character feature. The proc_macro build script checks the Rust compiler version to see whether it needs to enable this feature.

I believe there are three different fixes we can apply:

  1. Update our toolchain version, which will hopefully have that property stabilized.
  2. Change Kani to enable the feature by default for now.
  3. Downgrade the proc_macro version.

@tautschnig
Copy link
Member Author

But I'm still with https://users.rust-lang.org/t/cannot-compile-simple-tokio-example/109956/6: what has changed? Kani neither changed its toolchain version nor the cargo dependencies. So what proc_macro version would be downgrading to when we had something that worked until a couple of hours ago?!

@celinval
Copy link
Contributor

celinval commented Apr 16, 2024

The proc_macro crate has a new minor version which includes this change. When building a project with cargo without a Cargo.lock file, cargo will download the latest minor version that matches your dependencies specification.

To go around this issue, an user can either ensure their build are locked via Cargo.lock or specify an exact version in their Cargo.toml. Any version previous to the change I just pasted should do the trick.

@celinval
Copy link
Contributor

Note that the toolchain upgrade will fix this issue as expected.

@celinval
Copy link
Contributor

@joshlf is this something that is blocking you?

@celinval celinval changed the title Attempted automatic cargo update failed with compilation error Newest proc_macro2 does not work with kani-0.49.0 Apr 16, 2024
@celinval celinval changed the title Newest proc_macro2 does not work with kani-0.49.0 Newest proc_macro2 version does not work with kani-0.49.0 Apr 16, 2024
@joshlf
Copy link

joshlf commented Apr 16, 2024

@joshlf is this something that is blocking you?

It is, yeah. We run Kani as part of CI, so it's preventing us from merging PRs (without manual override, which we'd like to avoid if possible). We use the Kani GitHub Action in our CI config rather than invoking cargo kani directly, so I'm not sure whether the Cargo.lock workaround would work for us, although I haven't tried it.

I assume that once the Kani GitHub Action can cut a new release with a more recent nightly toolchain pinned, upgrading to that new version would resolve our issue.

@celinval
Copy link
Contributor

@joshlf is this something that is blocking you?

It is, yeah. We run Kani as part of CI, so it's preventing us from merging PRs (without manual override, which we'd like to avoid if possible). We use the Kani GitHub Action in our CI config rather than invoking cargo kani directly, so I'm not sure whether the Cargo.lock workaround would work for us, although I haven't tried it.

Thanks for letting us know @joshlf. I would expect the Cargo.lock work around to work as long as there is one in the working directory.

I assume that once the Kani GitHub Action can cut a new release with a more recent nightly toolchain pinned, upgrading to that new version would resolve our issue.

That said, we are considering creating a release with the fix to unblock users without forcing them to create a workaround.

celinval added a commit that referenced this issue Apr 17, 2024
Backport toolchain upgrade to a branch off `kani-0.49.0` in preparation
for a patch release. The upgrade fixes issues seen with newer versions
of proc_macro2 (#3138).

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Co-authored-by: Michael Tautschnig <tautschn@amazon.com>
celinval added a commit that referenced this issue Apr 17, 2024
Release notes are the following:

### Major Changes
* Fix compilation issue with proc_macro2  (v1.0.80+) and Kani v0.49.0
(#3138).

### What's Changed
* Implement valid value check for `write_bytes` by @celinval in
#3108
* Rust toolchain upgraded to 2024-04-15 by @tautschnig @celinval

**Full Changelog**:
kani-0.49.0...kani-0.50.0
@celinval
Copy link
Contributor

@joshlf we have now released a new version of Kani which should fix this issue. Please let us know if you are still having trouble.

joshlf added a commit to google/zerocopy that referenced this issue Apr 18, 2024
@joshlf
Copy link

joshlf commented Apr 18, 2024

That appears to work for us, thanks!

github-merge-queue bot pushed a commit to google/zerocopy that referenced this issue Apr 18, 2024
zpzigi754 pushed a commit to zpzigi754/kani that referenced this issue May 8, 2024
Release notes are the following:

### Major Changes
* Fix compilation issue with proc_macro2  (v1.0.80+) and Kani v0.49.0
(model-checking#3138).

### What's Changed
* Implement valid value check for `write_bytes` by @celinval in
model-checking#3108
* Rust toolchain upgraded to 2024-04-15 by @tautschnig @celinval

**Full Changelog**:
model-checking/kani@kani-0.49.0...kani-0.50.0
qinheping pushed a commit to qinheping/kani that referenced this issue May 9, 2024
Release notes are the following:

### Major Changes
* Fix compilation issue with proc_macro2  (v1.0.80+) and Kani v0.49.0
(model-checking#3138).

### What's Changed
* Implement valid value check for `write_bytes` by @celinval in
model-checking#3108
* Rust toolchain upgraded to 2024-04-15 by @tautschnig @celinval

**Full Changelog**:
model-checking/kani@kani-0.49.0...kani-0.50.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Internal Tracks some internal work. I.e.: Users should not be affected. [I] CI / Infrastructure Work done to CI, tests and infrastructure.
Projects
None yet
3 participants