Properly detect debug build in slots (#3630)

`debug-assertions` can also be enabled in for release builds. This
introduces a new build-script that extracts the build type from the
`PROFILE` env variable and sets the `build_type` cfg.
This commit is contained in:
Bastian Köcher
2019-09-17 14:39:40 +02:00
committed by GitHub
parent 113d512300
commit 2b040fe983
3 changed files with 26 additions and 2 deletions
+2 -2
View File
@@ -209,7 +209,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
if slot_after_building != slot_number {
info!("Discarding proposal for slot {}; block production took too long", slot_number);
// If the node was compiled with debug, tell the user to use release optimizations.
#[cfg(debug_assertions)]
#[cfg(build_type="debug")]
info!("Recompile your node in `--release` mode to mitigate this problem.");
telemetry!(CONSENSUS_INFO; "slots.discarding_proposal_took_too_long";
"slot" => slot_number,
@@ -397,7 +397,7 @@ impl<T: Clone> SlotDuration<T> {
Some(v) => <T as codec::Decode>::decode(&mut &v[..])
.map(SlotDuration)
.map_err(|_| {
::client::error::Error::Backend({
client::error::Error::Backend({
error!(target: "slots", "slot duration kept in invalid format");
format!("slot duration kept in invalid format")
})