Skip to content

Commit

Permalink
Merge #606
Browse files Browse the repository at this point in the history
606: Cleanup Wasmer r=syrusakbary a=syrusakbary

This PR moves a few things around trying to make Wasmer more compelling to use:
* Two less directories on the root (`fuzz` is moved to the `lib/` folder, `media` is moved to `src/installer` folder)
* Improved README
* Moved `ARCHITECTURE.md` into the `docs` folder.

Co-authored-by: Syrus <[email protected]>
  • Loading branch information
bors[bot] and syrusakbary committed Aug 1, 2019
2 parents 33166ea + a83b6ec commit 2b6e589
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 34 deletions.
14 changes: 2 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 it works
- run:
name: Integration Tests
command: make integration-tests
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -181,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
Expand Down Expand Up @@ -240,7 +249,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

Expand Down
File renamed without changes.
16 changes: 7 additions & 9 deletions lib/middleware-common/src/metering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_llvm_backend::code::LLVMModuleCodeGenerator;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
let c: StreamingCompiler<LLVMModuleCodeGenerator, _, _, _, _> =
StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new();
chain.push(Metering::new(limit));
chain
});
use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG;
let c: StreamingCompiler<LLVMMCG, _, _, _, _> = 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<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/installer/wasmer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2b6e589

Please sign in to comment.