Skip to content

Fix getrandom build error for wasm examples#3055

Merged
greenrazer merged 1 commit into
huggingface:mainfrom
lucky-bai:bai/fix-wasm-getrandom
Aug 18, 2025
Merged

Fix getrandom build error for wasm examples#3055
greenrazer merged 1 commit into
huggingface:mainfrom
lucky-bai:bai/fix-wasm-getrandom

Conversation

@lucky-bai

Copy link
Copy Markdown
Contributor

Fixes error when building the candle-wasm-examples/whisper example (and possibly other WASM examples) with sh build-lib.sh. Currently the build fails with error:

bai@Bais-MacBook-Pro whisper % sh build-lib.sh
   Compiling getrandom v0.3.3
error: The wasm32-unknown-unknown targets are not supported by default; you may need to enable the "wasm_js" configuration flag. Note that enabling the `wasm_js` feature flag alone is insufficient. For more information see: https://docs.rs/getrandom/0.3.3/#webassembly-support

The root cause is that getrandom requires explicit configuration to select the backend when targeting wasm32-unknown-unknown.

@greenrazer greenrazer merged commit f1286e6 into huggingface:main Aug 18, 2025
9 checks passed
@greenrazer

Copy link
Copy Markdown
Contributor

Thanks!

john-sharratt pushed a commit to john-sharratt/candle that referenced this pull request May 7, 2026
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