From 6cc31d3b49f1299b746125d81b88f589169239c3 Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Thu, 25 Jul 2019 11:42:47 +0300 Subject: [PATCH 01/16] lib.rs - making `wasmer_byte_array` fields `public` --- lib/runtime-c-api/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/runtime-c-api/src/lib.rs b/lib/runtime-c-api/src/lib.rs index 51f23517c..52a80f3fc 100644 --- a/lib/runtime-c-api/src/lib.rs +++ b/lib/runtime-c-api/src/lib.rs @@ -118,6 +118,6 @@ pub struct wasmer_limit_option_t { #[repr(C)] pub struct wasmer_byte_array { - bytes: *const u8, - bytes_len: u32, + pub bytes: *const u8, + pub bytes_len: u32, } From 015616b5414dfe07b65d5d0ff557d56b227cc90f Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Thu, 25 Jul 2019 14:59:59 +0300 Subject: [PATCH 02/16] export.rs - changing `FuncPointer` `inner` visibility to `pub` --- lib/runtime-core/src/export.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runtime-core/src/export.rs b/lib/runtime-core/src/export.rs index 81e0eae92..1be8cb283 100644 --- a/lib/runtime-core/src/export.rs +++ b/lib/runtime-core/src/export.rs @@ -34,7 +34,7 @@ impl FuncPointer { FuncPointer(f) } - pub(crate) fn inner(&self) -> *const vm::Func { + pub fn inner(&self) -> *const vm::Func { self.0 } } From f04d5523611748dabeeea03ce96a1746f0bfd8f9 Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Thu, 25 Jul 2019 15:46:57 +0300 Subject: [PATCH 03/16] wasmer-c-api: * error.rs - changing `update_last_error` visibility to `pub`. * error.rs - changing `CApiError` `msg` field visibility to `pub`. --- lib/runtime-c-api/src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/runtime-c-api/src/error.rs b/lib/runtime-c-api/src/error.rs index 1a9322df8..aea8691e9 100644 --- a/lib/runtime-c-api/src/error.rs +++ b/lib/runtime-c-api/src/error.rs @@ -11,7 +11,7 @@ thread_local! { static LAST_ERROR: RefCell>> = RefCell::new(None); } -pub(crate) fn update_last_error(err: E) { +pub fn update_last_error(err: E) { LAST_ERROR.with(|prev| { *prev.borrow_mut() = Some(Box::new(err)); }); @@ -89,8 +89,8 @@ pub unsafe extern "C" fn wasmer_last_error_message(buffer: *mut c_char, length: } #[derive(Debug)] -pub(crate) struct CApiError { - pub(crate) msg: String, +pub struct CApiError { + pub msg: String, } impl Display for CApiError { From 10fc660aadd899e46deddcf00239500dc19a82d2 Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Mon, 29 Jul 2019 13:41:28 +0300 Subject: [PATCH 04/16] `wasmer_byte_array` visibility revert (see PR: "wasmer-c-api-changes: making `wasmer_byte_array` fields `public` #589") --- lib/runtime-c-api/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/runtime-c-api/src/lib.rs b/lib/runtime-c-api/src/lib.rs index 52a80f3fc..51f23517c 100644 --- a/lib/runtime-c-api/src/lib.rs +++ b/lib/runtime-c-api/src/lib.rs @@ -118,6 +118,6 @@ pub struct wasmer_limit_option_t { #[repr(C)] pub struct wasmer_byte_array { - pub bytes: *const u8, - pub bytes_len: u32, + bytes: *const u8, + bytes_len: u32, } From a8d2469689937d2965c92bd9504fa7da7c0a3185 Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Mon, 29 Jul 2019 13:44:56 +0300 Subject: [PATCH 05/16] wasmer-c-api: returning back `pub(crate) fn inner` for `export.rs` --- lib/runtime-core/src/export.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runtime-core/src/export.rs b/lib/runtime-core/src/export.rs index 1be8cb283..81e0eae92 100644 --- a/lib/runtime-core/src/export.rs +++ b/lib/runtime-core/src/export.rs @@ -34,7 +34,7 @@ impl FuncPointer { FuncPointer(f) } - pub fn inner(&self) -> *const vm::Func { + pub(crate) fn inner(&self) -> *const vm::Func { self.0 } } From 89523e0186c62e29660cf437ca71effc77d5a894 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 14:48:48 -0700 Subject: [PATCH 06/16] Move media into installer dir --- {media => src/installer/media}/wizard_logo.ico | Bin {media => src/installer/media}/wizard_logo_2.bmp | Bin .../installer/media}/wizard_logo_small.bmp | Bin src/installer/wasmer.iss | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename {media => src/installer/media}/wizard_logo.ico (100%) rename {media => src/installer/media}/wizard_logo_2.bmp (100%) rename {media => src/installer/media}/wizard_logo_small.bmp (100%) diff --git a/media/wizard_logo.ico b/src/installer/media/wizard_logo.ico similarity index 100% rename from media/wizard_logo.ico rename to src/installer/media/wizard_logo.ico diff --git a/media/wizard_logo_2.bmp b/src/installer/media/wizard_logo_2.bmp similarity index 100% rename from media/wizard_logo_2.bmp rename to src/installer/media/wizard_logo_2.bmp diff --git a/media/wizard_logo_small.bmp b/src/installer/media/wizard_logo_small.bmp similarity index 100% rename from media/wizard_logo_small.bmp rename to src/installer/media/wizard_logo_small.bmp diff --git a/src/installer/wasmer.iss b/src/installer/wasmer.iss index 98e0c858f..c836fddc5 100644 --- a/src/installer/wasmer.iss +++ b/src/installer/wasmer.iss @@ -9,9 +9,9 @@ OutputDir=.\ DisableProgramGroupPage=yes ChangesEnvironment=yes OutputBaseFilename=WasmerInstaller -WizardImageFile=..\..\media\wizard_logo_2.bmp -WizardSmallImageFile=..\..\media\wizard_logo_small.bmp -SetupIconFile=..\..\media\wizard_logo.ico +WizardImageFile=media\wizard_logo_2.bmp +WizardSmallImageFile=media\wizard_logo_small.bmp +SetupIconFile=media\wizard_logo.ico DisableWelcomePage=no [Files] From 9bac6d8818b22b2833bb20a85479a81d3c801df9 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:05:04 -0700 Subject: [PATCH 07/16] Move fuzzer inside lib --- {fuzz => lib/fuzz}/.gitignore | 0 {fuzz => lib/fuzz}/Cargo.toml | 0 {fuzz => lib/fuzz}/README.md | 0 {fuzz => lib/fuzz}/fuzz_targets/simple_instantiate.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {fuzz => lib/fuzz}/.gitignore (100%) rename {fuzz => lib/fuzz}/Cargo.toml (100%) rename {fuzz => lib/fuzz}/README.md (100%) rename {fuzz => lib/fuzz}/fuzz_targets/simple_instantiate.rs (100%) diff --git a/fuzz/.gitignore b/lib/fuzz/.gitignore similarity index 100% rename from fuzz/.gitignore rename to lib/fuzz/.gitignore diff --git a/fuzz/Cargo.toml b/lib/fuzz/Cargo.toml similarity index 100% rename from fuzz/Cargo.toml rename to lib/fuzz/Cargo.toml diff --git a/fuzz/README.md b/lib/fuzz/README.md similarity index 100% rename from fuzz/README.md rename to lib/fuzz/README.md diff --git a/fuzz/fuzz_targets/simple_instantiate.rs b/lib/fuzz/fuzz_targets/simple_instantiate.rs similarity index 100% rename from fuzz/fuzz_targets/simple_instantiate.rs rename to lib/fuzz/fuzz_targets/simple_instantiate.rs From 11e22f05368dcd2f1feb96c27aa6e243aa72cdf6 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:05:15 -0700 Subject: [PATCH 08/16] Move architecture into docs --- ARCHITECTURE.md => docs/architecture.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ARCHITECTURE.md => docs/architecture.md (100%) diff --git a/ARCHITECTURE.md b/docs/architecture.md similarity index 100% rename from ARCHITECTURE.md rename to docs/architecture.md From a7db7f11f48686ff55e08ba6d5b37ea10519b502 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:09:23 -0700 Subject: [PATCH 09/16] Improved README --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 129b5452f..4b22c47af 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,13 @@ Install Wasmer with: curl https://get.wasmer.io -sSfL | sh ``` +> Note: *Wasmer is also available on Windows. Download the [`WasmerInstaller.exe` from the Github Releases](https://github.com/wasmerio/wasmer/releases) page.* + Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere ✨: -* [🦀 **Rust**](https://github.com/wasmerio/wasmer-rust-example) -* [**C/C++**](https://github.com/wasmerio/wasmer-c-api) +* [**🦀 Rust**](https://github.com/wasmerio/wasmer-rust-example) +* [**𝐂 C/C++**](https://github.com/wasmerio/wasmer-c-api) +* [**#️⃣ C#**](https://github.com/wasmerio/wasmer-c-api) * [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm) * [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm) * [**💎 Ruby**](https://github.com/wasmerio/ruby-ext-wasm) @@ -82,7 +85,7 @@ Wasmer is structured into different directories: Building Wasmer requires [rustup](https://rustup.rs/). -To build on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/) +To build Wasmer on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/) then follow the onscreen instructions. To build on other systems, run: @@ -146,8 +149,8 @@ pkg install cmake #### Windows (MSVC) -Windows support is _highly experimental_. Only simple Wasm programs may be run, and no syscalls are allowed. This means -nginx and Lua do not work on Windows. See [this issue](https://github.com/wasmerio/wasmer/issues/176) regarding Emscripten syscall polyfills for Windows. +Windows support is _experimental_. WASI is fully supported, but Emscripten support is on the works (this means +nginx and Lua do not work on Windows - you can track the progress on [this issue](https://github.com/wasmerio/wasmer/issues/176)). 1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) @@ -240,7 +243,7 @@ Below are some of the goals of this project (in order of priority): ## Architecture -If you would like to know how Wasmer works under the hood, please see [ARCHITECTURE.md](./ARCHITECTURE.md). +If you would like to know how Wasmer works under the hood, please see [docs/architecture.md](./docs/architecture.md). ## License From 20e424c11ed39f054fbd74f318bf8996e96cd595 Mon Sep 17 00:00:00 2001 From: Mark McCaskey Date: Thu, 1 Aug 2019 10:12:00 +0900 Subject: [PATCH 10/16] update wasmparser and clif-fork dependencies --- Cargo.lock | 148 +++++++++++++++--------------- lib/clif-backend/Cargo.toml | 6 +- lib/llvm-backend/Cargo.toml | 2 +- lib/runtime-core/Cargo.toml | 2 +- lib/singlepass-backend/Cargo.toml | 2 +- 5 files changed, 80 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca701633c..a95f8fec4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1390,7 +1390,7 @@ dependencies = [ [[package]] name = "wasmer" -version = "0.5.7" +version = "0.6.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1399,23 +1399,23 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-dev-utils 0.5.7", - "wasmer-emscripten 0.5.7", - "wasmer-emscripten-tests 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-dev-utils 0.6.0", + "wasmer-emscripten 0.6.0", + "wasmer-emscripten-tests 0.6.0", "wasmer-kernel-loader 0.1.0", - "wasmer-llvm-backend 0.5.7", - "wasmer-middleware-common 0.5.7", - "wasmer-runtime 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", - "wasmer-wasi 0.5.7", - "wasmer-wasi-tests 0.5.7", + "wasmer-llvm-backend 0.6.0", + "wasmer-middleware-common 0.6.0", + "wasmer-runtime 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", + "wasmer-wasi 0.6.0", + "wasmer-wasi-tests 0.6.0", ] [[package]] name = "wasmer-clif-backend" -version = "0.5.7" +version = "0.6.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-codegen 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1430,17 +1430,17 @@ dependencies = [ "serde_bytes 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-fork-frontend 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-fork-wasm 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", - "wasmer-win-exception-handler 0.5.7", - "wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-clif-fork-frontend 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-clif-fork-wasm 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.6.0", + "wasmer-win-exception-handler 0.6.0", + "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-clif-fork-frontend" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cranelift-codegen 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1450,7 +1450,7 @@ dependencies = [ [[package]] name = "wasmer-clif-fork-wasm" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cranelift-codegen 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1458,20 +1458,20 @@ dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-fork-frontend 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-clif-fork-frontend 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-dev-utils" -version = "0.5.7" +version = "0.6.0" dependencies = [ "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-emscripten" -version = "0.5.7" +version = "0.6.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1479,21 +1479,21 @@ dependencies = [ "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", + "wasmer-runtime-core 0.6.0", ] [[package]] name = "wasmer-emscripten-tests" -version = "0.5.7" +version = "0.6.0" dependencies = [ "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-dev-utils 0.5.7", - "wasmer-emscripten 0.5.7", - "wasmer-llvm-backend 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-dev-utils 0.6.0", + "wasmer-emscripten 0.6.0", + "wasmer-llvm-backend 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", ] [[package]] @@ -1501,12 +1501,12 @@ name = "wasmer-kernel-loader" version = "0.1.0" dependencies = [ "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", + "wasmer-runtime-core 0.6.0", ] [[package]] name = "wasmer-llvm-backend" -version = "0.5.7" +version = "0.6.0" dependencies = [ "capstone 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1521,51 +1521,51 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", - "wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.6.0", + "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-middleware-common" -version = "0.5.7" +version = "0.6.0" dependencies = [ "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-llvm-backend 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-llvm-backend 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", ] [[package]] name = "wasmer-runtime" -version = "0.5.7" +version = "0.6.0" dependencies = [ "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-llvm-backend 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-llvm-backend 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", ] [[package]] name = "wasmer-runtime-c-api" -version = "0.5.7" +version = "0.6.0" dependencies = [ "cbindgen 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime 0.5.7", - "wasmer-runtime-core 0.5.7", + "wasmer-runtime 0.6.0", + "wasmer-runtime-core 0.6.0", ] [[package]] name = "wasmer-runtime-core" -version = "0.5.7" +version = "0.6.0" dependencies = [ "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "blake2b_simd 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1588,13 +1588,13 @@ dependencies = [ "serde_bytes 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-singlepass-backend" -version = "0.5.7" +version = "0.6.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1605,24 +1605,24 @@ dependencies = [ "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", - "wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.6.0", + "wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-spectests" -version = "0.5.7" +version = "0.6.0" dependencies = [ "wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-llvm-backend 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-llvm-backend 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", ] [[package]] name = "wasmer-wasi" -version = "0.5.7" +version = "0.6.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "generational-arena 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1630,38 +1630,38 @@ dependencies = [ "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", + "wasmer-runtime-core 0.6.0", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-wasi-tests" -version = "0.5.7" +version = "0.6.0" dependencies = [ "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-clif-backend 0.5.7", - "wasmer-dev-utils 0.5.7", - "wasmer-llvm-backend 0.5.7", - "wasmer-runtime-core 0.5.7", - "wasmer-singlepass-backend 0.5.7", - "wasmer-wasi 0.5.7", + "wasmer-clif-backend 0.6.0", + "wasmer-dev-utils 0.6.0", + "wasmer-llvm-backend 0.6.0", + "wasmer-runtime-core 0.6.0", + "wasmer-singlepass-backend 0.6.0", + "wasmer-wasi 0.6.0", ] [[package]] name = "wasmer-win-exception-handler" -version = "0.5.7" +version = "0.6.0" dependencies = [ "bindgen 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.5.7", + "wasmer-runtime-core 0.6.0", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmparser" -version = "0.34.0" +version = "0.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1895,9 +1895,9 @@ dependencies = [ "checksum wabt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d07edd40d190ddcbd0113c2150ccb214f47a02ff36958630ba0e5b8138ece1c1" "checksum wabt-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b064c81821100adb4b71923cecfc67fef083db21c3bbd454b0162c7ffe63eeaa" "checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1" -"checksum wasmer-clif-fork-frontend 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be2e38b16377f93ac485b6045fdc135dd3f165d25d4992e7b67c5cbc3ca8c760" -"checksum wasmer-clif-fork-wasm 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88becfcf874d7587750e1a1c30c47a16ed220f28c433c4b81db4c4626455a6a1" -"checksum wasmparser 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8030ec5a7c242a91941947fdb752e9a7c0929aced954ea23c54dad1cd2611850" +"checksum wasmer-clif-fork-frontend 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd6bec1587a3b11222f4ff129fd119785713c41de413f54f99d3c03743812f4" +"checksum wasmer-clif-fork-wasm 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f323e612fe2549391255a09f89c927d7feb0ec4bf0c2cad9e3c089bdca42fc" +"checksum wasmparser 0.35.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29f51d6103c622680dc4e17fb8173371efda8e529d97a2ba10ddf847d07705f8" "checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" diff --git a/lib/clif-backend/Cargo.toml b/lib/clif-backend/Cargo.toml index 4d443e359..04cfa00d7 100644 --- a/lib/clif-backend/Cargo.toml +++ b/lib/clif-backend/Cargo.toml @@ -13,11 +13,11 @@ wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" } cranelift-native = { version = "0.31" } cranelift-codegen = { version = "0.31" } cranelift-entity = { version = "0.31" } -cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.32" } -cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.32" } +cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.33" } +cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.33" } hashbrown = "0.1" target-lexicon = "0.4.0" -wasmparser = "0.34.0" +wasmparser = "0.35.1" byteorder = "1" nix = "0.14.0" libc = "0.2.49" diff --git a/lib/llvm-backend/Cargo.toml b/lib/llvm-backend/Cargo.toml index de720e51e..7783e7e43 100644 --- a/lib/llvm-backend/Cargo.toml +++ b/lib/llvm-backend/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" [dependencies] wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" } -wasmparser = "0.34.0" +wasmparser = "0.35.1" hashbrown = "0.1.8" smallvec = "0.6.8" goblin = "0.0.20" diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index 642cdd271..13263b6b2 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [dependencies] nix = "0.14.0" page_size = "0.4.1" -wasmparser = "0.34.0" +wasmparser = "0.35.1" parking_lot = "0.7.1" lazy_static = "1.2.0" indexmap = "1.0.2" diff --git a/lib/singlepass-backend/Cargo.toml b/lib/singlepass-backend/Cargo.toml index ac100cafc..a6ab287f2 100644 --- a/lib/singlepass-backend/Cargo.toml +++ b/lib/singlepass-backend/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" [dependencies] wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" } -wasmparser = "0.34.0" +wasmparser = "0.35.1" dynasm = "0.3.2" dynasmrt = "0.3.1" lazy_static = "1.2.0" From 6b66c024f03dfcdd515b69894cbb169f9b583a03 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:18:37 -0700 Subject: [PATCH 11/16] Improved C/C++ icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b22c47af..1f02dd738 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ curl https://get.wasmer.io -sSfL | sh Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere ✨: * [**🦀 Rust**](https://github.com/wasmerio/wasmer-rust-example) -* [**𝐂 C/C++**](https://github.com/wasmerio/wasmer-c-api) +* [**🔗 C/C++**](https://github.com/wasmerio/wasmer-c-api) * [**#️⃣ C#**](https://github.com/wasmerio/wasmer-c-api) * [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm) * [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm) From 90d5dc6d620fe232c7b151893703c0d3a9feecde Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:19:42 -0700 Subject: [PATCH 12/16] Updated C# integration link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f02dd738..f98924cfa 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Wasmer runtime can also be embedded in different languages, so you can use WebAs * [**🦀 Rust**](https://github.com/wasmerio/wasmer-rust-example) * [**🔗 C/C++**](https://github.com/wasmerio/wasmer-c-api) -* [**#️⃣ C#**](https://github.com/wasmerio/wasmer-c-api) +* [**#️⃣ C#**](https://github.com/migueldeicaza/WasmerSharp) * [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm) * [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm) * [**💎 Ruby**](https://github.com/wasmerio/ruby-ext-wasm) From 0d428d6c99dfbc44ba2c6bfb5e952f4f2d296aa0 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 21:02:20 -0700 Subject: [PATCH 13/16] Moved fuzz dir back to root --- {lib/fuzz => fuzz}/.gitignore | 0 {lib/fuzz => fuzz}/Cargo.toml | 0 {lib/fuzz => fuzz}/README.md | 0 {lib/fuzz => fuzz}/fuzz_targets/simple_instantiate.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {lib/fuzz => fuzz}/.gitignore (100%) rename {lib/fuzz => fuzz}/Cargo.toml (100%) rename {lib/fuzz => fuzz}/README.md (100%) rename {lib/fuzz => fuzz}/fuzz_targets/simple_instantiate.rs (100%) diff --git a/lib/fuzz/.gitignore b/fuzz/.gitignore similarity index 100% rename from lib/fuzz/.gitignore rename to fuzz/.gitignore diff --git a/lib/fuzz/Cargo.toml b/fuzz/Cargo.toml similarity index 100% rename from lib/fuzz/Cargo.toml rename to fuzz/Cargo.toml diff --git a/lib/fuzz/README.md b/fuzz/README.md similarity index 100% rename from lib/fuzz/README.md rename to fuzz/README.md diff --git a/lib/fuzz/fuzz_targets/simple_instantiate.rs b/fuzz/fuzz_targets/simple_instantiate.rs similarity index 100% rename from lib/fuzz/fuzz_targets/simple_instantiate.rs rename to fuzz/fuzz_targets/simple_instantiate.rs From 6433a778a1c9bacfd13bb7c4f370c95d6c875a3f Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 21:11:29 -0700 Subject: [PATCH 14/16] Improved README. Simplified integration tests command --- .circleci/config.yml | 14 ++------------ Makefile | 4 ++-- README.md | 10 ++++++++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3098187ed..373704d20 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,9 +75,6 @@ jobs: make cranelift make llvm make test-rest - - run: - name: Release - command: make release-fast - run: name: Integration Tests command: make integration-tests @@ -116,10 +113,8 @@ jobs: command: | make check make compile-bench-singlepass - # TODO: add compile-bench-llvm and compile-bench-clif when they work - - run: - name: Release - command: make release-fast + make compile-bench-llvm + # TODO: add compile-bench-clif when they work - run: name: Integration Tests command: make integration-tests @@ -195,11 +190,6 @@ jobs: export PATH="$HOME/.cargo/bin:$PATH" export LLVM_SYS_80_PREFIX="`pwd`/clang+llvm-8.0.0-x86_64-apple-darwin/" make check - - run: - name: Release - command: | - export PATH="$HOME/.cargo/bin:$PATH" - make release-fast - run: name: Integration Tests command: | diff --git a/Makefile b/Makefile index 4bb5df974..b84515d7d 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ test: spectests emtests middleware wasitests circleci-clean test-rest # Integration tests -integration-tests: release-fast +integration-tests: release-clif echo "Running Integration Tests" ./integration_tests/lua/test.sh ./integration_tests/nginx/test.sh @@ -130,7 +130,7 @@ release: cargo build --release --features backend-singlepass,backend-llvm,loader-kernel # Only one backend (cranelift) -release-fast: +release-clif: # If you are in OS-X, you will need mingw-w64 for cross compiling to windows # brew install mingw-w64 cargo build --release diff --git a/README.md b/README.md index f98924cfa..5b7e038b2 100644 --- a/README.md +++ b/README.md @@ -184,8 +184,14 @@ git clone https://github.com/wasmerio/wasmer.git cd wasmer # install tools -# make sure that `python` is accessible. -make install +make release-clif # To build with cranelift (default) + +make release-llvm # To build with llvm support + +make release-singlepass # To build with singlepass support + +# or +make release # To build with singlepass, cranelift and llvm support ``` ## Testing From 5e7a20ef940bdedd7c91b0d5ae2f37e45fcac765 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 21:20:39 -0700 Subject: [PATCH 15/16] Improved metering codebase --- .circleci/config.yml | 2 +- lib/middleware-common/src/metering.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 373704d20..f76c635b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,7 +114,7 @@ jobs: make check make compile-bench-singlepass make compile-bench-llvm - # TODO: add compile-bench-clif when they work + # TODO: add compile-bench-clif when it works - run: name: Integration Tests command: make integration-tests diff --git a/lib/middleware-common/src/metering.rs b/lib/middleware-common/src/metering.rs index e0d392cb6..88eb69c06 100644 --- a/lib/middleware-common/src/metering.rs +++ b/lib/middleware-common/src/metering.rs @@ -138,9 +138,9 @@ mod tests { #[cfg(feature = "llvm")] fn get_compiler(limit: u64) -> impl Compiler { - use wasmer_llvm_backend::code::LLVMModuleCodeGenerator; use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; - let c: StreamingCompiler = + use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG; + let c: StreamingCompiler = StreamingCompiler::new(move || { let mut chain = MiddlewareChain::new(); chain.push(Metering::new(limit)); From a83b6eccfa4d9cf9bcdaa330c328c99d8c21396b Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 21:24:46 -0700 Subject: [PATCH 16/16] Fixed middleware linting --- lib/middleware-common/src/metering.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/middleware-common/src/metering.rs b/lib/middleware-common/src/metering.rs index 88eb69c06..75e2f6ef0 100644 --- a/lib/middleware-common/src/metering.rs +++ b/lib/middleware-common/src/metering.rs @@ -134,24 +134,22 @@ mod tests { use super::*; use wabt::wat2wasm; + use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func}; #[cfg(feature = "llvm")] fn get_compiler(limit: u64) -> impl Compiler { - use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG; - let c: StreamingCompiler = - StreamingCompiler::new(move || { - let mut chain = MiddlewareChain::new(); - chain.push(Metering::new(limit)); - chain - }); + let c: StreamingCompiler = StreamingCompiler::new(move || { + let mut chain = MiddlewareChain::new(); + chain.push(Metering::new(limit)); + chain + }); c } #[cfg(feature = "singlepass")] fn get_compiler(limit: u64) -> impl Compiler { - use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG; let c: StreamingCompiler = StreamingCompiler::new(move || { let mut chain = MiddlewareChain::new();