-
Notifications
You must be signed in to change notification settings - Fork 249
Add wasm32-wasip2 target support #532
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
base: master
Are you sure you want to change the base?
Conversation
The build failure seems to be coming from the fact that |
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. |
Seems okay to me. |
@nickrum what is the status of this? |
5b81c68
to
b09d256
Compare
@Thomasdezeeuw This was blocked by a release of libc containing rust-lang/libc#3981 and should be ready for review now.
|
2fe160e
to
7d94033
Compare
Can we merge the PR and release a new version? I see all the tests are passing except clippy. |
Yes please merge, I'm trying to get actix-web to run properly so I can run wasm32 server binaries on Fermyon Cloud. It seems that Thanks @nickrum for the effort! |
This would be cool to get merged... Awesome work! |
Is there anything stopping this from getting merged? |
This PR needs a review, but other than that there is nothing stopping it from being merged AFAIK. All checks are finally passing as well. |
#[cfg(not(target_os = "wasi"))] | ||
#[repr(transparent)] | ||
pub struct MaybeUninitSlice<'a>(sys::MaybeUninitSlice<'a>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this PR would be a lot simpler if this type also exists on wasi. Or, alternatively, if the type was moved to a module so that we needed only a single #[cfg]
rather than 11 of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the unix files for wasi-p2?
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 settingCARGO_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