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

Add wasm32-wasip2 target support #532

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

nickrum
Copy link

@nickrum nickrum commented Oct 4, 2024

The wasm32-wasip2 target will be a tier 2 target starting with Rust 1.82 and will gain improved socket support in Rust 1.83, so it felt like it made sense to add support for WASIp2 now. If WASIp1 support is a requirement for merging this, I can look into that as well.

Tests are all passing locally. They can be run by having wasmtime installed and setting CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime --wasi inherit-network".

Marked as a draft for now since some definitions should be move to rust/libc before merging. I'll do that as soon as I get confirmation on the general direction of this PR.

Closes #268

@nickrum
Copy link
Author

nickrum commented Oct 8, 2024

The build failure seems to be coming from the fact that std::os::fd was stabilized in Rust 1.66, but the MSRV of this crate is 1.63. In theory, the imports needed are also exported through std::os::wasi, but that module hasn't been stabilized for the wasm32-wasip2 target yet.
Not exactly sure how to move this forward. Is there a chance to increase the MSRV?

@Thomasdezeeuw
Copy link
Collaborator

The build failure seems to be coming from the fact that std::os::fd was stabilized in Rust 1.66, but the MSRV of this crate is 1.63. In theory, the imports needed are also exported through std::os::wasi, but that module hasn't been stabilized for the wasm32-wasip2 target yet. Not exactly sure how to move this forward. Is there a chance to increase the MSRV?

That's nice spot Rust put us in... We're not going to increase the MSRV with also doing a version bump, which I don't want to any time soon to be honest.

Maybe we can say the MSRV for wasi p2 is higher? It's not ideal, but I don't see any other solution.

@Darksonn
Copy link
Collaborator

Maybe we can say the MSRV for wasi p2 is higher? It's not ideal, but I don't see any other solution.

Seems okay to me.

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.

Support wasm (in some form)
3 participants