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

feat: Wasm32 wasi 0.41.0 #888

Merged
merged 8 commits into from
Feb 18, 2025
Merged

feat: Wasm32 wasi 0.41.0 #888

merged 8 commits into from
Feb 18, 2025

Conversation

cdmurph32
Copy link
Collaborator

@cdmurph32 cdmurph32 commented Jan 29, 2025

Changes in this pull request

feat: Add wasi compatibility.

Related issues:

Tests passing with WASI.
CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime -S common -S http --dir ."

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.94%. Comparing base (49667a0) to head (3454987).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #888      +/-   ##
==========================================
+ Coverage   78.91%   78.94%   +0.02%     
==========================================
  Files         147      147              
  Lines       34827    34845      +18     
==========================================
+ Hits        27485    27507      +22     
+ Misses       7342     7338       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cdmurph32 cdmurph32 changed the title Wasm32 wasi 0.41.0 feat: Wasm32 wasi 0.41.0 Jan 29, 2025
@cdmurph32 cdmurph32 force-pushed the wasm32-wasi_0.41.0 branch 2 times, most recently from aadf8d7 to 806b867 Compare January 29, 2025 16:50
@cdmurph32 cdmurph32 force-pushed the wasm32-wasi_0.41.0 branch 2 times, most recently from 3273bdc to 21141b2 Compare February 4, 2025 19:46
@mauricefisher64
Copy link
Collaborator

How does this work for crypto? Does it use the new rust native path that we have for wasm?

@cdmurph32
Copy link
Collaborator Author

How does this work for crypto? Does it use the new rust native path that we have for wasm?

Yes. Removing WebCrypto made that very straightforward.

@mauricefisher64
Copy link
Collaborator

Does this code rely on the fact that the wasm target will bring in rust_native crypto? If so would it be better to just have a wasi target instead of a side effect. Otherwise this could be easily broken without someone knowing they are affecting wasi.

@cdmurph32 cdmurph32 force-pushed the wasm32-wasi_0.41.0 branch 4 times, most recently from dccba31 to 066a7a8 Compare February 11, 2025 18:40
@cdmurph32
Copy link
Collaborator Author

Does this code rely on the fact that the wasm target will bring in rust_native crypto? If so would it be better to just have a wasi target instead of a side effect. Otherwise this could be easily broken without someone knowing they are affecting wasi.

The wasm32 target_arch covers all targets of that architecture, including wasm32-wasi. That target_arch is used intentionally .

Copy link
Collaborator

@mauricefisher64 mauricefisher64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments

- 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
Tests passing with WASI.
CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime -S common --dir ."
Tempfile is not supported in wasip1
@cdmurph32 cdmurph32 merged commit 1c046d0 into main Feb 18, 2025
31 checks passed
@cdmurph32 cdmurph32 deleted the wasm32-wasi_0.41.0 branch February 18, 2025 18:55
@scouten-adobe scouten-adobe mentioned this pull request Feb 18, 2025
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