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

Make rust based implementations work in the docker container #586

Closed
krausest opened this issue Jun 23, 2019 · 5 comments
Closed

Make rust based implementations work in the docker container #586

krausest opened this issue Jun 23, 2019 · 5 comments

Comments

@krausest
Copy link
Owner

@Pauan I've opened that issue for working on the rust based frameworks.

The ultimate goal is to perform the build in the docker containter (#546 (comment)).
Here are the (erratic) steps I tried so far:
npm install --save-dev rimraf webpack webpack-cli @wasm-tool/wasm-pack-plugin
Use rust-up to install rust (will be baked into the docker image at some point)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Is there a better way to get a specific version?
source $HOME/.cargo/env

Now rust seems to be installed:

[root@550cf95bb54a dominator]# rust -V
bash: rust: command not found
[root@550cf95bb54a dominator]# rustc -V
rustc 1.35.0 (3c235d560 2019-05-20)
[root@550cf95bb54a dominator]# 

Then try to build:
npm run build-force:

[root@550cf95bb54a dominator]# npm run build-prod-force

> [email protected] build-prod-force /build/frameworks/keyed/dominator
> rimraf bundled-dist pkg && webpack

🧐  Checking for wasm-pack...

ℹ️  Installing wasm-pack 

wasm-pack error: undefined

ERROR in ./js/index.js
Module not found: Error: Can't resolve '../pkg/index.js' in '/build/frameworks/keyed/dominator/js'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build-prod-force: `rimraf bundled-dist pkg && webpack`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build-prod-force script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-06-23T15_44_37_758Z-debug.log

@krausest krausest mentioned this issue Jun 23, 2019
@Pauan
Copy link
Contributor

Pauan commented Jun 23, 2019

In the README I give the exact directions. You have to manually install wasm-pack from here (for example by using curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh).

After rustup and wasm-pack are installed, you need to run these commands:

rustup toolchain install nightly
rustup override set nightly
npm install
npm run build-prod-force

And that should work.

It is possible to use rustup to download a specific version of the Rust toolchain. For example, rather than using nightly you can instead use rustup toolchain install nightly-2019-06-23

And then you need to use rustup override set nightly-2019-06-23 to enable it.

@krausest
Copy link
Owner Author

Thanks - it worked when installed manually. Now I'll try to somehow integrate it into to the docker build (might take some days). I'll report back.

@krausest
Copy link
Owner Author

Thanks to @Pauan rust build work in the docker container.
Only non-keyed/stdwdeb still needs updating. I'll check the next few days if I can build it like the keyed version.

@Pauan
Copy link
Contributor

Pauan commented Jun 28, 2019

Oops, I overlooked non-keyed/stdweb, I'll send a PR.

@krausest
Copy link
Owner Author

Great - thanks!

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