Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-table-example
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMcCaskey authored Oct 27, 2020
2 parents d6af684 + a8b9350 commit adc40ae
Show file tree
Hide file tree
Showing 122 changed files with 3,706 additions and 1,743 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "::set-env name=CARGO_HOME::$(pwd)/.cargo_home"
run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
- name: Cache
uses: actions/cache@master
with:
Expand All @@ -56,8 +56,8 @@ jobs:
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz
mkdir -p /opt/llvm-10
tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10
echo ::add-path::/opt/llvm-10/bin
echo ::set-env name=LLVM_SYS_100_PREFIX::/opt/llvm-10
echo '/opt/llvm-10/bin' >> $GITHUB_PATH
echo 'name=LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV
- name: Install Python
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz
mkdir -p /opt/llvm-10
tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10
echo ::add-path::/opt/llvm-10/bin
echo ::set-env name=LLVM_SYS_100_PREFIX::/opt/llvm-10
echo '/opt/llvm-10/bin' >> $GITHUB_PATH
echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV
- name: Generate Coverage Report
run: |
cargo install cargo-tarpaulin
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
build: [linux, macos, windows, linux-aarch64]
include:
- build: linux
os: ubuntu-latest
os: ubuntu-18.04
rust: 1.46.0
llvm_url: 'https://github.com/wasmerio/llvm-build/releases/download/10.x/Ubuntu1910_Release.tar.xz'
llvm_url: 'https://github.com/wasmerio/llvm-build/releases/download/10.x/Ubuntu1604_Release.tar.xz'
# llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
artifact_name: 'wasmer-linux-amd64'
run_integration_tests: true
Expand All @@ -70,6 +70,12 @@ jobs:
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }}
steps:
- uses: actions/checkout@v2
- name: Set up libstdc++ on Linux
run: |
sudo apt-get update -y
sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04
sudo apt-get install --reinstall g++-8
if: matrix.os == 'ubuntu-18.04'
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
Expand All @@ -81,7 +87,7 @@ jobs:
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "::set-env name=CARGO_HOME::$(pwd)/.cargo_home"
run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
- name: Cache
uses: actions/cache@master
with:
Expand All @@ -103,13 +109,13 @@ jobs:
# key: cargo-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}
# - name: Install sccache
# run: |
# echo "::add-path::${{ runner.tool_cache }}/cargo-sccache/bin"
# echo "${{ runner.tool_cache }}/cargo-sccache/bin" >> $GITHUB_PATH
# cargo install sccache --version ${{ env.CARGO_SCCACHE_VERSION }} --root ${{ runner.tool_cache }}/cargo-sccache
# - name: Start sccache
# run: |
# ${{ runner.tool_cache }}/cargo-sccache/bin/sccache --start-server
# ${{ runner.tool_cache }}/cargo-sccache/bin/sscache -s
# echo "::set-env name=RUSTC_WRAPPER::${{ runner.tool_cache }}/cargo-sccache/bin/sccache"
# echo "RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache" >> $GITHUB_ENV
- name: Install LLVM (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
Expand All @@ -118,17 +124,17 @@ jobs:
# run: |
# curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe -L -o llvm-installer.exe
# 7z x llvm-installer.exe -oC:/llvm-10
# echo ::add-path::C:/llvm-10/bin
# echo ::set-env name=LLVM_SYS_100_PREFIX::C:/llvm-10
# echo ::set-env name=LIBCLANG_PATH::C:/llvm-10/bin/libclang.dll
# echo C:/llvm-10/bin >> $GITHUB_PATH
# echo "LLVM_SYS_100_PREFIX=C:/llvm-10" >> $GITHUB_ENV
# echo "LIBCLANG_PATH=C:/llvm-10/bin/libclang.dll" >> $GITHUB_ENV
- name: Install LLVM (Unix)
if: matrix.os != 'windows-latest'
run: |
curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz
mkdir -p ${{ env.LLVM_DIR }}
tar xf llvm.tar.xz --strip-components=1 -C ${{ env.LLVM_DIR }}
echo "::add-path::${{ env.LLVM_DIR }}/bin"
echo "::set-env name=LLVM_SYS_100_PREFIX::${{ env.LLVM_DIR }}"
echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_100_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV
env:
LLVM_DIR: ${{ github.workspace }}/llvm-10
- name: Set up dependencies for Mac OS
Expand All @@ -138,7 +144,7 @@ jobs:
- name: Build and Test C API
run: |
make build-capi
make test-capi-cranelift
make test-capi
if: matrix.os != 'windows-latest'
- name: Build C API on Windows
run: make build-capi
Expand Down Expand Up @@ -248,7 +254,7 @@ jobs:
path: ${{ runner.tool_cache }}/cargo-audit
key: cargo-audit-bin-${{ env.CARGO_AUDIT_VERSION }}
- run: |
echo "::add-path::${{ runner.tool_cache }}/cargo-audit/bin"
echo "${{ runner.tool_cache }}/cargo-audit/bin" >> $GITHUB_PATH
- run: |
cargo install cargo-audit --version ${{ env.CARGO_AUDIT_VERSION }} --root ${{ runner.tool_cache }}/cargo-audit
cargo audit
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,28 @@

## **[Unreleased]**

- [#1710](https://github.com/wasmerio/wasmer/pull/1710) Memory for function call trampolines is now owned by the Artifact.
### Added


- [#1687](https://github.com/wasmerio/wasmer/pull/1687) Add basic usage examples; fix ownership of local memory and local table metadata in the VM.
- [#1687](https://github.com/wasmerio/wasmer/pull/1687) Add basic table example; fix ownership of local memory and local table metadata in the VM.
- [#1751](https://github.com/wasmerio/wasmer/pull/1751) Implement `wasm_trap_t` inside a function declared with `wasm_func_new_with_env` in the Wasm C API.
- [#1741](https://github.com/wasmerio/wasmer/pull/1741) Implement `wasm_memory_type` in the Wasm C API.
- [#1736](https://github.com/wasmerio/wasmer/pull/1736) Implement `wasm_global_type` in the Wasm C API.
- [#1699](https://github.com/wasmerio/wasmer/pull/1699) Update `wasm.h` to its latest version.
- [#1685](https://github.com/wasmerio/wasmer/pull/1685) Implement `wasm_exporttype_delete` in the Wasm C API.
- [#1725](https://github.com/wasmerio/wasmer/pull/1725) Implement `wasm_func_type` in the Wasm C API.
- [#1715](https://github.com/wasmerio/wasmer/pull/1715) Register errors from `wasm_module_serialize` in the Wasm C API.
- [#1709](https://github.com/wasmerio/wasmer/pull/1709) Implement `wasm_module_name` and `wasm_module_set_name` in the Wasm(er) C API.
- [#1700](https://github.com/wasmerio/wasmer/pull/1700) Implement `wasm_externtype_copy` in the Wasm C API.

### Changed

- [#1762](https://github.com/wasmerio/wasmer/pull/1762) Allow the `=` sign in a WASI environment variable value.

### Fixed

- [#1718](https://github.com/wasmerio/wasmer/pull/1718) Fix panic in the API in some situations when the memory's min bound was greater than the memory's max bound.

## 1.0.0-alpha4 - 2020-10-08

### Added
Expand Down
22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ test-llvm = [

test-native = [
"native",
"test-generator/test-native",
]
test-jit = [
"jit",
"test-generator/test-jit",
]

# Specifies that we're running in coverage testing mode. This disables tests
Expand Down Expand Up @@ -189,6 +191,26 @@ name = "exported-function"
path = "examples/exports_function.rs"
required-features = ["cranelift"]

[[example]]
name = "exported-global"
path = "examples/exports_global.rs"
required-features = ["cranelift"]

[[example]]
name = "exported-memory"
path = "examples/exports_memory.rs"
required-features = ["cranelift"]

[[example]]
name = "imported-function"
path = "examples/imports_function.rs"
required-features = ["cranelift"]

[[example]]
name = "imported-global"
path = "examples/imports_global.rs"
required-features = ["cranelift"]

[[example]]
name = "wasi"
path = "examples/wasi.rs"
Expand Down
101 changes: 73 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,51 @@ else
UNAME_S :=
endif

compilers :=
# Which compilers we build. These have dependencies that may not be on the system.
compilers := cranelift

# In the form "$(compiler)-$(engine)" which compiler+engine combinations to test
# in `make test`.
test_compilers_engines :=

# Autodetect LLVM from llvm-config
ifneq (, $(shell which llvm-config))
LLVM_VERSION := $(shell llvm-config --version)
# If findstring is not empty, then it have found the value
ifneq (, $(findstring 10,$(LLVM_VERSION)))
compilers += llvm
endif
else
ifneq (, $(shell which llvm-config-10))
compilers += llvm
endif
endif

ifeq ($(ARCH), x86_64)
# In X64, Cranelift is enabled
compilers += cranelift
test_compilers_engines += cranelift-jit
# LLVM could be enabled if not in Windows
ifneq ($(OS), Windows_NT)
# Singlepass doesn't work yet on Windows
# Native engine doesn't work on Windows yet.
test_compilers_engines += cranelift-native
# Singlepass doesn't work yet on Windows.
compilers += singlepass
# Autodetect LLVM from llvm-config
ifneq (, $(shell which llvm-config))
LLVM_VERSION := $(shell llvm-config --version)
# If findstring is not empty, then it have found the value
ifneq (, $(findstring 10,$(LLVM_VERSION)))
compilers += llvm
endif
else
ifneq (, $(shell which llvm-config-10))
compilers += llvm
endif
# Singlepass doesn't work with the native engine.
test_compilers_engines += singlepass-jit
ifneq (, $(findstring llvm,$(compilers)))
test_compilers_engines += llvm-jit llvm-native
endif
endif
endif

ifeq ($(ARCH), aarch64)
test_compilers_engines += cranelift-jit
ifneq (, $(findstring llvm,$(compilers)))
test_compilers_engines += llvm-native
endif
endif

compilers := $(filter-out ,$(compilers))
test_compilers_engines := $(filter-out ,$(test_compilers_engines))

ifneq ($(OS), Windows_NT)
bold := $(shell tput bold)
Expand Down Expand Up @@ -72,33 +92,40 @@ build-docs-capi:
cd lib/c-api/ && doxygen doxyfile

# We use cranelift as the default backend for the capi for now
build-capi: build-capi-cranelift
build-capi: build-capi-cranelift-jit

build-capi-singlepass:
build-capi-singlepass-jit:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,object-file,singlepass,wasi

build-capi-cranelift:
build-capi-cranelift-jit:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,object-file,cranelift,wasi

build-capi-cranelift-native:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,native,object-file,cranelift,wasi

build-capi-cranelift-system-libffi:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,object-file,cranelift,wasi,system-libffi
--no-default-features --features wat,jit,native,object-file,cranelift,wasi,system-libffi

build-capi-llvm:
build-capi-llvm-jit:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,object-file,llvm,wasi

build-capi-llvm-native:
cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,native,object-file,llvm,wasi

###########
# Testing #
###########

test: $(foreach compiler,$(compilers),test-$(compiler)-jit) test-packages test-examples test-deprecated
test: $(foreach compiler,$(compilers),test-$(compiler)) test-packages test-examples test-deprecated

# Singlepass and native engine don't work together, this rule does nothing.
test-singlepass-native:
@:
cargo test --release $(compiler_features) --features "test-singlepass test-native"

test-singlepass-jit:
cargo test --release $(compiler_features) --features "test-singlepass test-jit"
Expand All @@ -115,6 +142,12 @@ test-llvm-native:
test-llvm-jit:
cargo test --release $(compiler_features) --features "test-llvm test-jit"

test-singlepass: $(foreach singlepass_engine,$(filter singlepass-%,$(test_compilers_engines)),test-$(singlepass_engine))

test-cranelift: $(foreach cranelift_engine,$(filter cranelift-%,$(test_compilers_engines)),test-$(cranelift_engine))

test-llvm: $(foreach llvm_engine,$(filter llvm-%,$(test_compilers_engines)),test-$(llvm_engine))

test-packages:
cargo test -p wasmer --release
cargo test -p wasmer-vm --release
Expand All @@ -124,23 +157,35 @@ test-packages:
cargo test -p wasmer-engine-native --release --no-default-features
cargo test -p wasmer-cli --release

test-capi-singlepass: build-capi-singlepass
# The test-capi rules depend on the build-capi rules to build the .a files to
# link the tests against. cargo test doesn't know that the tests will be running
# cmake + make to build programs whose dependencies cargo isn't aware of.

test-capi-singlepass-jit: build-capi-singlepass-jit
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,singlepass,wasi -- --nocapture

test-capi-cranelift: build-capi-cranelift
test-capi-cranelift-jit: build-capi-cranelift-jit
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,cranelift,wasi -- --nocapture

test-capi-cranelift-system-libffi: build-capi-cranelift-system-libffi
test-capi-cranelift-native: build-capi-cranelift-native
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,native,cranelift,wasi -- --nocapture

test-capi-cranelift-jit-system-libffi:
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,cranelift,wasi,system-libffi -- --nocapture

test-capi-llvm: build-capi-llvm
test-capi-llvm-jit:
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,jit,llvm,wasi -- --nocapture

test-capi: test-capi-singlepass test-capi-cranelift test-capi-llvm
test-capi-llvm-native:
cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features wat,native,llvm,wasi -- --nocapture

test-capi: $(foreach compiler_engine,$(test_compilers_engines),test-capi-$(compiler_engine)) $(if $(findstring cranelift-jit,$(test_compilers_engines)),test-capi-cranelift-jit-system-libffi)

test-wasi-unit:
cargo test --manifest-path lib/wasi/Cargo.toml --release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

* **Pluggable**. Wasmer supports different compilation frameworks to best suit your needs (LLVM, Cranelift...).

* **Universal**. You can run Wasmer in almost any *platform* (macOS, Linux and Windows) and *chipset*.
* **Universal**. You can run Wasmer in any *platform* (macOS, Linux and Windows) and *chipset*.

* **Standards compliant**. The runtime passes [official WebAssembly test
suite](https://github.com/WebAssembly/testsuite) supporting [WASI](https://github.com/WebAssembly/WASI) and [Emscripten](https://emscripten.org/).
Expand Down
Loading

0 comments on commit adc40ae

Please sign in to comment.