# getrandom 0.3 refuses to build for wasm32-unknown-unknown unless it is told # which backend to use. The target has no OS entropy source, so the crate will # not guess: it wants the `wasm_js` backend named explicitly, AND the matching # feature enabled on the crate itself. Its own error is unusually clear that one # without the other is not enough: # # 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. # # This is the cfg half. The feature half is a wasm32-only dependency in # crates/sylpheed-viewer/Cargo.toml — that is the only crate reaching getrandom # here, transitively through `ahash`. # # Scoped to the wasm target, so native builds are untouched. Note that a # RUSTFLAGS environment variable, if one is ever set, replaces this rather than # adding to it. # # The second cfg is bevy_egui's. Its web clipboard support calls web-sys APIs # that are still gated behind an unstable flag, and it refuses to build without # it rather than silently dropping the feature: # # error: bevy_egui uses unstable APIs to support clipboard on web. # [target.wasm32-unknown-unknown] rustflags = [ '--cfg', 'getrandom_backend="wasm_js"', '--cfg', 'web_sys_unstable_apis', ]