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
{{ message }}
Repository navigation
Add support for emscripten (wasm32-unknown-emscripten target) #272
I'm unable to build quickcheck when targeting the wasm32-unknown-emscripten build target.
Please consider adding support for wasm as a 1st class citizen!
Repro:
Using master at defde6fb0ce20b0c8c4e672aa9ae821f7d1f5b38,
Perform the following steps:
Setup: add the wasm-emscripten target by running rustup target add wasm32-unknown-emscripten
Attempt to build quickcheck for this target using cargo build --target wasm32-unknown-emscripten
Expected result: quickcheck is successfully built for the wasm target
Actual result:
Compilation fails with the following message:
error[E0277]: the trait bound `Standard: Distribution<u128>` is not satisfied
--> src\arbitrary.rs:785:32
|
785 | _ => g.gen()
| ^^^ the trait `Distribution<u128>` is not implemented for `Standard`
...
797 | / unsigned_arbitrary! {
798 | | usize, u8, u16, u32, u64, u128
799 | | }
| |_- in this macro invocation
|
= help: the following implementations were found:
<Standard as Distribution<()>>
<Standard as Distribution<(A, B)>>
<Standard as Distribution<(A, B, C)>>
<Standard as Distribution<(A, B, C, D)>>
and 63 others
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Notes:
Notice that rand disabled support for i128 and u128 when targeting emscripten, due to emscripten limitations (see: Disable i128 and u128 on emscripten (fixes #669) rust-random/rand#671 ). Perhaps quickcheck should also exclude support for these types when targeting emscripten?
@BurntSushi after taking an initial stab at this, I see there are multiple, distinct issues to resolve. I will open separate bugs and PRs for each as each could be accepted or rejected individually, and each provides value by itself. I'll rename this bug to add support for wasm32-unknown-emscripten target.
Activity
BurntSushi commentedon Feb 1, 2021
If doing so is simple, easy to maintain and testable in CI, then sure. A PR is welcome.
Spoonbender commentedon Feb 1, 2021
@BurntSushi great, I'll try to tackle this
Spoonbender commentedon Feb 1, 2021
@BurntSushi after taking an initial stab at this, I see there are multiple, distinct issues to resolve. I will open separate bugs and PRs for each as each could be accepted or rejected individually, and each provides value by itself. I'll rename this bug to add support for
wasm32-unknown-emscriptentarget.[-]Add support for WebAssembly[/-][+]Add support for emscripten (wasm32-unknown-emscripten target)[/+]