wasmx / wasm-chisel

Some useful utilities to transform WebAssembly binaries.
Apache License 2.0
56 stars 11 forks source link

Cargo Integration #93

Open jakelang opened 5 years ago

jakelang commented 5 years ago

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 commented 5 years ago

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

axic commented 5 years ago

That would be great!

hugo-dc commented 5 years ago

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.