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

wasi-common/sync still introduces dependency on Wasmtime, but why? #9009

Closed
Robbepop opened this issue Jul 25, 2024 · 4 comments
Closed

wasi-common/sync still introduces dependency on Wasmtime, but why? #9009

Robbepop opened this issue Jul 25, 2024 · 4 comments

Comments

@Robbepop
Copy link
Contributor

Robbepop commented Jul 25, 2024

Recently we merged #8900 to remove the wasmtime optional dependency from wasi-common/sync since it was unused mostly.

This had the effect that users could use wasi-common with its sync feature without pulling in the giantic Wasmtime dependency ... or so I thought.
Today I wanted to use wasi-common v23.0.1 (including this improvement) into Wasmi's wasmi_wasi crate and to my surprise Cargo pulled Wasmtime via the wasi-common dependency.
When I removed the sync feature usage (which is kinda critical unfortunately) the Wasmtime dependency was gone.

I am seriously confused as to why this happens. Looking at wasi-common's Cargo.toml file does not help my confusion.
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-common/Cargo.toml

Any help or clarification?

tl;dr:

This pulls Wasmtime:

[dependencies]
wasi-common = { version = "23.0.1", default-features = false, features = ["sync"] }

And this does not:

[dependencies]
wasi-common = { version = "23.0.1", default-features = false }

But why?

Robbepop added a commit to wasmi-labs/wasmi that referenced this issue Jul 25, 2024
This makes it possible to remove the old and outdated `wasi-cap-std-sync` dependency altogether.

Unfortunately with this update the `wasi-common` crate still pulls the huge `wasmtime` dependency into Wasmi and I am a bit confused why this happens.

Issue: bytecodealliance/wasmtime#9009
@Robbepop
Copy link
Contributor Author

Here is a Wasmi PR with which you can reproduce the issue: wasmi-labs/wasmi#1140

@Robbepop
Copy link
Contributor Author

Building wasmi_wasi with

cargo build -p wasmi_wasi --no-default-features --verbose

Reveals that somehow the wasmtime feature flag is set:
image

@bjorn3
Copy link
Contributor

bjorn3 commented Jul 25, 2024

According to https://docs.rs/crate/wasi-common/23.0.1/source/Cargo.toml.orig, #8900 is not yet included in wasi-common 23.0.x. Each release branches on the 5th of the month and gets released on the 20th:

- cron: '0 0 5 * *'
- cron: '0 0 20 * *'
#8900 got merged on the 8th of this month, which is 3 days after the 23.0 release got branched.

@Robbepop
Copy link
Contributor Author

According to https://docs.rs/crate/wasi-common/23.0.1/source/Cargo.toml.orig, #8900 is not yet included in wasi-common 23.0.x. Each release branches on the 5th of the month and gets released on the 20th:

- cron: '0 0 5 * *'
- cron: '0 0 20 * *'

#8900 got merged on the 8th of this month, which is 3 days after the 23.0 release got branched.

Ah okay, that explains why I just successfully built wasi-common without the Wasmtime dependency when using the current main branch of Wasmtime. 🤦 Good to know.

So this means some more waiting before I can merge the Wasmi PR. Thanks for letting me know!

This issue can be closed then.

Robbepop added a commit to wasmi-labs/wasmi that referenced this issue Aug 21, 2024
* update wasi-common and wiggle dependencies

This makes it possible to remove the old and outdated `wasi-cap-std-sync` dependency altogether.

Unfortunately with this update the `wasi-common` crate still pulls the huge `wasmtime` dependency into Wasmi and I am a bit confused why this happens.

Issue: bytecodealliance/wasmtime#9009

* update wasi-common and wiggle dependencies
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

No branches or pull requests

3 participants