-
Notifications
You must be signed in to change notification settings - Fork 118
Latest git not building for wasm #194
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
Comments
I have the same issue with 0.8.0 and 0.8.1. If I borrow dependencies from amethyst/rustrogueliketutorial@3792f07 I can get it to work. This implies
|
To fix the build failure with Rand, you might have to enable the |
Right. So the The dependency on |
Looks like |
You need |
Starting work on this now. |
https://crates.io/crates/getrandom:
While that's what it does, what we get as a package is too much and is outright harmful. This is how node.js dependencies turn into a supermassive black hole. |
…d the rand dev-dependency in bracket-terminal no longer uses getrandom. This makes it build on my local system.
… to the features curses/cross_term.
The |
Apparently, I'm going to have some pain with having |
* #194 - Seed the RNG with time since unix epoch to avoid needing getrandom(). * #194 (Note that this breaks crossterm for now). Ctrlc is optional, and the rand dev-dependency in bracket-terminal no longer uses getrandom. This makes it build on my local system. * #194 - Crossterm feature flag is now cross_term, and ctrlc is limited to the features curses/cross_term. * #194 - Stop repeating myself in the cargo toml file. * Version number bump * Run cargo fmt
Ok, I've confirmed that all tests and examples build on |
I'm a Rust neophyte, but:
The build completes successfully. 🥇 However, running it, I get a panic in the web console:
|
This may be relevant: rust-lang/rust#48564 (comment) ((I'll be happy to contribute with PRs once I get my head around Rust a little more. Trying to help however I can at the moment.) |
I'll dig into it some more, my testing didn't quite get that far (which was why I'd left it open). It's hard to believe that |
The patch I just committed is now working for me. The results of a WASM build: http://bfnightly.bracketproductions.com/sprites-23-02-2021/ (sprite movement is random via bracket-random). |
Confirming your findings: Excellent! Thank you. |
@thebracket Why don't you enable the |
Removing a whole target system, and reducing the module portability because of implementation convenience, is not a responsible behavior towards community. |
I think I have some ideas to find a middle-ground here. (With that said, I will give the warning that if you really need crypto-strength randomness, this library may not be a good choice for you - So I'll keep this issue open and not push a crate version until I have a somewhat better solution in place. |
…n an architecture that doesn't support that syscall, falls back to time since start. On WASM, it queries your WASM host for either the browser or Node RNG functions. If they are available, it uses them to generate a good seed. If that isn't available, it falls back to using js time functions.
…or crossterm. You don't have to change the name if you rely on the parent library, only if you rely on bracket_terminal directly.
Ok, I've updated this again (hopefully the last one before I do a crate upload):
It works on my test builds (the tutorial, and http://bfnightly.bracketproductions.com/sprites-23-02-2021/ ). If anyone could give it a whirl before I publish, I'd appreciate it. |
On 927d229 in my project, all of the following now build and run. I lack a test environment for other combinations.
|
I forgot to close this one - it's working on everything I've test it with. |
I have this in my
cargo.lock
:When I try to build for
wasm
, I get:...and a bunch of other errors.
MacOS,
The text was updated successfully, but these errors were encountered: