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

Fix tests and lints for new version of Rust #848

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

jeffcharles
Copy link
Collaborator

Description of the change

The update to Rust 1.83 seems to have resulted in some parts of CI failing. This makes a few changes to get it passing:

  • Elide some lifetimes
  • Adjust target fuel slightly lower
  • Add #![allow(static_mut_refs)] to a couple modules

Why am I making this change?

We need CI to pass. For the #![allow(static_mut_refs)], I looked into some alternatives but wasn't able to find a satisfying alternative. In the plugin, using another approach is going to introduce some overhead. In the codegen, I tried moving setting up the WASI context into the closure used to add WASI p1 to the linker in make_linker but that causes building modules to hang and apparently that's not unexpected (see bytecodealliance/wasmtime#9723). I also tried using an "immutable" static RefCell but the Rust compiler complains that WasiCtx doesn't implement 'sync. And trying to put a mutex around the RefCell or using an RwLock doesn't work because the closure needs to return a mutable reference but has to drop the lock when it returns which invalidates the reference. Arc's also aren't supported as a top-level type for statics.

Checklist

  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli and javy-plugin do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

@jeffcharles jeffcharles marked this pull request as ready for review December 4, 2024 15:50
@saulecabrera saulecabrera merged commit 26cc610 into main Dec 4, 2024
4 checks passed
@saulecabrera saulecabrera deleted the jc.fix-lint-and-tests branch December 4, 2024 18:42
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.

2 participants