Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for emscripten (wasm32-unknown-emscripten target) #272

Open
Spoonbender opened this issue Feb 1, 2021 · 3 comments · May be fixed by #276
Open

Add support for emscripten (wasm32-unknown-emscripten target) #272

Spoonbender opened this issue Feb 1, 2021 · 3 comments · May be fixed by #276

Comments

@Spoonbender
Copy link

Spoonbender commented Feb 1, 2021

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:

  1. Setup: add the wasm-emscripten target by running rustup target add wasm32-unknown-emscripten
  2. 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:

@BurntSushi
Copy link
Owner

Perhaps quickcheck should also exclude support for these types when targeting emscripten?

If doing so is simple, easy to maintain and testable in CI, then sure. A PR is welcome.

@Spoonbender
Copy link
Author

@BurntSushi great, I'll try to tackle this

@Spoonbender
Copy link
Author

@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.

@Spoonbender Spoonbender changed the title Add support for WebAssembly Add support for emscripten (wasm32-unknown-emscripten target) Feb 1, 2021
@Spoonbender Spoonbender linked a pull request Feb 2, 2021 that will close this issue
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 a pull request may close this issue.

2 participants