fix: enable wasip2 feature for wasm32-wasip2 target#57
Merged
chipsenkbeil merged 1 commit intochipsenkbeil:mainfrom Jan 22, 2026
Merged
fix: enable wasip2 feature for wasm32-wasip2 target#57chipsenkbeil merged 1 commit intochipsenkbeil:mainfrom
chipsenkbeil merged 1 commit intochipsenkbeil:mainfrom
Conversation
After PR chipsenkbeil#51 added the requirement `any(windows, unix)` to expose native and platform modules, and Rust changed WASI targets to set the `unix` cfg (rust-lang/rust#147572), typed-path now attempts to compile code using `std::os::wasi` for WASI targets. However, this is an unstable feature requiring `#![feature(wasip2)]` when targeting wasm32-wasip2. This commit adds the wasip2 feature flag conditionally only for wasip2 targets (target_env = "p2"), allowing the crate to compile with nightly Rust for wasm32-wasip2 while maintaining compatibility with wasm32-wasip1 which does not have or need this feature. Also fixes an unused import warning for `std::io` on wasm targets where the `absolutize` function (which uses `io`) is not available. Successfully tested on both wasm32-wasip1 and wasm32-wasip2 targets.
cdmurph32
added a commit
to contentauth/c2pa-rs
that referenced
this pull request
Jan 21, 2026
Temporary fix until chipsenkbeil/typed-path#57 is merged.
cdmurph32
added a commit
to contentauth/c2pa-rs
that referenced
this pull request
Jan 21, 2026
Temporary fix until chipsenkbeil/typed-path#57 is merged.
3 tasks
scouten-adobe
pushed a commit
to contentauth/c2pa-rs
that referenced
this pull request
Jan 21, 2026
Downgrade zip to 6 for WASI. Temporary fix until chipsenkbeil/typed-path#57 is merged.
Owner
|
LGTM, thanks! |
Owner
|
@cdmurph32 heads up, this is now published in release 0.12.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After PR #51 added the requirement
any(windows, unix)to expose native and platform modules, and Rust changed WASI targets to use moreunix.rsimplementations in the standard library (rust-lang/rust#147572), typed-path now attempts to compile code usingstd::os::wasifor WASI targets. However, this is an unstable feature requiring#![feature(wasip2)]when targeting wasm32-wasip2.This commit adds the wasip2 feature flag conditionally only for wasip2 targets (target_env = "p2"), allowing the crate to compile with nightly Rust for wasm32-wasip2 while maintaining compatibility with wasm32-wasip1 which does not have or need this feature.
Also fixes an unused import warning for
std::ioon wasm targets where theabsolutizefunction (which usesio) is not available.Successfully tested on both wasm32-wasip1 and wasm32-wasip2 targets.