Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add --release flag to wasm_builder #5209

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-custom-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- name: Build wasm libs
run: ./scripts/build_wasm.sh --profile=${{ env.IROHA2_PROFILE }} --target=libs
run: ./scripts/build_wasm.sh --target=libs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was good as it was, why change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise for other files in CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. --target=libs is easier to validate since only named arguments are used in build_wasm.sh
  2. --profile=${{ env.IROHA2_PROFILE }} works for deploy, but for PROFILE=profiling, it will require changes in memory, fuel, and timeouts. I think deploy should be used everywhere by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. ok, but how is someone to build a custom image with profile profiling now?

- name: Upload wasm libs to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build wasm libs
run: ./scripts/build_wasm.sh --profile=${{ env.PROFILE }} --target=libs
run: ./scripts/build_wasm.sh --target=libs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change to named argument instead of position based

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was easier to validate when all arguments were named. I can revert if these must be position-based.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

- name: Upload wasm libs to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build
run: ./scripts/build_wasm.sh --profile=${{ env.PROFILE }}
run: ./scripts/build_wasm.sh
- name: Upload all built WASMs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build wasm libs
run: ./scripts/build_wasm.sh --profile=${{ env.PROFILE }} --target=libs
run: ./scripts/build_wasm.sh --target=libs
- name: Upload wasm libs to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build wasm libs
run: ./scripts/build_wasm.sh --profile=${{ env.PROFILE }} --target=libs
run: ./scripts/build_wasm.sh --target=libs
- name: Upload wasm libs to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
Binary file modified crates/iroha_codec/samples/trigger.bin
Binary file not shown.
2 changes: 0 additions & 2 deletions crates/iroha_numeric/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,7 @@ mod scale_ {
#[derive(Encode, Decode)]
// Use compact encoding for efficiency, for integer numbers scale takes only one byte
struct NumericScaleHelper {
#[codec(compact)]
mantissa: u128,
#[codec(compact)]
scale: u32,
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e;
DEFAULTS_DIR="defaults"
CARGO_DIR="wasm"
TARGET_DIR="$CARGO_DIR/target/prebuilt"
PROFILE="profiling"
PROFILE="deploy"
TARGET="all"
SHOW_HELP=false

Expand Down
10 changes: 10 additions & 0 deletions wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ bash scripts/build_wasm.sh --target=libs
```bash
bash scripts/build_wasm.sh --target=samples
```

## WASM in specific profile
1. Release **(default)**
```bash
bash scripts/build_wasm.sh --profile=deploy
```
2. Debug
```bash
bash scripts/build_wasm.sh --profile=profiling
```
Loading