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

Build with wasm-pack for example fails on MacOS #16

Closed
andynog opened this issue Jun 3, 2021 · 4 comments
Closed

Build with wasm-pack for example fails on MacOS #16

andynog opened this issue Jun 3, 2021 · 4 comments

Comments

@andynog
Copy link
Contributor

andynog commented Jun 3, 2021

Trying to follow the instructions in the examples folder and when I try to run the wasm-pack command it's not working.

Environment:
macOS Catalina 10.15.7

I have Rust installed

(~/dev/github.com/forbole/cosmos-rust-wallet) $> rustc -V
rustc 1.52.1 (9bc8c42bb 2021-05-09)

Also installed wasm-pack

(~/dev/github.com/forbole/cosmos-rust-wallet) $> curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
info: downloading wasm-pack
info: successfully installed wasm-pack to `$HOME/.cargo/bin/wasm-pack`

(~/dev/github.com/forbole/cosmos-rust-wallet) $> wasm-pack  -V
wasm-pack 0.9.1

But when I run the command wasm-pack it fails with the error below (note: the instruction said to run from the crw-wallet but I believe repo name has changed to cosmos-rust-wallet)

(~/dev/github.com/forbole/cosmos-rust-wallet) $> wasm-pack build --release -- --features wasm-bindgen
Error: failed to parse manifest: $HOME/dev/github.com/forbole/cosmos-rust-wallet/Cargo.toml
Caused by: missing field `package`

Am I doing something wrong ?

@leobragaz
Copy link
Collaborator

leobragaz commented Jun 3, 2021

Hi @andynog. The example refers to build the caw-wallet package inside packages, so you
should first move into that folder. Unfortunately now there's also a macOS related problem that will not let you build the package, see here: #9

@andynog
Copy link
Contributor Author

andynog commented Jun 3, 2021

Ok @bragaz I will try that from a Linux machine

@manu0466
Copy link

manu0466 commented Jun 3, 2021

@andynog You can use the docker container to compile the package from macOS.
From within the crw-wallet dir you can run make build-wasm or if you don't have make you can run docker run -u $(id -u):$(id -g) --rm -v $(pwd):/workdir forbole/wasm-rust-builder:1.52.1 wasm-pack build --release -- --features wasm-bindgen.
Let me know if this works out for you.

@andynog
Copy link
Contributor Author

andynog commented Jun 6, 2021

Thanks @manu0466 I could compile directly on Linux and via Docker on MacOS and test the example. Both worked! I will close this issue.

@andynog andynog closed this as completed Jun 6, 2021
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

3 participants