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 instructions? #13

Open
ethanfrey opened this issue Oct 6, 2022 · 1 comment
Open

Build instructions? #13

ethanfrey opened this issue Oct 6, 2022 · 1 comment

Comments

@ethanfrey
Copy link

This seems like an interesting project and I am trying to test it out. I am especially interested in the web / wasm version. But I got errors when compiling. I got some working, but it would be great to leave some comments, especially when it doesn't work out of the box on a recent 1.61 install.

First, please not that it requires nightly build to run:

cargo build --release --bin cli complains, but cargo +nightly build --release --bin cli does seem to work

Second, it would be great to give a command to compile the wasm version (and ideally how to serve locally):

cargo +nightly build --release --target wasm32-unknown-unknown errors. It works when I add --bin cli, but I assume that is not what I want for wasm32?

I'd be excited to play around with embedded js interpreter in wasm, and happy for any tips

@ethanfrey
Copy link
Author

ethanfrey commented Oct 6, 2022

I think this works:

cd toyjs_web
cargo +nightly build --release --target wasm32-unknown-unknown
npm install
npm run dev

But npm install failed on my Mac m1:

npm ERR! .../rust/toyjs/toyjs_web/node_modules/wasm-pack/binary.js:19
npm ERR!   throw new Error(`Unsupported platform: ${type} ${arch}`);
npm ERR!   ^
npm ERR!
npm ERR! Error: Unsupported platform: Darwin arm64

(This was closed upstream and on master but not in a tagged / published npm release, so I guess out of scope for this repo... I may add an PR with instructions for m1 if you wish)

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

1 participant