hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
444 stars 277 forks source link

Add `--release` flag to `iroha_wasm_builder` #5202

Open mversic opened 3 weeks ago

mversic commented 3 weeks ago

Whenever we're using iroha_wasm_builder we're invoking cargo with --release. This should not be the default. The default should be to produce debug build. Optionally it should be possible to build with --release. This is how cargo does it and is least confusing. It is also the case that most if not all of the wasm should be built as debug (we can discuss the scope).

0x009922 commented 3 weeks ago

The default should be to produce debug build.

That would not align with the "main" known WASM tool in Rust ecosystem, i.e. wasm_pack: it uses --release by default.

And I can understand the rationale that if you develop a WASM for web (or for Iroha) you might want it in release mode in most cases.

mversic commented 3 weeks ago

That would not align with the "main" known WASM tool in Rust ecosystem, i.e. wasm_pack: it uses --release by default.

And I can understand the rationale that if you develop a WASM for web (or for Iroha) you might want it in release mode in most cases.

I see. I'm fine either way whichever will eliminate most of user questions. In this case since there is no way of running smart contracts without submitting them to iroha, --release as the default could be more reasonable.

The thing that I'm more interested in is that we get the possibility of building with debug/test profiles and that we consider building with those profiles in the CI. At least to get stack traces in wasm