feat(kagami wasm): move --profile into --cargo-args
Overview
This PR handles #5453, moving the --profile argument to --cargo-args and handling the case where the --profile argument is given multiple times.
Changes
- Updated
Args::Buildhandler branch to prioritize--profileargument inside--cargo-args, ignoring the other--profileargument (default or if any). - Updated
build_wasm.shto use--carg-args.
Hey, I’ve added the tests and logs you suggested, and also refactored some code to avoid unnecessary allocations. Does the change fromProfile to Option<Profile> inside Args::Build look good to you?
Please let me know if you'd like me to change anything.
Hey, this works, but I just realized I could have done it a bit better using #[arg(value_parser = ...)] and the tests could be written more cleanly too. I’ll add those changes soon. What do you think?
Hello, I've updated the code to use the parse function and added an else if branch for appropriate logging in different conditions.
Let me know if these changes look good to you.
Hey, this works, but I just realized I could have done it a bit better using
#[arg(value_parser = ...)]and the tests could be written more cleanly too. I’ll add those changes soon. What do you think?
Also, I don't think this will be possible because profile depends on cargo_args.
Hello, do these changes look good?
yeah, I see.
It isn't necessary that WASMs are built either with
releaseordeployprofile
then will they all just default to release?
then will they all just default to release?
Hmm, not sure. Actually, I've looked into the how wasm-pack handles profiles, and it has a limited set of pre-defined profiles (--dev, --profiling, --release), and uses --release as the default. So, maybe it's fine to leave things as is in iroha-wasm-builder... What do you think?