mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 22:51:03 +00:00
Remove the no_std feature from the WASM builder (#3640)
* Remove the no_std feature from the WASM builder * Address review * More fixing * Address review again * Fix missing Cargo.lock
This commit is contained in:
committed by
Bastian Köcher
parent
49ad0dbdff
commit
9ea3d8fc52
Generated
+5
-5
@@ -2548,7 +2548,7 @@ dependencies = [
|
|||||||
"substrate-offchain-primitives 2.0.0",
|
"substrate-offchain-primitives 2.0.0",
|
||||||
"substrate-primitives 2.0.0",
|
"substrate-primitives 2.0.0",
|
||||||
"substrate-session 2.0.0",
|
"substrate-session 2.0.0",
|
||||||
"substrate-wasm-builder-runner 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"substrate-wasm-builder-runner 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5475,7 +5475,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substrate-wasm-builder"
|
name = "substrate-wasm-builder"
|
||||||
version = "1.0.6"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cargo_metadata 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cargo_metadata 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -5487,12 +5487,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substrate-wasm-builder-runner"
|
name = "substrate-wasm-builder-runner"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substrate-wasm-builder-runner"
|
name = "substrate-wasm-builder-runner"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substrate-wasm-interface"
|
name = "substrate-wasm-interface"
|
||||||
@@ -6845,7 +6845,7 @@ dependencies = [
|
|||||||
"checksum strum 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d1c33039533f051704951680f1adfd468fd37ac46816ded0d9ee068e60f05f"
|
"checksum strum 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d1c33039533f051704951680f1adfd468fd37ac46816ded0d9ee068e60f05f"
|
||||||
"checksum strum_macros 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "47cd23f5c7dee395a00fa20135e2ec0fffcdfa151c56182966d7a3261343432e"
|
"checksum strum_macros 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "47cd23f5c7dee395a00fa20135e2ec0fffcdfa151c56182966d7a3261343432e"
|
||||||
"checksum substrate-bip39 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3be511be555a3633e71739a79e4ddff6a6aaa6579fa6114182a51d72c3eb93c5"
|
"checksum substrate-bip39 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3be511be555a3633e71739a79e4ddff6a6aaa6579fa6114182a51d72c3eb93c5"
|
||||||
"checksum substrate-wasm-builder-runner 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f52ecbff6cc3d6e5c6401828e15937b680f459d6803ce238f01fe615bc40d071"
|
"checksum substrate-wasm-builder-runner 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af21b27fad38b212c1919f700cb0def33c88cde14d22e0d1b17d4521f4eb8b40"
|
||||||
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
|
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
|
||||||
"checksum subtle 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01dca13cf6c3b179864ab3292bd794e757618d35a7766b7c46050c614ba00829"
|
"checksum subtle 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01dca13cf6c3b179864ab3292bd794e757618d35a7766b7c46050c614ba00829"
|
||||||
"checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e"
|
"checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e"
|
||||||
|
|||||||
@@ -18,4 +18,3 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
|
|||||||
[features]
|
[features]
|
||||||
default = [ "std" ]
|
default = [ "std" ]
|
||||||
std = []
|
std = []
|
||||||
no_std = []
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fn main() {
|
|||||||
"wasm_binary.rs",
|
"wasm_binary.rs",
|
||||||
WasmBuilderSource::CratesOrPath {
|
WasmBuilderSource::CratesOrPath {
|
||||||
path: "../../utils/wasm-builder",
|
path: "../../utils/wasm-builder",
|
||||||
version: "1.0.6",
|
version: "1.0.7",
|
||||||
},
|
},
|
||||||
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
||||||
// external memory allocator.
|
// external memory allocator.
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
|
|||||||
default = [
|
default = [
|
||||||
"std",
|
"std",
|
||||||
]
|
]
|
||||||
no_std = []
|
|
||||||
std = [
|
std = [
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fn main() {
|
|||||||
"wasm_binary.rs",
|
"wasm_binary.rs",
|
||||||
WasmBuilderSource::CratesOrPath {
|
WasmBuilderSource::CratesOrPath {
|
||||||
path: "../utils/wasm-builder",
|
path: "../utils/wasm-builder",
|
||||||
version: "1.0.6",
|
version: "1.0.7",
|
||||||
},
|
},
|
||||||
// Note that we set the stack-size to 1MB explicitly even though it is set
|
// Note that we set the stack-size to 1MB explicitly even though it is set
|
||||||
// to this value by default. This is because some of our tests (`restoration_of_globals`)
|
// to this value by default. This is because some of our tests (`restoration_of_globals`)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "substrate-wasm-builder"
|
name = "substrate-wasm-builder"
|
||||||
version = "1.0.6"
|
version = "1.0.7"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
description = "Utility for building WASM binaries"
|
description = "Utility for building WASM binaries"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ A project that should be compiled as a WASM binary needs to:
|
|||||||
|
|
||||||
1. Add a `build.rs` file.
|
1. Add a `build.rs` file.
|
||||||
2. Add `substrate-wasm-builder-runner` as dependency into `build-dependencies`.
|
2. Add `substrate-wasm-builder-runner` as dependency into `build-dependencies`.
|
||||||
3. Add a feature called `no-std`.
|
|
||||||
|
|
||||||
The `build.rs` file needs to contain the following code:
|
The `build.rs` file needs to contain the following code:
|
||||||
|
|
||||||
@@ -26,8 +25,6 @@ fn main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `no-std` feature will be enabled by WASM builder while compiling your project to WASM.
|
|
||||||
|
|
||||||
As the final step, you need to add the following to your project:
|
As the final step, you need to add the following to your project:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
//!
|
//!
|
||||||
//! 1. Add a `build.rs` file.
|
//! 1. Add a `build.rs` file.
|
||||||
//! 2. Add `substrate-wasm-builder-runner` as dependency into `build-dependencies`.
|
//! 2. Add `substrate-wasm-builder-runner` as dependency into `build-dependencies`.
|
||||||
//! 3. Add a feature called `no-std`.
|
|
||||||
//!
|
//!
|
||||||
//! The `build.rs` file needs to contain the following code:
|
//! The `build.rs` file needs to contain the following code:
|
||||||
//!
|
//!
|
||||||
@@ -42,8 +41,6 @@
|
|||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! The `no-std` feature will be enabled by WASM builder while compiling your project to WASM.
|
|
||||||
//!
|
|
||||||
//! As the final step, you need to add the following to your project:
|
//! As the final step, you need to add the following to your project:
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```ignore
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ fn create_project(cargo_manifest: &Path, wasm_workspace: &Path) -> PathBuf {
|
|||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasm_project = {{ package = "{crate_name}", path = "{crate_path}", default-features = false, features = [ "no_std" ] }}
|
wasm_project = {{ package = "{crate_name}", path = "{crate_path}", default-features = false }}
|
||||||
"#,
|
"#,
|
||||||
crate_name = crate_name,
|
crate_name = crate_name,
|
||||||
crate_path = crate_path.display(),
|
crate_path = crate_path.display(),
|
||||||
|
|||||||
@@ -55,4 +55,3 @@ std = [
|
|||||||
"offchain-primitives/std",
|
"offchain-primitives/std",
|
||||||
"substrate-session/std",
|
"substrate-session/std",
|
||||||
]
|
]
|
||||||
no_std = []
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ use wasm_builder_runner::{build_current_project_with_rustflags, WasmBuilderSourc
|
|||||||
fn main() {
|
fn main() {
|
||||||
build_current_project_with_rustflags(
|
build_current_project_with_rustflags(
|
||||||
"wasm_binary.rs",
|
"wasm_binary.rs",
|
||||||
WasmBuilderSource::Crates("1.0.6"),
|
WasmBuilderSource::Crates("1.0.7"),
|
||||||
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
||||||
// external memory allocator.
|
// external memory allocator.
|
||||||
"-Clink-arg=--export=__heap_base",
|
"-Clink-arg=--export=__heap_base",
|
||||||
|
|||||||
@@ -53,9 +53,6 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
no_std = [
|
|
||||||
"contracts/core",
|
|
||||||
]
|
|
||||||
std = [
|
std = [
|
||||||
"authority-discovery-primitives/std",
|
"authority-discovery-primitives/std",
|
||||||
"authority-discovery/std",
|
"authority-discovery/std",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fn main() {
|
|||||||
"wasm_binary.rs",
|
"wasm_binary.rs",
|
||||||
WasmBuilderSource::CratesOrPath {
|
WasmBuilderSource::CratesOrPath {
|
||||||
path: "../../core/utils/wasm-builder",
|
path: "../../core/utils/wasm-builder",
|
||||||
version: "1.0.6",
|
version: "1.0.7",
|
||||||
},
|
},
|
||||||
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
// This instructs LLD to export __heap_base as a global variable, which is used by the
|
||||||
// external memory allocator.
|
// external memory allocator.
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ hex = "0.3"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
core = [
|
|
||||||
"wasmi-validation/core",
|
|
||||||
]
|
|
||||||
std = [
|
std = [
|
||||||
"serde",
|
"serde",
|
||||||
"codec/std",
|
"codec/std",
|
||||||
|
|||||||
Reference in New Issue
Block a user