Skip to content

Commit dbaeb73

Browse files
Fix runtime build with the latest rustc (#17)
1 parent 7d5e548 commit dbaeb73

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ jobs:
5858
cache-all-crates: true
5959

6060
- name: Cargo check
61-
run: |
62-
SKIP_WASM_BUILD=1 cargo check
61+
run: cargo check
6362

6463
check-benchmarking:
6564
name: Cargo check (benchmarking)

runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sp-consensus-grandpa = { default-features = false, git = "https://github.com/par
3838
sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
3939
sp-genesis-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
4040
sp-inherents = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
41-
sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
41+
sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e", features = ["disable_panic_handler"] }
4242
sp-offchain = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
4343
sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }
4444
sp-session = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" }

runtime/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub use sp_runtime::{Perbill, Permill};
6464

6565
mod bridge_config;
6666
mod genesis_config_presets;
67+
mod panic_handler;
6768
mod weights;
6869
mod xcm_config;
6970

runtime/src/panic_handler.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//! Panic handler for builds without `std`.
2+
3+
// TODO: Remove this file once `sp-io` is upgraded.
4+
// See https://github.com/paritytech/polkadot-bulletin-chain/issues/18.
5+
6+
use sp_core::LogLevel;
7+
8+
#[cfg(not(feature = "std"))]
9+
#[panic_handler]
10+
pub fn panic(info: &core::panic::PanicInfo) -> ! {
11+
let message = alloc::format!("{}", info);
12+
sp_io::logging::log(LogLevel::Error, "runtime", message.as_bytes());
13+
unreachable!();
14+
}

0 commit comments

Comments
 (0)