-
Notifications
You must be signed in to change notification settings - Fork 279
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
--release
flag to wasm_builder--release
flag to wasm_builder
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
crates/iroha_wasm_builder/src/lib.rs
Outdated
"--release", | ||
if self.release { "--release" } else { "" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some CI workflows should keep --release
build, at least iroha2-release.yml
and maybe iroha2-custom-image.yml
@BAStos525 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- it should definitely be
release
foriroha2-release.yml
- for the custom image it should use the
PROFILE
variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In iroha2-release.yml
we use the tag taken from github.ref_name
- it's the tag name. Should any changes be introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only *.wasm
quality is discussed here, which would only affect e.g. this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI will use release
due to the need for additional resources (memory, fuel) and adjusted timeouts. Nevertheless, the debug flag can be set when building WASM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI will use
release
due to the need for additional resources (memory, fuel) and adjusted timeouts. Nevertheless, the debug flag can be set when building WASM.
I would like CI to use test
when testing things and release
(or deploy
) when deploying. Yes, this will require you to adjust timeouts and limits in the test_network
(don't modify parameters in genesis.json
)
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
[profile.deploy] | ||
inherits = "release" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[profile.deploy] | |
inherits = "release" | |
[profile.release] | |
panic="abort" | |
[profile.deploy] | |
inherits = "release" | |
strip = "debuginfo" | |
lto = true | |
opt-level = "z" | |
codegen-units = 1 |
Signed-off-by: Lohachov Mykhailo <[email protected]>
Recap:
|
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
@@ -1,5 +1,5 @@ | |||
[profile.default] | |||
retries = 2 | |||
retries = { backoff = "fixed", count = 2, delay = "3s" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For release
it is good.
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
crates/iroha_wasm_builder/src/lib.rs
Outdated
/// let bytes = Builder::new("relative/path/to/smartcontract/", "release") | ||
/// .out_dir("path/to/out/dir") // Optional: Set output directory | ||
/// .build()? // Run build | ||
/// .optimize()? // Optimize WASM output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// let bytes = Builder::new("relative/path/to/smartcontract/", "release") | |
/// .out_dir("path/to/out/dir") // Optional: Set output directory | |
/// .build()? // Run build | |
/// .optimize()? // Optimize WASM output | |
/// let bytes = Builder::new("relative/path/to/smartcontract/", "release") | |
/// .out_dir("path/to/out/dir") // Optional: Set output directory | |
/// .build()? // Run build |
shouldn't exist anymore, should be implied by the deploy
profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense.
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
aef69ef
to
89d1535
Compare
Signed-off-by: Lohachov Mykhailo <[email protected]>
e01eae5
to
bd5ea86
Compare
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
Context
Resolves #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:--release -O -Os
to the build.Changes in
build_wasm.sh
Now,
build_wasm.sh
produces adebug
build by default. Flag--release
can be added to build in optimized mode.Checklist
CONTRIBUTING.md
.