Skip to content

Conversation

@cdmurph32
Copy link

@cdmurph32 cdmurph32 commented Jan 21, 2026

After PR #51 added the requirement any(windows, unix) to expose native and platform modules, and Rust changed WASI targets to use more unix.rs implementations in the standard library (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.

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
cdmurph32 added a commit to contentauth/c2pa-rs that referenced this pull request Jan 21, 2026
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.
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.

1 participant