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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

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.

@Thomasdezeeuw
Copy link
Collaborator

@nickrum what is the status of this?

@nickrum nickrum marked this pull request as ready for review November 13, 2024 13:06
@nickrum nickrum force-pushed the wasip2 branch 3 times, most recently from 5b81c68 to b09d256 Compare November 13, 2024 14:47
@nickrum
Copy link
Author

nickrum commented Nov 13, 2024

@Thomasdezeeuw This was blocked by a release of libc containing rust-lang/libc#3981 and should be ready for review now.

CI / Check is currently failing for armv7-sony-vita-newlibeabihf because of rust-lang/rust#132921, which will be fixed by rust-lang/rust#132977.

FreeBSD is currently failing because of #534, which will be fixed by #535.

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