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

Add support for wasm32-wasip1 and wasm32-wasip2, remove support for wasm32-wasi #499

Merged
merged 8 commits into from
Sep 27, 2024

Conversation

newpavlov
Copy link
Member

The wasm32-wasi target will be removed in Rust 1.84 and existing users are encouraged to migrate to either wasm32-wasip1, or wasm32-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

@newpavlov newpavlov added this to the Next Release milestone Sep 5, 2024
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();
Copy link
Member Author

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.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
Copy link

@yoshuawuyts yoshuawuyts left a 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!

src/lib.rs Outdated Show resolved Hide resolved
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly

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.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
@newpavlov newpavlov merged commit 6c6fbef into master Sep 27, 2024
52 checks passed
@newpavlov newpavlov deleted the wasip2 branch September 27, 2024 16:31
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.

Consider updating to wasi v0.13.1+wasi-0.2.0
2 participants