Skip to content

Remove faulty support for wasm64-unknown-unknown#551

Merged
newpavlov merged 1 commit intorust-random:masterfrom
daxpedda:wasm64
Nov 29, 2024
Merged

Remove faulty support for wasm64-unknown-unknown#551
newpavlov merged 1 commit intorust-random:masterfrom
daxpedda:wasm64

Conversation

@daxpedda
Copy link
Contributor

This removes the previously in #303 added support for wasm64-unknown-unknown.

wasm-bindgen does in fact not support the Memory64 proposal. The reason it still compiled is that wasm-bindgen emits panicking stubs for any target it doesn't support. However, during runtime this would have failed.

| `rdrand` | x86, x86-64 | `x86_64-*`, `i686-*` | [`RDRAND`] instruction
| `rndr` | AArch64 | `aarch64-*` | [`RNDR`] register
| `esp_idf` | ESP-IDF | `*‑espidf` | [`esp_fill_random`]. WARNING: can return low-quality entropy without proper hardware configuration!
| `wasm_js` | Web Browser, Node.js | `wasm32‑unknown‑unknown` | [`Crypto.getRandomValues`] if available, then [`crypto.randomFillSync`] if on Node.js (see [WebAssembly support])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wasm-bindgen only supports wasm32-unknown-unknown (and now wasm32v1-none, see #541), it does not support Emscripten. Even though Emscriptens target is wasm32-unknown-emscripten, I'm not what else was being implied here.

Copy link
Member

Choose a reason for hiding this comment

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

wasm_js works only on target_os = "unknown" targets, so IIUC it can not be used with Emscripten.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. I was referring to the fact that it previously said wasm*-*-unknown, implying the target_os could be something else.

@newpavlov newpavlov merged commit 69b3536 into rust-random:master Nov 29, 2024
takumi-earth pushed a commit to earthlings-dev/getrandom that referenced this pull request Jan 27, 2026
This removes the previously in rust-random#303 added support for
`wasm64-unknown-unknown`.

`wasm-bindgen` does in fact not support the Memory64 proposal. The
reason it still compiled is that `wasm-bindgen` emits panicking stubs
for any target it doesn't support. However, during runtime this would
have failed.
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