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:
Pierre Krieger
2019-09-18 22:00:44 +02:00
committed by Bastian Köcher
parent 49ad0dbdff
commit 9ea3d8fc52
14 changed files with 11 additions and 26 deletions
+5 -5
View File
@@ -2548,7 +2548,7 @@ dependencies = [
"substrate-offchain-primitives 2.0.0",
"substrate-primitives 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]]
@@ -5475,7 +5475,7 @@ dependencies = [
[[package]]
name = "substrate-wasm-builder"
version = "1.0.6"
version = "1.0.7"
dependencies = [
"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)",
@@ -5487,12 +5487,12 @@ dependencies = [
[[package]]
name = "substrate-wasm-builder-runner"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
version = "1.0.3"
[[package]]
name = "substrate-wasm-builder-runner"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
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_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-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 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"
@@ -18,4 +18,3 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
[features]
default = [ "std" ]
std = []
no_std = []
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
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
// external memory allocator.
-1
View File
@@ -44,7 +44,6 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
default = [
"std",
]
no_std = []
std = [
"log",
"serde",
+1 -1
View File
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
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
// to this value by default. This is because some of our tests (`restoration_of_globals`)
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "substrate-wasm-builder"
version = "1.0.6"
version = "1.0.7"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Utility for building WASM binaries"
edition = "2018"
@@ -9,7 +9,6 @@ A project that should be compiled as a WASM binary needs to:
1. Add a `build.rs` file.
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:
@@ -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:
```rust
@@ -25,7 +25,6 @@
//!
//! 1. Add a `build.rs` file.
//! 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:
//!
@@ -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:
//!
//! ```ignore
@@ -270,7 +270,7 @@ fn create_project(cargo_manifest: &Path, wasm_workspace: &Path) -> PathBuf {
crate-type = ["cdylib"]
[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_path = crate_path.display(),
@@ -55,4 +55,3 @@ std = [
"offchain-primitives/std",
"substrate-session/std",
]
no_std = []
+1 -1
View File
@@ -19,7 +19,7 @@ use wasm_builder_runner::{build_current_project_with_rustflags, WasmBuilderSourc
fn main() {
build_current_project_with_rustflags(
"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
// external memory allocator.
"-Clink-arg=--export=__heap_base",
-3
View File
@@ -53,9 +53,6 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
[features]
default = ["std"]
no_std = [
"contracts/core",
]
std = [
"authority-discovery-primitives/std",
"authority-discovery/std",
+1 -1
View File
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
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
// external memory allocator.
-3
View File
@@ -28,9 +28,6 @@ hex = "0.3"
[features]
default = ["std"]
core = [
"wasmi-validation/core",
]
std = [
"serde",
"codec/std",