wasm-chisel icon indicating copy to clipboard operation
wasm-chisel copied to clipboard

Cargo Integration

Open jakelang opened this issue 5 years ago • 3 comments

It seems that integrating chisel with rust projects requires either a makefile or manual invocation, which isn't great ux. Perhaps a cargo subcommand or plugin would make this much easier. cc @axic

jakelang avatar May 27 '19 16:05 jakelang

Another possibility is introducing a target triple for rustc wasm32-unknown-ewasm

jakelang avatar May 27 '19 16:05 jakelang

That would be great!

axic avatar May 27 '19 17:05 axic

I started this cargo submodule here: https://github.com/hugo-dc/cargo-build-ewasm it executes: cargo build --target=wasm32-unknown-unknown --release, then runs chisel run (expects a default chisel.yml configuration), and lastly executes wasm-snip to reduce the bytecode size.

Tested in here: https://github.com/hugo-dc/wrc20-rust/blob/master/Makefile , it also needed to use wasm-opt (from binaryen) to reduce even more the bytecode size.

Still have more changes to do, just wanted to share it, please let me know any comments.

hugo-dc avatar Jun 11 '19 05:06 hugo-dc