From b9b545e346ea12788606d93f9e9154e5bc11a07f Mon Sep 17 00:00:00 2001 From: jasl Date: Wed, 14 Dec 2022 23:04:23 +0800 Subject: [PATCH] Port https://github.com/paritytech/substrate/pull/12790 --- runtime/khala/Cargo.toml | 3 ++- runtime/khala/build.rs | 15 ++++++++------- runtime/phala/Cargo.toml | 3 ++- runtime/phala/build.rs | 16 +++++++++------- runtime/rhala/Cargo.toml | 3 ++- runtime/rhala/build.rs | 15 ++++++++------- runtime/shell/Cargo.toml | 3 ++- runtime/shell/build.rs | 15 ++++++++------- runtime/thala/Cargo.toml | 3 ++- runtime/thala/build.rs | 15 ++++++++------- 10 files changed, 51 insertions(+), 40 deletions(-) diff --git a/runtime/khala/Cargo.toml b/runtime/khala/Cargo.toml index c53a3884..6351a3b3 100644 --- a/runtime/khala/Cargo.toml +++ b/runtime/khala/Cargo.toml @@ -101,7 +101,7 @@ subbridge-pallets = { path = "../../pallets/subbridge", default-features = false pallet-phala-world = { path = "../../pallets/phala-world", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", optional = true } [features] default = ["std", "include-wasm"] @@ -156,6 +156,7 @@ std = [ "sp-transaction-pool/std", "sp-inherents/std", "sp-consensus-aura/std", + "substrate-wasm-builder", "frame-support/std", "frame-benchmarking/std", "frame-executive/std", diff --git a/runtime/khala/build.rs b/runtime/khala/build.rs index 69e5b608..f0b2c3e3 100644 --- a/runtime/khala/build.rs +++ b/runtime/khala/build.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build(); + } } diff --git a/runtime/phala/Cargo.toml b/runtime/phala/Cargo.toml index bab63fbe..df69661e 100644 --- a/runtime/phala/Cargo.toml +++ b/runtime/phala/Cargo.toml @@ -88,7 +88,7 @@ assets-registry = { path = "../../pallets/assets-registry", default-features = f subbridge-pallets = { path = "../../pallets/subbridge", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", optional = true } [features] default = ["std", "include-wasm"] @@ -140,6 +140,7 @@ std = [ "sp-transaction-pool/std", "sp-inherents/std", "sp-consensus-aura/std", + "substrate-wasm-builder", "frame-support/std", "frame-benchmarking/std", "frame-executive/std", diff --git a/runtime/phala/build.rs b/runtime/phala/build.rs index 69e5b608..42c05ec1 100644 --- a/runtime/phala/build.rs +++ b/runtime/phala/build.rs @@ -14,12 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build(); + } } + diff --git a/runtime/rhala/Cargo.toml b/runtime/rhala/Cargo.toml index af7bc7e4..9dd89746 100644 --- a/runtime/rhala/Cargo.toml +++ b/runtime/rhala/Cargo.toml @@ -101,7 +101,7 @@ subbridge-pallets = { path = "../../pallets/subbridge", default-features = false pallet-phala-world = { path = "../../pallets/phala-world", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", optional = true } [features] default = ["std", "include-wasm"] @@ -156,6 +156,7 @@ std = [ "sp-transaction-pool/std", "sp-inherents/std", "sp-consensus-aura/std", + "substrate-wasm-builder", "frame-support/std", "frame-benchmarking/std", "frame-executive/std", diff --git a/runtime/rhala/build.rs b/runtime/rhala/build.rs index 69e5b608..f0b2c3e3 100644 --- a/runtime/rhala/build.rs +++ b/runtime/rhala/build.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build(); + } } diff --git a/runtime/shell/Cargo.toml b/runtime/shell/Cargo.toml index f874cf10..49c3df95 100644 --- a/runtime/shell/Cargo.toml +++ b/runtime/shell/Cargo.toml @@ -47,7 +47,7 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot", default-feature pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", optional = true } [features] default = ["std"] @@ -67,6 +67,7 @@ std = [ "sp-block-builder/std", "sp-transaction-pool/std", "sp-inherents/std", + "substrate-wasm-builder", "frame-support/std", "frame-executive/std", "frame-system/std", diff --git a/runtime/shell/build.rs b/runtime/shell/build.rs index 2158995f..9108408d 100644 --- a/runtime/shell/build.rs +++ b/runtime/shell/build.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build(); + } } diff --git a/runtime/thala/Cargo.toml b/runtime/thala/Cargo.toml index ae2a1880..dafbb020 100644 --- a/runtime/thala/Cargo.toml +++ b/runtime/thala/Cargo.toml @@ -101,7 +101,7 @@ subbridge-pallets = { path = "../../pallets/subbridge", default-features = false pallet-phala-world = { path = "../../pallets/phala-world", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", optional = true } [features] default = ["std", "include-wasm"] @@ -157,6 +157,7 @@ std = [ "sp-transaction-pool/std", "sp-inherents/std", "sp-consensus-aura/std", + "substrate-wasm-builder", "frame-support/std", "frame-benchmarking/std", "frame-executive/std", diff --git a/runtime/thala/build.rs b/runtime/thala/build.rs index 69e5b608..f0b2c3e3 100644 --- a/runtime/thala/build.rs +++ b/runtime/thala/build.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build(); + } }