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

fix: enable wasip2 feature for wasm32-wasip2 target #305

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

cdmurph32
Copy link
Contributor

@Stebalien
Copy link
Owner

From my reading of that issue, this isn't the correct fix. See servo/rust-url#983.

Am I missing something?

@cdmurph32
Copy link
Contributor Author

In that particular case, @brooksmtownsend was able to get around the use of std::os::wasi::prelude::OsStrExt.

This PR allows for the use of rustix for the wasm32-wasip2 target. There probably isn't a way to have this crate work for that target without rustix for the numerous uses of std::os::wasi without reinventing the wheel.

@brooksmtownsend
Copy link

Yeah just to add a bit of context, my original PR to "url" was to enable compilation when wasm32-wasip2 was only on the nightly channel, then my follow up PR was to remove the use of those unstable APIs by using essentially equivalent APIs.

Put another way, this crate currently does not compile to wasm32-wasip2. This PR would enable compilation on the nightly channel, and then enabling compilation on stable would either require a Rust change in the feature gating or to replace the use of those unstable APIs

@Stebalien
Copy link
Owner

I see... Let's put this behind a new unstable feature flag in tempfile. It sounds like this is liable to break at any time and I don't want users to be surprised.

@Stebalien
Copy link
Owner

I forgot all about the existing "nightly" feature. I've pushed a change that merges "unstable" into "nightly", does this work for you?

@cdmurph32
Copy link
Contributor Author

Looks good. Builds on my machine. 😄

@Stebalien
Copy link
Owner

Hm. It looks like cargo-wasi was just broken by rust-lang/compiler-team#607.

@cdmurph32
Copy link
Contributor Author

cargo wasi is deprecated. Just use cargo build --target wasm32-wasip2 for this change.

@Stebalien Stebalien force-pushed the update_rustix branch 3 times, most recently from 5e82b26 to 6119ce1 Compare November 8, 2024 01:04
cdmurph32 and others added 4 commits November 8, 2024 08:19
I forgot we had this feature already (and it's already being used for
wasi-related things anyways).
@Stebalien Stebalien merged commit a23f396 into Stebalien:master Nov 8, 2024
14 checks passed
@Stebalien
Copy link
Owner

3.14 published

cdmurph32 added a commit to cdmurph32/c2pa-rs that referenced this pull request Nov 12, 2024
- wasip2 will require +nightly until rust-lang/rust#130323 is resolved and/or std::os::wasip2 is available in stable.
- Support was added to rustix for version 0.38.39 bytecodealliance/rustix#1205
- Support was added to tempfile for version 3.14 Stebalien/tempfile#305
cdmurph32 added a commit to cdmurph32/c2pa-rs that referenced this pull request Nov 12, 2024
- wasip2 will require +nightly until rust-lang/rust#130323 is resolved and/or std::os::wasip2 is available in stable.
- Support was added to rustix for version 0.38.39 bytecodealliance/rustix#1205
- Support was added to tempfile for version 3.14 Stebalien/tempfile#305
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.

3 participants