Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
allow re-use and avoid compiling kusama parachain code
  • Loading branch information
drahnr committed Jul 19, 2022
commit 3728a026439ad62cc5a4e6fb6bc033e846c8bc5e
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-native"]
default = ["wasmtime", "db", "cli", "hostperfcheck", "full-node", "trie-memory-tracker", "polkadot-native"]
wasmtime = ["sc-cli/wasmtime"]
db = ["service/db"]
cli = [
Expand All @@ -55,14 +55,14 @@ cli = [
"try-runtime-cli",
"polkadot-client",
"polkadot-node-core-pvf",
"polkadot-performance-test",
]
runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"]
trie-memory-tracker = ["sp-trie/memory-tracker"]
full-node = ["service/full-node"]
try-runtime = ["service/try-runtime"]
fast-runtime = ["service/fast-runtime"]
pyroscope = ["pyro"]
hostperfcheck = ["polkadot-performance-test"]

# Configure the native runtimes to use. Polkadot is enabled by default.
#
Expand Down
11 changes: 7 additions & 4 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ macro_rules! unwrap_client {
/// Should only be used in release build since the check would take too much time otherwise.
fn host_perf_check() -> Result<()> {
#[cfg(not(build_type = "release"))]
{
Err(PerfCheckError::WrongBuildType.into())
}
#[cfg(build_type = "release")]
return Err(PerfCheckError::WrongBuildType.into())

#[allow(unreachable_code)]
#[cfg(not(feature = "hostperfcheck"))]
return Err(PerfCheckError::FeatureNotEnabled { feature: "hostperfcheck" }.into())

#[cfg(all(build_type = "release", feature = "hostperfcheck"))]
{
crate::host_perf_check::host_perf_check()?;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod cli;
mod command;
#[cfg(feature = "cli")]
mod error;
#[cfg(all(feature = "cli", build_type = "release"))]
#[cfg(all(feature = "hostperfcheck", build_type = "release"))]
mod host_perf_check;

#[cfg(feature = "full-node")]
Expand Down
3 changes: 3 additions & 0 deletions node/test/performance-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ pub enum PerfCheckError {
#[error("This subcommand is only available in release mode")]
WrongBuildType,

#[error("This subcommand is only available when compiled with `{feature}`")]
FeatureNotEnabled { feature: &'static str },

#[error("No wasm code found for running the performance test")]
WasmBinaryMissing,

Expand Down