From 89523e0186c62e29660cf437ca71effc77d5a894 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 14:48:48 -0700 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 6b66c024f03dfcdd515b69894cbb169f9b583a03 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 31 Jul 2019 18:18:37 -0700 Subject: [PATCH 05/10] 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 06/10] 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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();