-
Notifications
You must be signed in to change notification settings - Fork 40
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
Decouple benchmark dependencies from node #172
Conversation
native_executor_instance!( | ||
pub Executor, | ||
zeitgeist_runtime::api::dispatch, | ||
zeitgeist_runtime::native_version, |
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.
IIRC, frame_benchmarking::benchmarking::HostFunctions
removal shouldn't be a problem. Still need to double check it
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.
Thanks, the computers love you for this!
RUST_BACKTRACE=1 cargo fuzz run --fuzz-dir zrml/prediction-markets/fuzz full_workflow -- -runs=$RUNS | ||
RUST_BACKTRACE=1 cargo fuzz run --fuzz-dir zrml/prediction-markets/fuzz pm_full_workflow -- -runs=$RUNS | ||
|
||
RUST_BACKTRACE=1 cargo fuzz run --fuzz-dir zrml/swaps/fuzz full_workflow -- -runs=$RUNS | ||
RUST_BACKTRACE=1 cargo fuzz run --fuzz-dir zrml/swaps/fuzz swaps_full_workflow -- -runs=$RUNS |
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 is a nice fix you included along the way.
if [[ "$package" == "zrml/market-commons" ]]; then | ||
test_package_with_feature "$package" std | ||
continue | ||
fi | ||
|
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.
There might be multiple pallets in the future that don't have the runtime-benchmarks feature, but I think it is reasonable to fix it when the second pallet without that feature is included.
std = [ | ||
"frame-benchmarking?/std", |
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.
What does the ?
operator do in this context? (I was not able to find it in the cargo book)
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 activating an optional feature like serde/std
, Cargo unconditionally also brings the whole dependency and this situation was causing some problems on CI, thus the reason for #157.
In this example, frame-benchmarking?/std
means that the frame-benchmarking
crate won't be included when calling cargo build --features std
. rust-lang/cargo#8832
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.
Sweet, thanks for clarifying!
Taking aside the benchmark decoupling from the
node
crate, this PR also tries to remove unnecessary dependencies to speed-up builds and improve CI times.Locally,
cargo check
went down from ~971 to ~948 crates.