Stream: wasmtime

Topic: Compiler error on wasmtime-wasi 10.0.1


view this post on Zulip alisomay (Jun 30 2023 at 09:15):

I'm having trouble compiling wasmtime-wasi.

I'm on stable-aarch64-apple-darwin, Rust 1.70

My other dependencies are

[dependencies]
wasmtime = { version = "=10.0.1", features = ["component-model"] }
wasmtime-wasi = "=10.0.1"
anyhow = "1"
transformer = { path = "../transformer" }
tokio = { version = "1.11.0", features = ["rt-multi-thread", "macros"] }
   Compiling wasmtime-wasi v10.0.1
error[E0631]: type mismatch in function arguments
    --> /Users/vallahiboyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-wasi-10.0.1/src/preview2/preview2/filesystem.rs:408:26
     |
408  |                 atim.map(cap_fs_ext::SystemTimeSpec::from_std),
     |                      --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |                      |   |
     |                      |   expected due to this
     |                      |   found signature defined here
     |                      required by a bound introduced by this call
     |
     = note: expected function signature `fn(fs_set_times::SystemTimeSpec) -> _`
                found function signature `fn(fs_set_times::system_time_spec::SystemTimeSpec) -> _`
note: required by a bound in `std::option::Option::<T>::map`
    --> /Users/vallahiboyle/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:1095:12
     |
1095 |         F: ~const FnOnce(T) -> U,
     |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`

error[E0631]: type mismatch in function arguments
    --> /Users/vallahiboyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-wasi-10.0.1/src/preview2/preview2/filesystem.rs:409:26
     |
409  |                 mtim.map(cap_fs_ext::SystemTimeSpec::from_std),
     |                      --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |                      |   |
     |                      |   expected due to this
     |                      |   found signature defined here
     |                      required by a bound introduced by this call
     |
     = note: expected function signature `fn(fs_set_times::SystemTimeSpec) -> _`
                found function signature `fn(fs_set_times::system_time_spec::SystemTimeSpec) -> _`
note: required by a bound in `std::option::Option::<T>::map`
    --> /Users/vallahiboyle/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:1095:12
     |
1095 |         F: ~const FnOnce(T) -> U,
     |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`

error[E0631]: type mismatch in function arguments
    --> /Users/vallahiboyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-wasi-10.0.1/src/preview2/preview2/filesystem.rs:414:26
     |
414  |                 atim.map(cap_fs_ext::SystemTimeSpec::from_std),
     |                      --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |                      |   |
     |                      |   expected due to this
     |                      |   found signature defined here
     |                      required by a bound introduced by this call
     |
     = note: expected function signature `fn(fs_set_times::SystemTimeSpec) -> _`
                found function signature `fn(fs_set_times::system_time_spec::SystemTimeSpec) -> _`
note: required by a bound in `std::option::Option::<T>::map`
    --> /Users/vallahiboyle/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:1095:12
     |
1095 |         F: ~const FnOnce(T) -> U,
     |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`

error[E0631]: type mismatch in function arguments
    --> /Users/vallahiboyle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-wasi-10.0.1/src/preview2/preview2/filesystem.rs:415:26
     |
415  |                 mtim.map(cap_fs_ext::SystemTimeSpec::from_std),
     |                      --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |                      |   |
     |                      |   expected due to this
     |                      |   found signature defined here
     |                      required by a bound introduced by this call
     |
     = note: expected function signature `fn(fs_set_times::SystemTimeSpec) -> _`
                found function signature `fn(fs_set_times::system_time_spec::SystemTimeSpec) -> _`
note: required by a bound in `std::option::Option::<T>::map`
    --> /Users/vallahiboyle/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:1095:12
     |
1095 |         F: ~const FnOnce(T) -> U,
     |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`

For more information about this error, try `rustc --explain E0631`.
error: could not compile `wasmtime-wasi` (lib) due to 4 previous errors

Some help would be appreciated thanks a lot :pray:

view this post on Zulip alisomay (Jun 30 2023 at 09:20):

The error seems simple but since it is a published package I suppose this is happening because of a version clash of some sort.

view this post on Zulip alisomay (Jun 30 2023 at 09:57):

I've also filed an issue
https://github.com/bytecodealliance/wasmtime/issues/6674

Steps to Reproduce cargo init temp_project --bin Add wasmtime-wasi = "=10.0.1" as a dependency Run cargo build Expected Results Successful build. Actual Results Blocking waiting for file lock on bu...

view this post on Zulip alisomay (Jun 30 2023 at 10:38):

A workaround for this is pinning.

[dependencies]
wasmtime-wasi = "=10.0.1"
cap-fs-ext = "=1.0.15"
cap-primitives = "=1.0.15"
cap-std = "=1.0.15"

cap-x 1.0.16 and up is the issue.

When we run cargo clean or update the transative dependency goes above 1.0.15.

I still leave it open since the maintainers would update to 1.0.16 and above in cap dependencies.

view this post on Zulip alisomay (Jul 01 2023 at 19:13):

This issue is resolved. :tada:
https://github.com/bytecodealliance/cap-std/issues/324
https://github.com/bytecodealliance/wasmtime/issues/6674#event-9690975285

In #321 the cap-primitives crate updated its dependency on fs-set-times from 0.19.x to 0.20.x, but the fs-set-times types are part of the public API of cap-primitives via the from_std and into_std ...
Steps to Reproduce cargo init temp_project --bin Add wasmtime-wasi = "=10.0.1" as a dependency Run cargo build Expected Results Successful build. Actual Results Blocking waiting for file lock on bu...

Last updated: Oct 23 2024 at 20:03 UTC