Skip to content

Commit

Permalink
fix: wasm build instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Lohachov Mykhailo <[email protected]>
  • Loading branch information
aoyako committed Jan 17, 2025
1 parent 3a76158 commit 4c383c9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build wasm libs
run: mold --run cargo run --bin kagami wasm -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DEFAULTS_DIR }}/executor.wasm
run: mold --run cargo run --bin kagami -- wasm build ./wasm/libs/default_executor --optimize --out-file ${{ env.DEFAULTS_DIR }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ It can be done by running:

```bash
# compile executor without optimizations
cargo run --bin kagami wasm -- build ./path/to/executor --out-file executor.wasm
cargo run --bin kagami -- wasm build ./path/to/executor --out-file executor.wasm
```

With profiling feature enabled Iroha exposes endpoint to scrap pprof profiles:
Expand Down
8 changes: 5 additions & 3 deletions crates/iroha_kagami/src/wasm.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::path::PathBuf;
use std::{
io::{BufWriter, Write},
path::PathBuf,
};

use clap::{Subcommand, Args as ClapArgs};
use clap::{Args as ClapArgs, Subcommand};
use color_eyre::eyre::{eyre, Context};
use iroha_wasm_builder::Builder;
use owo_colors::OwoColorize;
use std::io::{BufWriter, Write};

use crate::{Outcome, RunArgs};

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build() {
mkdir -p "$TARGET_DIR/$1"
for name in ${NAMES[@]}; do
out_file="$TARGET_DIR/$1/$name.wasm"
cargo run --bin kagami wasm -- build "$CARGO_DIR/$1/$name" --optimize --out-file "$out_file"
cargo run --bin kagami -- wasm build "$CARGO_DIR/$1/$name" --optimize --out-file "$out_file"
done
echo "info: WASM $1 build complete"
echo "artifacts written to $TARGET_DIR/$1/"
Expand Down
2 changes: 1 addition & 1 deletion wasm/libs/default_executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Use the [Kagami Wasm Builder](../../../crates/iroha_kagami/README.md) in order to build it:

```bash
cargo run --bin kagami wasm -- \
cargo run --bin kagami -- wasm \
build ./wasm/libs/default_executor --optimize --out-file ./defaults/executor.wasm
```

0 comments on commit 4c383c9

Please sign in to comment.