-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add support for wasm32-wasip1
and wasm32-wasip2
, remove support for wasm32-wasi
#499
Conversation
let mut chunks = dest.chunks_exact_mut(size_of::<u64>()); | ||
for chunk in &mut chunks { | ||
let dst: *mut u64 = chunk.as_mut_ptr().cast(); | ||
let val = get_random_u64(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_random_u64
is used instead of get_random_bytes
because the latter uses an allocation due to the Wit IDL restrictions. This should be fine since the main use case of getrandom
is seed generation.
…or `wasm32-wasi`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there; WASI contributor here. I reviewed this and left some minor remarks about terminology - but overall this looks really good, and I'm excited for this to land!
.github/workflows/tests.yml
Outdated
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WASI 0.2 target should already be available on the beta channel, and will be available on stable come Rust 1.82.
The
wasm32-wasi
target will be removed in Rust 1.84 and existing users are encouraged to migrate to eitherwasm32-wasip1
, orwasm32-wasip2
.Strictly speaking, this is a breaking change despite affecting only deprecated target, so it's probably better to release it in
getrandom
v0.3.Closes #492