-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Make debug builds more usable #4683
Conversation
This pr makes debug builds more usable in terms of `cargo run -- --dev`. 1. `--dev` activates `--execution native`, iff `--execution` is not given or no sub `--execution-*` is given. 2. It was probably a mistake to compile WASM in debug for a debug build. So, we now build the WASM binary always as `release` (if not requested differently by the user). So, we trade compilation time for a better debug experience.
tomusdrw
left a comment
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.
Seems reasonable.
client/cli/src/lib.rs
Outdated
|
|
||
| let exec = &cli.execution_strategies; | ||
| let exec_all_or = |strat: ExecutionStrategy| exec.execution.unwrap_or(strat).into(); | ||
| let exec_all_or = |strat: ExecutionStrategy| execution.unwrap_or(strat).into(); |
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.
This will default to execution even if strat is ovewritten in CLI, I thought you wanted to use strat and only default to execution, no?
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.
Seems like we need to test whether exec was explicitly set or if it's a default as part of is_dev being true.
andresilva
left a comment
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.
overall lgtm. issue regarding default handling.
client/cli/src/lib.rs
Outdated
|
|
||
| let exec = &cli.execution_strategies; | ||
| let exec_all_or = |strat: ExecutionStrategy| exec.execution.unwrap_or(strat).into(); | ||
| let exec_all_or = |strat: ExecutionStrategy| execution.unwrap_or(strat).into(); |
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.
Seems like we need to test whether exec was explicitly set or if it's a default as part of is_dev being true.
|
Okay, ignore the last commit. |
|
I use this for development: |
I'm not sure, I looked at the output and it clearly changes between both. My intention of this pr was to make |
|
The previous behavior was by default printing runtime logs including extrinsic failing messages and it was disabled by some logger changes and people were wondering why they can no longer see the logging messages from runtime. Those logs are not useful for a normal full node but super useful for developments purpose. |
andresilva
left a comment
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.
lgtm
| build_current_project_with_rustflags( | ||
| "wasm_binary.rs", | ||
| WasmBuilderSource::Crates("1.0.8"), | ||
| WasmBuilderSource::Crates("1.0.9"), |
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.
Do we also need to bump this on other substrate node template based projects?
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.
When you want to always have release" builds, yes.
Yeah these logs were disabled because of people complaining about the noise in the output when syncing :) FWIW, I will make sure that we document this. |
This pr makes debug builds more usable in terms of
cargo run -- --dev.--devactivates--execution native, iff--executionis notgiven or no sub
--execution-*is given.So, we now build the WASM binary always as
release(if not requesteddifferently by the user). So, we trade compilation time for a better
debug experience.