-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to run build on Mac #1
Comments
Under the hood, the compilation is really all powered by wasm-pack, which automates pretty much the whole rust -> wasm compilation process. Have you run If that's installed, then building should print something like this:
Internally, that's just running this script which runs wasm-pack with various arguments and copies files in and out, there's not much else involved. From your logs, it looks like wasm-pack isn't being found or run at all for some reason. |
Aha! Of course, yes, that makes sense. Is there a specific command that was missing? I guess |
FWIW, even after installing > $ npm run build ⬡ 20.9.0 [±main ✓]
> [email protected] build
> node ./build.js
[INFO]: Checking for the Wasm target...
Error: wasm32-unknown-unknown target not found in sysroot: "/opt/homebrew/Cellar/rust/1.77.2"
Used rustc from the following path: "/opt/homebrew/bin/rustc"
It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
mv: no such file or directory: pkg
rm: no such file or directory: pkg.bundler/{LICENSE,package.json,README.md,.gitignore}
[INFO]: Checking for the Wasm target...
Error: wasm32-unknown-unknown target not found in sysroot: "/opt/homebrew/Cellar/rust/1.77.2"
Used rustc from the following path: "/opt/homebrew/bin/rustc"
It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
mv: no such file or directory: pkg
rm: no such file or directory: pkg.node/{LICENSE,package.json,README.md,.gitignore}
[INFO]: Checking for the Wasm target...
Error: wasm32-unknown-unknown target not found in sysroot: "/opt/homebrew/Cellar/rust/1.77.2"
Used rustc from the following path: "/opt/homebrew/bin/rustc"
It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
mv: no such file or directory: pkg
rm: no such file or directory: pkg.web/{LICENSE,package.json,README.md,.gitignore} And trying to then install Rustup resulted in
So it appears not just Rust, but a specific style of installing Rust is required ( Also needed to manually as |
Worth noting that this isn't just an arbitrary style - it's the officially recommended way to install rust for all users: https://www.rust-lang.org/tools/install. They do offer other installation methods for special cases, including Homebrew (I think that's what you've used here?) but in general you shouldn't use them unless you know what you're doing - without rustup you can't easily manage a rust toolchain to add extra targets etc. PRs to the docs for this welcome. |
This is a great project. For a long time, I have been looking for a compression library that can be used in both the browser and the node environment. I also tested multiple similar libraries. I found that your library is currently more suitable for me. Sincere thanks。
Now I need to port the compilation process of this library to my project compilation process, but I don't know much about the compilation process of webassembly. I tried to use the build command in this library without success. Is there a way to help me compile this library on my mac? If possible, it would be a great help.
The text was updated successfully, but these errors were encountered: