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

WASM build fails (mac) #166

Open
ldd opened this issue Jun 16, 2021 · 2 comments
Open

WASM build fails (mac) #166

ldd opened this issue Jun 16, 2021 · 2 comments

Comments

@ldd
Copy link

ldd commented Jun 16, 2021

I tried to follow the instructions to build for web, but they fail on my 2019 macbook pro.

I've attached the errors I got, and I can confirm the wasm build works when I remove rltk from my dependencies in Cargo.toml

I also noticed a couple of things in the WASM tutorial that seem to be targeted towards windows users (like using \ instead of / for paths) so I was wondering if the wasm stuff was only tested on windows.

Thanks for making this tutorial btw!

error[E0432]: unresolved import `platform::Signal`
  --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/lib.rs:52:9
   |
52 | pub use platform::Signal;
   |         ^^^^^^^^^^^^^^^^ no `Signal` in `platform`

error[E0412]: cannot find type `Error` in module `platform`
  --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/error.rs:25:21
   |
25 | impl From<platform::Error> for Error {
   |                     ^^^^^ not found in `platform`
   |
help: consider importing one of these items
   |
1  | use core::fmt::Error;
   |
1  | use crate::Error;
   |
1  | use crate::error::fmt::Error;
   |
1  | use std::error::Error;
   |
     and 2 other candidates

error[E0412]: cannot find type `Error` in module `platform`
  --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/error.rs:26:26
   |
26 |     fn from(e: platform::Error) -> Error {
   |                          ^^^^^ not found in `platform`
   |
help: consider importing one of these items
   |
1  | use core::fmt::Error;
   |
1  | use crate::Error;
   |
1  | use crate::error::fmt::Error;
   |
1  | use std::error::Error;
   |
     and 2 other candidates

error[E0412]: cannot find type `Signal` in module `platform`
  --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/signal.rs:22:21
   |
22 |     Other(platform::Signal),
   |                     ^^^^^^ not found in `platform`

error[E0425]: cannot find function `init_os_handler` in module `platform`
  --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/lib.rs:97:25
   |
97 |         match platform::init_os_handler() {
   |                         ^^^^^^^^^^^^^^^ not found in `platform`

error[E0425]: cannot find function `block_ctrl_c` in module `platform`
   --> /Users/ldd/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlc-3.1.9/src/lib.rs:110:27
    |
110 |                 platform::block_ctrl_c().expect("Critical system error while waiting for Ctrl-C");
    |                           ^^^^^^^^^^^^ not found in `platform`
    
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `ctrlc`
    ```
@scambier
Copy link

scambier commented Jun 24, 2021

Exact same issue here on windows 10

Edit: on the same subject (wasm build), I also had to manually add the getrandom crate on my Cargo.toml

[dependencies]
getrandom = { version = "0.2", features = ["js"] }

@scambier
Copy link

scambier commented Jul 1, 2021

Workaround found on Discord:

[dependencies]
rltk = { git = "https://github.com/amethyst/bracket-lib" }

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

No branches or pull requests

2 participants