Clean up the wasm-builder and release 1.0.8 (#3858)

This commit is contained in:
Bastian Köcher
2019-10-20 13:02:21 +02:00
committed by GitHub
parent f5162edc83
commit 222ff6fe79
8 changed files with 23 additions and 24 deletions
+1 -1
View File
@@ -5759,7 +5759,7 @@ dependencies = [
[[package]]
name = "substrate-wasm-builder"
version = "1.0.7"
version = "1.0.8"
dependencies = [
"build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
path: "../../utils/wasm-builder",
version: "1.0.7",
version: "1.0.8",
},
// This instructs LLD to export __heap_base as a global variable, which is used by the
// external memory allocator.
+1 -1
View File
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
path: "../utils/wasm-builder",
version: "1.0.7",
version: "1.0.8",
},
// 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.7"
version = "1.0.8"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Utility for building WASM binaries"
edition = "2018"
+13 -10
View File
@@ -205,9 +205,7 @@ impl CargoCommand {
}
fn args(&mut self, args: &[&str]) -> &mut Self {
for arg in args {
self.arg(arg);
}
args.into_iter().for_each(|a| { self.arg(a); });
self
}
@@ -227,12 +225,17 @@ impl CargoCommand {
/// Check if the supplied cargo command is a nightly version
fn is_nightly(&self) -> bool {
self.command()
.arg("--version")
.output()
.map_err(|_| ())
.and_then(|o| String::from_utf8(o.stdout).map_err(|_| ()))
.unwrap_or_default()
.contains("-nightly")
// `RUSTC_BOOTSTRAP` tells a stable compiler to behave like a nightly. So, when this env
// variable is set, we can assume that whatever rust compiler we have, it is a nightly compiler.
// For "more" information, see:
// https://github.com/rust-lang/rust/blob/fa0f7d0080d8e7e9eb20aa9cbf8013f96c81287f/src/libsyntax/feature_gate/check.rs#L891
env::var("RUSTC_BOOTSTRAP").is_ok() ||
self.command()
.arg("--version")
.output()
.map_err(|_| ())
.and_then(|o| String::from_utf8(o.stdout).map_err(|_| ()))
.unwrap_or_default()
.contains("-nightly")
}
}
@@ -14,7 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use std::{env, fs};
use std::fs;
use tempfile::tempdir;
/// Checks that all prerequisites are installed.
@@ -22,20 +23,15 @@ use tempfile::tempdir;
/// # Returns
/// Returns `None` if everything was found and `Some(ERR_MSG)` if something could not be found.
pub fn check() -> Option<&'static str> {
if !rustc_stable_forced_to_nightly() && !check_nightly_installed(){
if !check_nightly_installed(){
return Some("Rust nightly not installed, please install it!")
}
check_wasm_toolchain_installed()
}
fn rustc_stable_forced_to_nightly() -> bool {
env::var("RUSTC_BOOTSTRAP") == Ok("1".to_string())
}
fn check_nightly_installed() -> bool {
let command = crate::get_nightly_cargo();
command.is_nightly()
crate::get_nightly_cargo().is_nightly()
}
fn check_wasm_toolchain_installed() -> Option<&'static str> {
+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.7"),
WasmBuilderSource::Crates("1.0.8"),
// This instructs LLD to export __heap_base as a global variable, which is used by the
// external memory allocator.
"-Clink-arg=--export=__heap_base",
+1 -1
View File
@@ -21,7 +21,7 @@ fn main() {
"wasm_binary.rs",
WasmBuilderSource::CratesOrPath {
path: "../../core/utils/wasm-builder",
version: "1.0.7",
version: "1.0.8",
},
// This instructs LLD to export __heap_base as a global variable, which is used by the
// external memory allocator.