You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This enables it through the `RUSTFLAGS` environment vairable, doing
so for the `wasm32-unknown-unknown` target only.
This is to address:
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
--> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.3/src/backends.rs:168:9
|
168 | / compile_error!(concat!(
169 | | "The wasm32-unknown-unknown targets are not supported by default; \
170 | | you may need to enable the \"wasm_js\" configuration flag. Note \
171 | | that enabling the `wasm_js` feature flag alone is insufficient. \
172 | | For more information see: \
173 | | https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
174 | | ));
However, it is not necessarily the best way to do it. If we want
the `wasm` feature, which is intentionally not a default feature
even on WASM targets, to be sufficient to enable this behavior,
then it may be necessary to set this up in the build configuration.
The documentation at https://docs.rs/getrandom/0.3.3/getrandom
suggests doing something like:
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
However, even assuming we can justifiably and effective do this for
`gix-diff`, which is a library crate, it should still only be done
when the `wasm` feature of `gix-diff` is enabled. That seems like
it might require a `build.rs` file. For now, this change just tests
if enabling that backend is sufficient to let the build succeed.
For more on backends including the `wasm_js` backend, see:
https://docs.rs/getrandom/0.3.3/getrandom/#opt-in-backends
0 commit comments