-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Restructure frame_benchmarking
macro related exports
#14787
Restructure frame_benchmarking
macro related exports
#14787
Conversation
…o-related-exports
Co-authored-by: Bastian Köcher <git@kchr.de>
…o-related-exports
bot rebase |
…orts' into jg/restructure-benchmarking-macro-related-exports
Rebased |
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.
Looking good, just not sure if a stderr log needs to be adjusted.
help: consider importing one of these items | ||
| | ||
1 + use frame_benchmarking::__private::traits::PalletInfo; |
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.
Shouldn't this suggest
help: consider importing one of these items | |
| | |
1 + use frame_benchmarking::__private::traits::PalletInfo; | |
help: consider importing one of these items | |
| | |
1 + use frame_support::traits::PalletInfo; |
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.
Interesting, do you know if it is possible to somehow tell the compiler to ignore that option?
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.
maybe @sam0x17 knows
@@ -1,6 +1,7 @@ | |||
//! Benchmarking setup for pallet-template | |||
#![cfg(feature = "runtime-benchmarks")] | |||
use super::*; | |||
use sp_std::vec; |
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 looks wrong? I don't see any usage of the macro in here. Maybe some macro needs this? If yes, it should pull this in automatically.
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 is expected here https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3434676
[2023-08-24 12:21:48] error: cannot find macro `vec` in this scope
[2023-08-24 12:21:48] --> /builds/parity/mirrors/substrate/bin/node-template/pallets/template/src/benchmarking.rs:10:1
[2023-08-24 12:21:48] |
[2023-08-24 12:21:48] 10 | #[benchmarks]
[2023-08-24 12:21:48] | ^^^^^^^^^^^^^
[2023-08-24 12:21:48] |
[2023-08-24 12:21:48] = help: consider importing one of these items:
[2023-08-24 12:21:48] crate::benchmarking::__private::vec
[2023-08-24 12:21:48] frame_benchmarking::__private::vec
[2023-08-24 12:21:48] scale_info::prelude::vec
[2023-08-24 12:21:48] sp_std::vec
[2023-08-24 12:21:48] = note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info)
use crate::benchmarks; | ||
use frame_system::Pallet as System; | ||
use sp_runtime::{ | ||
traits::{AppVerify, Hash}, | ||
RuntimeAppPublic, | ||
}; | ||
use sp_std::{vec, vec::Vec}; |
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.
Here again?
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 is actually required https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3434492
[2023-08-24 12:02:10] error: cannot find macro `vec` in this scope
[2023-08-24 12:02:10] --> /builds/parity/mirrors/substrate/frame/benchmarking/src/baseline.rs:93:14
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 93 | let msg = vec![j, j];
[2023-08-24 12:02:10] | ^^^
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] = help: consider importing one of these items:
[2023-08-24 12:02:10] crate::__private::vec
[2023-08-24 12:02:10] scale_info::prelude::vec
[2023-08-24 12:02:10] sp_api::vec
[2023-08-24 12:02:10] sp_std::vec
[2023-08-24 12:02:10]
[2023-08-24 12:02:10] error[E0412]: cannot find type `Vec` in this scope
[2023-08-24 12:02:10] --> /builds/parity/mirrors/substrate/frame/benchmarking/src/baseline.rs:92:21
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 92 | let msg_and_sigs: Vec<_> = (0..sigs_count).map(|j| {
[2023-08-24 12:02:10] | ^^^ not found in this scope
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] help: consider importing one of these items
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 23 + use crate::__private::Vec;
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 23 + use frame_support::dispatch::Vec;
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 23 + use scale_info::prelude::vec::Vec;
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] 23 + use sp_api::vec::Vec;
[2023-08-24 12:02:10] |
[2023-08-24 12:02:10] and 2 other candidates
bot merge |
Partial for paritytech/polkadot-sdk#172