-
Notifications
You must be signed in to change notification settings - Fork 169
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
Support building on webassembly #137
Comments
A possible solution here would be to split proptest into two crates:
EDIT: this would help because we depend on prop-test in a non-optional way to define an "Arbitrary" instance for text edits. It would be totally fine if the actual tests work on Linux/Windows/Mac. |
I gated the code you deleted behind a
Unfortunately, the two are rather intertwined — even the basic public API requires |
Were any of you able to get proptest to compile for WebAssembly? I am running into this error: error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /home/lastmjs/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/wait-timeout-0.2.0/src/lib.rs:66:9
|
66 | imp::wait_timeout(self, dur)
| ^^^ use of undeclared crate or module `imp |
I turned off all features except for std, and it now compiles. Have you had success actually getting proptest to run? I keep getting a panic when trying to create a runner: |
^ that's about how far I got too, with a more precise message in a few places:
|
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
🤦 Just saw #270 IgnoreI tried a minimal reproduction with proptest! {
#[wasm_bindgen_test]
fn some_test(num: u32) { assert_eq!(num, num); }
} And ran into three failures:
Neither of these address the more niche cases like |
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. Fixes proptest-rs#137.
It would be great if proptest could be built on WASM. Slightly related to #47 but more specific, since proptest can almost be compiled to webassembly already.
I'm already disabling the default forking feature, to avoid the
rusty-fork
dependency.The only thing blocking building proptest on webassembly is these few lines, importing
std::os::unix
inside a#[cfg(not(target_os = "windows"))]
block.Could the
osstring_invalid_string
function be constrained more, by excludingwasm32
for example? Or maybe there's a better solution to avoid usingstd::os::unix
on all non-windows targets?The text was updated successfully, but these errors were encountered: