Skip to content

wasm32 support#718

Open
arvidn wants to merge 4 commits intomainfrom
wasm32
Open

wasm32 support#718
arvidn wants to merge 4 commits intomainfrom
wasm32

Conversation

@arvidn
Copy link
Contributor

@arvidn arvidn commented Mar 1, 2026

Rayon doesn't support wasm32, which is used by criterion. So benchmarks are disabled for wasm32.


Note

Medium Risk
Mostly build/test and target-specific dependency changes, but it also changes atom-size acceptance and parsing behavior in serde/parse_atom.rs, which could affect compatibility for extremely large serialized inputs.

Overview
Adds wasm32-unknown-unknown support across the crate and CI.

CI now runs a dedicated wasm_tests job that installs wasm-bindgen-test-runner and executes cargo test for the clvmr crate on the WASM target; rust-toolchain.toml also includes the WASM target.

To make tests portable, a wasm_compat::test shim is introduced and applied broadly so unit/rstest tests can run under wasm-bindgen-test; WASM builds also avoid criterion (Rayon) by making it a non-wasm dev-dependency, add WASM-specific getrandom configuration, and embed op-test fixtures via include_str! for WASM. Serialization parsing is tightened for WASM by bounding atom sizes to fit in usize (32-bit) and using fallible usize conversions when slicing/advancing cursors.

Written by Cursor Bugbot for commit 94c2221. This will update automatically on new commits. Configure here.

@socket-security
Copy link

socket-security bot commented Mar 1, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​wasm-bindgen-test@​0.3.5010010093100100

View full report

@socket-security
Copy link

socket-security bot commented Mar 1, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • cargo/minicov@0.3.8

View full report

@arvidn
Copy link
Contributor Author

arvidn commented Mar 4, 2026

@SocketSecurity ignore cargo/minicov@0.3.8

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@coveralls-official
Copy link

coveralls-official bot commented Mar 4, 2026

Pull Request Test Coverage Report for Build 22691930026

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.001%) to 88.262%

Files with Coverage Reduction New Missed Lines %
src/serde/parse_atom.rs 1 99.14%
Totals Coverage Status
Change from base Build 22681542686: 0.001%
Covered Lines: 6978
Relevant Lines: 7906

💛 - Coveralls

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