diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ccb44288..a2388eac 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -58,8 +58,7 @@ jobs: cache-all-crates: true - name: Cargo check - run: | - SKIP_WASM_BUILD=1 cargo check + run: cargo check check-benchmarking: name: Cargo check (benchmarking) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 177d56a8..b8829ea2 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -38,7 +38,7 @@ sp-consensus-grandpa = { default-features = false, git = "https://github.com/par sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } sp-genesis-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } sp-inherents = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } -sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e", features = ["disable_panic_handler"] } sp-offchain = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } sp-session = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", rev = "cdf107de700388a52a17b2fb852c98420c78278e" } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2a336b01..74ff2bbc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,6 +64,7 @@ pub use sp_runtime::{Perbill, Permill}; mod bridge_config; mod genesis_config_presets; +mod panic_handler; mod weights; mod xcm_config; diff --git a/runtime/src/panic_handler.rs b/runtime/src/panic_handler.rs new file mode 100644 index 00000000..4878eee1 --- /dev/null +++ b/runtime/src/panic_handler.rs @@ -0,0 +1,14 @@ +//! Panic handler for builds without `std`. + +// TODO: Remove this file once `sp-io` is upgraded. +// See https://github.com/paritytech/polkadot-bulletin-chain/issues/18. + +use sp_core::LogLevel; + +#[cfg(not(feature = "std"))] +#[panic_handler] +pub fn panic(info: &core::panic::PanicInfo) -> ! { + let message = alloc::format!("{}", info); + sp_io::logging::log(LogLevel::Error, "runtime", message.as_bytes()); + unreachable!(); +}