Skip to content

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

Open

Description

@Spoonbender

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:

Activity

  1. BurntSushi commented on Feb 1, 2021

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

  2. Spoonbender commented on Feb 1, 2021

    @Spoonbender
    Author

    @BurntSushi great, I'll try to tackle this

  3. Spoonbender commented on Feb 1, 2021

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

  4. changed the title [-]Add support for WebAssembly[/-] [+]Add support for emscripten (wasm32-unknown-emscripten target)[/+] on Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions