From 1cffb90feaf86195281b61ae2e4c2a851aefb73d Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 21 Dec 2019 14:35:43 -0800 Subject: [PATCH 1/5] Fix unused import warning, deny more warnings. --- lib/llvm-backend-tests/src/lib.rs | 10 ++++++++++ lib/llvm-backend-tests/tests/compile.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/llvm-backend-tests/src/lib.rs b/lib/llvm-backend-tests/src/lib.rs index ea79b78721e..ccea312aa54 100644 --- a/lib/llvm-backend-tests/src/lib.rs +++ b/lib/llvm-backend-tests/src/lib.rs @@ -1,3 +1,13 @@ +#![deny( + dead_code, + nonstandard_style, + unused_imports, + unused_mut, + unused_variables, + unused_unsafe, + unreachable_patterns +)] + pub use wabt::wat2wasm; use wasmer_llvm_backend::LLVMCompiler; use wasmer_runtime_core::backend::Compiler; diff --git a/lib/llvm-backend-tests/tests/compile.rs b/lib/llvm-backend-tests/tests/compile.rs index 1e32f6dd08d..11655095b20 100644 --- a/lib/llvm-backend-tests/tests/compile.rs +++ b/lib/llvm-backend-tests/tests/compile.rs @@ -1,4 +1,4 @@ -use wasmer_llvm_backend::{InkwellMemoryBuffer, InkwellModule, LLVMBackendConfig, LLVMCallbacks}; +use wasmer_llvm_backend::{InkwellModule, LLVMBackendConfig, LLVMCallbacks}; use wasmer_llvm_backend_tests::{get_compiler, wat2wasm}; use wasmer_runtime::{imports, CompilerConfig}; use wasmer_runtime_core::{backend::BackendCompilerConfig, compile_with, compile_with_config}; From 81f879565ddad5cfdc5e834733951358fa15ab8e Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 22 Dec 2019 12:28:33 +0100 Subject: [PATCH 2/5] Add MIT license to crates that were missing it Ran into a few crates in this repo with our license scanner that didn't have any license attached to them. Added MIT to be consistent with the other crates. Please adjust if not correct. --- examples/plugin-for-example/Cargo.toml | 1 + lib/kernel-loader/Cargo.toml | 1 + lib/kernel-net/Cargo.toml | 1 + lib/llvm-backend-tests/Cargo.toml | 1 + lib/wasi-experimental-io-devices/Cargo.toml | 1 + 5 files changed, 5 insertions(+) diff --git a/examples/plugin-for-example/Cargo.toml b/examples/plugin-for-example/Cargo.toml index 28d23491031..6df3389db25 100644 --- a/examples/plugin-for-example/Cargo.toml +++ b/examples/plugin-for-example/Cargo.toml @@ -2,6 +2,7 @@ name = "plugin-for-example" version = "0.1.0" authors = ["The Wasmer Engineering Team "] +license = "MIT" edition = "2018" [dependencies] diff --git a/lib/kernel-loader/Cargo.toml b/lib/kernel-loader/Cargo.toml index d1eab2f8291..03149f6cdcf 100644 --- a/lib/kernel-loader/Cargo.toml +++ b/lib/kernel-loader/Cargo.toml @@ -2,6 +2,7 @@ name = "wasmer-kernel-loader" version = "0.1.0" authors = ["Heyang Zhou "] +license = "MIT" edition = "2018" [dependencies] diff --git a/lib/kernel-net/Cargo.toml b/lib/kernel-net/Cargo.toml index 28db6bf4d4f..f8242c89966 100644 --- a/lib/kernel-net/Cargo.toml +++ b/lib/kernel-net/Cargo.toml @@ -2,6 +2,7 @@ name = "kernel-net" version = "0.1.0" authors = ["Heyang Zhou "] +license = "MIT" edition = "2018" [dependencies] diff --git a/lib/llvm-backend-tests/Cargo.toml b/lib/llvm-backend-tests/Cargo.toml index 11d357b249f..606be406bca 100644 --- a/lib/llvm-backend-tests/Cargo.toml +++ b/lib/llvm-backend-tests/Cargo.toml @@ -2,6 +2,7 @@ name = "wasmer-llvm-backend-tests" version = "0.10.2" authors = ["Nick Lewycky "] +license = "MIT" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/lib/wasi-experimental-io-devices/Cargo.toml b/lib/wasi-experimental-io-devices/Cargo.toml index 5203783c0bf..8727ba80579 100644 --- a/lib/wasi-experimental-io-devices/Cargo.toml +++ b/lib/wasi-experimental-io-devices/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" repository = "https://github.com/wasmerio/wasmer" publish = true description = "An experimental non-standard WASI extension for graphics" +license = "MIT" [badges] maintenance = { status = "experimental" } From 1e6149ed9495ea519dec67d80c3a42fb13ea2f8d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2019 07:38:11 +0000 Subject: [PATCH 3/5] Bump parking_lot from 0.9.0 to 0.10.0 Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0. - [Release notes](https://github.com/Amanieu/parking_lot/releases) - [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md) - [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f5d6d7c81c..bcbe7400da9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -558,7 +558,7 @@ dependencies = [ "libc", "llvm-sys", "once_cell", - "parking_lot 0.10.0", + "parking_lot", "regex", ] @@ -827,17 +827,6 @@ dependencies = [ "md5", ] -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api", - "parking_lot_core 0.6.2", - "rustc_version", -] - [[package]] name = "parking_lot" version = "0.10.0" @@ -845,22 +834,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" dependencies = [ "lock_api", - "parking_lot_core 0.7.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "rustc_version", - "smallvec 0.6.13", - "winapi", + "parking_lot_core", ] [[package]] @@ -1787,7 +1761,7 @@ dependencies = [ "libc", "nix", "page_size", - "parking_lot 0.9.0", + "parking_lot", "rustc_version", "serde", "serde-bench", From d3d720babd6f3d59922457dda5935da64dd2fe4c Mon Sep 17 00:00:00 2001 From: Mark McCaskey Date: Mon, 6 Jan 2020 15:30:30 -0500 Subject: [PATCH 4/5] Improve formatting of error messages we display from wabt --- Cargo.lock | 32 +++++++++++++++++++++++++++++--- src/bin/wasmer.rs | 19 +++++++++++++++++-- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcbe7400da9..0f5d6d7c81c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -558,7 +558,7 @@ dependencies = [ "libc", "llvm-sys", "once_cell", - "parking_lot", + "parking_lot 0.10.0", "regex", ] @@ -827,6 +827,17 @@ dependencies = [ "md5", ] +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api", + "parking_lot_core 0.6.2", + "rustc_version", +] + [[package]] name = "parking_lot" version = "0.10.0" @@ -834,7 +845,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.7.0", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec 0.6.13", + "winapi", ] [[package]] @@ -1761,7 +1787,7 @@ dependencies = [ "libc", "nix", "page_size", - "parking_lot", + "parking_lot 0.9.0", "rustc_version", "serde", "serde-bench", diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 1c19e6082c7..04ef6d3a2f3 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -11,6 +11,7 @@ extern crate structopt; use std::collections::HashMap; use std::env; +use std::error::Error; use std::fs::{metadata, read_to_string, File}; use std::io; use std::io::Read; @@ -623,8 +624,22 @@ fn execute_wasm(options: &Run) -> Result<(), String> { if !utils::is_wasm_binary(&wasm_binary) { let features = options.features.into_wabt_features(); - wasm_binary = wabt::wat2wasm_with_features(wasm_binary, features) - .map_err(|e| format!("Can't convert from wast to wasm: {:?}", e))?; + wasm_binary = wabt::wat2wasm_with_features(wasm_binary, features).map_err(|e| { + format!( + "Can't convert from wast to wasm because \"{}\"{}", + e.description(), + match e.kind() { + wabt::ErrorKind::Deserialize(s) + | wabt::ErrorKind::Parse(s) + | wabt::ErrorKind::ResolveNames(s) + | wabt::ErrorKind::Validate(s) => format!(":\n\n{}", s), + wabt::ErrorKind::Nul + | wabt::ErrorKind::WriteText + | wabt::ErrorKind::NonUtf8Result + | wabt::ErrorKind::WriteBinary => "".to_string(), + } + ) + })?; } let compiler: Box = get_compiler_by_backend(options.backend, options) From 027466867505315d2db3503ab11b4eed9c4193cd Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 7 Jan 2020 14:21:50 +0100 Subject: [PATCH 5/5] doc(runtime-c-api) Fix a typo. --- lib/runtime-c-api/src/import/wasi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runtime-c-api/src/import/wasi.rs b/lib/runtime-c-api/src/import/wasi.rs index 1dd9d4c15e9..fab0a1c5f74 100644 --- a/lib/runtime-c-api/src/import/wasi.rs +++ b/lib/runtime-c-api/src/import/wasi.rs @@ -11,7 +11,7 @@ pub enum Version { Unknown = 0, /// Latest version. See `wasmer_wasi::WasiVersion::Latest` to - /// leran more. + /// learn more. Latest = 1, /// `wasi_unstable`.