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

Failed to install wasmi_cli: raw mutable pointers are not allowed in statics (Rust 1.77.1) #1091

Closed
MagicalTux opened this issue Jun 26, 2024 · 4 comments · Fixed by #1093
Closed

Comments

@MagicalTux
Copy link

I tried to run cargo install wasmi_cli to test this lib but got the following:

error[E0658]: raw mutable pointers are not allowed in statics
   --> /home/magicaltux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmi-0.33.0/src/engine/executor/cache.rs:273:37
    |
273 |     unsafe { NonNull::new_unchecked(ptr::addr_of_mut!(ZERO_CELL)) }
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = note: this error originates in the macro `ptr::addr_of_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0658`.
error: could not compile `wasmi` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
@Robbepop
Copy link
Member

Whlith which Rust compiler version did you try.to install Wasmi? I have never seen this error before during development. Maybe Wasmi CI should be extended to cover certain missing specs.

@MagicalTux
Copy link
Author

After some testing this seems to be linked to rustc version

By default I was using rustc 1.77.1 (7cf61ebde 2024-03-27) (gentoo) but upgrading to 1.79.0 allowed me to compile wasmi_cli successfully

@Robbepop
Copy link
Member

Thanks a lot for the response and the bug report. I will have to see why this occurs in v1.77.1 to eventually close this issue.

@Robbepop Robbepop changed the title Failed to install wasmi_cli crate: raw mutable pointers are not allowed in statics Failed to install wasmi_cli: raw mutable pointers are not allowed in statics (Rust 1.77.1) Jun 30, 2024
@Robbepop
Copy link
Member

Failure in Rust 1.77.1 (and previous versions) occurs while Rust 1.78 compiles fine is due to this change:
rust-lang/rust#117614

I was not aware how new this change actually was.
Since Wasmi is pinned to Rust 1.77 we probably want to address this to keep Wasmi compilable with Rust 1.77.

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 a pull request may close this issue.

2 participants