Skip to content

feat: Add WASI Preview 2 support and enhanced target coverage #3507

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avrabe
Copy link

@avrabe avrabe commented Jul 16, 2025

Summary

Add wasm32-wasip2 to DEFAULT_EXTRA_TARGET_TRIPLES following the same pattern as wasm32-wasip1. This ensures WASI Preview 2 toolchains are generated out-of-the-box alongside Preview 1, providing consistency for users working with both WASI versions.

Changes

  • Target Triple Registration: Add wasm32-wasip2 to DEFAULT_EXTRA_TARGET_TRIPLES in rust/private/repository_utils.bzl

This addresses the feedback from @cameron-martin to include wasm32-wasip2 in the default extra target triples for automatic toolchain generation.

@avrabe avrabe force-pushed the wasi-p2-support-pr branch 7 times, most recently from 7249b22 to d834ab8 Compare July 22, 2025 17:27
@cameron-martin
Copy link
Contributor

cameron-martin commented Jul 23, 2025

This looks very useful, thanks.

I'm not sure what the policy for this repo regarding how focused changes are but this looks like at least 3 distinct things are included here:

  • Adding features section to README.
  • Fixing some issues with cross-compilation toolchains (some changes to the allocator library and tracking some extra input files).
  • Adding wasip2 support.

@cameron-martin
Copy link
Contributor

Maybe you could add wasm32-wasip2 to DEFAULT_EXTRA_TARGET_TRIPLES, considering wasm32-wasip1 is there already? This way the wasip2 toolchains are generated out-of-the-box.

@avrabe
Copy link
Author

avrabe commented Jul 24, 2025

Thanks for the feedback @cameron-martin! You're absolutely right about this covering multiple areas - I'm still learning the contribution patterns here so really appreciate the guidance.

For the DEFAULT_EXTRA_TARGET_TRIPLES suggestion, that makes perfect sense for consistency. I'll add that.

Regarding splitting this up - I'm totally open to that if it would be better for the project. I was trying to get all the WASI P2 pieces working together but I realize that might not align with how changes are typically structured here. Would you recommend breaking it into separate PRs? Happy to follow whatever approach works best.

Thanks for taking the time to review - still getting familiar with the codebase so feedback like this is really helpful.

- Add WASI version constraint settings and platform configurations for wasip2
- Add support for wasm32-wasip2 and wasm32-wasip1-threads targets
- Fix WASI toolchain and allocator library issues for cross-compilation
- Add comprehensive unit tests and documentation for WASI platform functionality
@avrabe avrabe force-pushed the wasi-p2-support-pr branch from 2000486 to 01c9f3f Compare July 24, 2025 10:44
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.

2 participants