`kagami wasm`: move `--profile` into `--cargo-args`
I think
profilecan be moved to--cargo-argseventually.
Originally posted by @aoyako in https://github.com/hyperledger-iroha/iroha/pull/5449#discussion_r2108438404
@0x009922 Hey!
Could you please clarify what you meant by moving --profile into --cargo-args? thanks!
@Levi0804 Hey!
The --profile argument of kagami wasm is just passed directly to Cargo internally. Since I've introduced --cargo-args in #5449, it is possible to remove a dedicated argument for --profile from kagami wasm:
# before
kagami wasm build path/to/wasm --profile deploy --cargo-args="--locked"
# after
kagami wasm build path/to/wasm --cargo-args="--locked --profile deploy"
So, this task is about:
- Soft-deprecating the current
--profileargument ofkagami wasm - Updating existing scripts (
build_wasm.sh) to use--cargo-args
- Soft-deprecating the current
--profileargument ofkagami wasm
Hey, Is this task only about warning for the argument?
Also, I pulled the branch from #5449 for the purpose of this issue and changed (in build_wasm.sh):
# this
"${bin_kagami[@]}" wasm build "$CARGO_DIR/$1/$name" --profile="$PROFILE" --out-file "$out_file" --cargo-args="--locked"
# to this
"${bin_kagami[@]}" wasm build "$CARGO_DIR/$1/$name" --out-file "$out_file" --cargo-args="--locked --profile deploy"
and got the following error:
error: the argument '--profile <PROFILE-NAME>' cannot be used multiple times
Hey, Is this task only about warning for the argument?
and got the following error:
error: the argument '--profile <PROFILE-NAME>' cannot be used multiple times
No, it isn't only about warning. As you can see, you need to implement an internal change in kagami wasm so that it handles both --profile and --cargo-args properly.
Currently, if no --profile provided, it puts some default value, hence the "multiple times" error.
@0x009922 I created a PR. Please take a look when you have some time.