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

feat: Add `--release` flag to wasm_builder #5209

Open aoyako opened 3 weeks ago

aoyako commented 3 weeks ago

Context

Resolves https://github.com/hyperledger-iroha/iroha/issues/5202

Problem

The current version of iroha_wasm_builder has a --release flag set by default for its output. \ The input --optimize flag can be set that will apply -O -Os. Still, it cannot produce a build in debug mode.

Solution

Changes in iroha_wasm_builder

This PR introduces a single flag --release that:

Changes in build_wasm.sh

Now, build_wasm.sh produces a debug build by default. Flag --release can be added to build in optimized mode.

Checklist

aoyako commented 1 week ago

Recap:

  1. wasm_builder.sh now can take --profile to use profile from wasm/Cargo.toml when building wasms.
  2. wasm/Cargo.toml has two profiles:
    • deploy - optimized build, will also apply wasm-opt in the end.
    • test - no additional optimizations, same as release.
  3. PRs use test profile for testing, otherwise deploy is used as default.
github-actions[bot] commented 1 week ago

@BAStos525