wasm4 icon indicating copy to clipboard operation
wasm4 copied to clipboard

w4 watch for Rust uses debug build

Open hw762 opened this issue 1 year ago • 3 comments

Running w4 watch uses cargo build to rebuild, which is the debug build and generates warning about oversize. It should probably use the release build.

hw762 avatar Dec 11 '24 16:12 hw762

Hmm, is this really a problem? It's okay to be oversized during development.

majaha avatar Dec 11 '24 17:12 majaha

I would like to keep track of the size in development. Well, I can build the release and check myself, but this can be automated.

hw762 avatar Dec 11 '24 17:12 hw762

The w4 watch command is mostly targeted at fast development, and for development it's generally useful to have debug symbols available. I'd suggest having a script that automatically builds in release with wasm-opt if you want to keep accurate track of the final size. You could also override the dev/debug profile in your Cargo.toml if you always want to build an optimized binary even with cargo build (and cargo build --debug), though I wouldn't recommend it, and it isn't really useful without wasm-opt either.

JerwuQu avatar Dec 13 '24 10:12 JerwuQu