Skip to content

Instantly share code, notes, and snippets.

@sseemayer
Created November 24, 2018 10:27
Show Gist options
  • Save sseemayer/6f6f66bd87c2aba0d544e0e28934f1a5 to your computer and use it in GitHub Desktop.
Save sseemayer/6f6f66bd87c2aba0d544e0e28934f1a5 to your computer and use it in GitHub Desktop.
[package]
name = "quicksilver-test"
version = "0.1.0"
authors = ["Stefan Seemayer <mail+quicksilver.test@semicolonsoftware.de>"]
edition = "2018"
[dependencies]
quicksilver = "*"
specs-derive = "0.3.0"
[target.'cfg(target_arch = "wasm32")'.dependencies]
specs = {version = "0.14.0", default-features = false}
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
specs = {version = "0.14.0"}
@sseemayer
Copy link
Author

I am trying to disable the parallel feature for the specs crate when compiling to wasm32. It seems that the configuration for non-wasm32 somehow bleeds through even when compiling to wasm32:

  • If I remove lines 14 and 15, I can compile fine for wasm32 with parallel disabled but cannot cargo run normally since the specs crate is missing.

  • If I compile using the Cargo.toml as shown above, I can cargo run with parallel enabled but the cargo web run wasm32-unknown-unknown target will crash when trying to allocate a thread pool in specs.

Am I doing something wrong in how I am defining the features and dependencies?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment