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

wasmtime-wasi fails to compile on latest nightly #10184

Open
aumetra opened this issue Feb 4, 2025 · 5 comments
Open

wasmtime-wasi fails to compile on latest nightly #10184

aumetra opened this issue Feb 4, 2025 · 5 comments
Labels
bug Incorrect behavior in the current implementation that needs fixing

Comments

@aumetra
Copy link

aumetra commented Feb 4, 2025

Test Case

Steps to Reproduce

  • Install latest rustc version (rustc 1.86.0-nightly (f027438f8 2025-02-03))
  • Create new cargo project
  • Add wasmtime-wasi dependency
  • Try to compile

Expected Results

The program compiles without issues

Actual Results

error[E0080]: evaluation of constant value failed
   --> /home/aumetra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-wasi-29.0.1/src/bindings.rs:147:9
    |
147 | /         wasmtime::component::bindgen!({
148 | |             path: "wit",
149 | |             world: "wasi:cli/command",
150 | |             tracing: true,
...   |
180 | |             require_store_data_send: true,
181 | |         });
    | |__________^ the evaluated program panicked at 'assertion failed: 1 == <DirectoryEntry as wasmtime::component::ComponentType>::ALIGN32', /home/aumetra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-wasi-29.0.1/src/bindings.rs:147:9
    |
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation of constant value failed
   --> /home/aumetra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-wasi-29.0.1/src/bindings.rs:327:5
    |
327 | /     wasmtime::component::bindgen!({
328 | |         path: "wit",
329 | |         world: "wasi:cli/command",
330 | |         tracing: true,
...   |
416 | |         },
417 | |     });
    | |______^ the evaluated program panicked at 'assertion failed: 1 == <DirectoryEntry as wasmtime::component::ComponentType>::ALIGN32', /home/aumetra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-wasi-29.0.1/src/bindings.rs:327:5

Versions and Environment

Wasmtime version or commit: 29.0.1 on crates.io

Operating system: Linux 6.13.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Jan 19 23:51:45 UTC 2025 x86_64 GNU/Linux

Architecture: x85_64

Extra Info

N/A

@aumetra aumetra added the bug Incorrect behavior in the current implementation that needs fixing label Feb 4, 2025
@alexcrichton
Copy link
Member

Thanks for the report! This is due to bytecodealliance/wasm-tools#1999 which was a buggy implementation in a dependency of Wasmtime. I'll work on getting this fix out for Wasmtime as well. Fixing end-user builds will requiring updating the wit-parser crate that Wasmtime depends on. It'll take a moment to publish builds of fixed versions of wit-parser though because that will require a lot of patch releases for a crate where we don't have a great patch release process.

At this time there's unfortunately no fix though, so if folks run into this you'll need to pin nightlies to an older nightly temporarily.

alexcrichton added a commit to alexcrichton/wasmtime that referenced this issue Feb 5, 2025
Ensures the cause of bytecodealliance#10184 is no longer in the lock file.
alexcrichton added a commit to alexcrichton/wasmtime that referenced this issue Feb 5, 2025
Ensures the cause of bytecodealliance#10184 is no longer in the lock file.
alexcrichton added a commit to alexcrichton/wasmtime that referenced this issue Feb 5, 2025
Ensures the cause of bytecodealliance#10184 is no longer in the lock file.
alexcrichton added a commit that referenced this issue Feb 5, 2025
* Update wit-parser dependency

Ensures the cause of #10184 is no longer in the lock file.

* Add vets
alexcrichton added a commit that referenced this issue Feb 5, 2025
* Update wit-parser dependency

Ensures the cause of #10184 is no longer in the lock file.

* Add vets
@alexcrichton
Copy link
Member

Ok here's what I've done to fix this:

  • I've made a patch release of the wit-parser crate, the crate at fault here, for all versions that are affected.
  • I've updated Wasmtime's main and release-{30,29.28}.0.0 branches.

This means that cargo install [email protected] --locked will continue to fail, but if --locked is removed, for example, then it will succeed. Embedders using Wasmtime shouldn't be affected since they should be able to use the latest wit-parser dependency which will fix this issue.

The only remaining question is whether we want to publish a patch release of Wasmtime's release branches with an updated lock file. Personally I'd lean towards "no" but others might feel differently so I don't want to prematurely close this.

@aumetra can you confirm on your end that if you run cargo update -p wit-parser that the issue is resolved?

alexcrichton added a commit that referenced this issue Feb 5, 2025
Ensures the cause of #10184 is no longer in the lock file.
@pchickey
Copy link
Contributor

pchickey commented Feb 5, 2025

The only remaining question is whether we want to publish a patch release of Wasmtime's release branches with an updated lock file. Personally I'd lean towards "no" but others might feel differently so I don't want to prematurely close this.

I also lean towards "no" since in this case its as easy as dropping --locked on the cli install, and there is no bug in any of the published binaries. If a user can present some case we haven't thought of where they can't be flexible, I guess we can do it, but lets not unless asked.

@aumetra
Copy link
Author

aumetra commented Feb 5, 2025

can you confirm on your end that if you run cargo update -p wit-parser that the issue is resolved?

Verified. Updated the dependency on my program and now it successfully builds again

alexcrichton added a commit to bytecodealliance/meetings that referenced this issue Feb 6, 2025
@alexcrichton
Copy link
Member

I've added this as a discussion item to our next agenda which is in a bit due to the wasm cg meeting happening next week. Regardless though thanks @aumetra for confirming that updating wit-parser works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing
Projects
None yet
Development

No branches or pull requests

3 participants