Skip to content

Commit

Permalink
Merge branch 'master' into fix-cyclic-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMcCaskey authored May 28, 2021
2 parents 729a1cb + 77ae2b3 commit 6c33341
Show file tree
Hide file tree
Showing 59 changed files with 527 additions and 498 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ wasmer-compiler-llvm = { version = "1.0.2", path = "lib/compiler-llvm", optional
wasmer-emscripten = { version = "1.0.2", path = "lib/emscripten", optional = true }
wasmer-engine = { version = "1.0.2", path = "lib/engine" }
wasmer-engine-universal = { version = "1.0.2", path = "lib/engine-universal", optional = true }
wasmer-engine-native = { version = "1.0.2", path = "lib/engine-native", optional = true }
wasmer-engine-dylib = { version = "1.0.2", path = "lib/engine-dylib", optional = true }
wasmer-engine-object-file = { version = "1.0.2", path = "lib/engine-object-file", optional = true }
wasmer-wasi = { version = "1.0.2", path = "lib/wasi", optional = true }
wasmer-wast = { version = "1.0.2", path = "tests/lib/wast", optional = true }
Expand All @@ -41,7 +41,7 @@ members = [
"lib/emscripten",
"lib/engine",
"lib/engine-universal",
"lib/engine-native",
"lib/engine-dylib",
"lib/engine-object-file",
"lib/object",
"lib/vm",
Expand Down Expand Up @@ -82,7 +82,7 @@ default = [
"wat",
"wast",
"universal",
"native",
"dylib",
"object-file",
"cache",
"wasi",
Expand All @@ -94,8 +94,8 @@ universal = [
"wasmer-engine-universal",
"engine",
]
native = [
"wasmer-engine-native",
dylib = [
"wasmer-engine-dylib",
"engine",
]
object-file = [
Expand All @@ -111,7 +111,7 @@ compiler = [
"wasmer/compiler",
"wasmer-compiler/translator",
"wasmer-engine-universal/compiler",
"wasmer-engine-native/compiler",
"wasmer-engine-dylib/compiler",
"wasmer-engine-object-file/compiler",
]
singlepass = [
Expand Down Expand Up @@ -139,9 +139,9 @@ test-llvm = [
"llvm",
]

test-native = [
"native",
"test-generator/test-native",
test-dylib = [
"dylib",
"test-generator/test-dylib",
]
test-universal = [
"universal",
Expand Down Expand Up @@ -170,8 +170,8 @@ path = "examples/engine_universal.rs"
required-features = ["cranelift"]

[[example]]
name = "engine-native"
path = "examples/engine_native.rs"
name = "engine-dylib"
path = "examples/engine_dylib.rs"
required-features = ["cranelift"]

[[example]]
Expand Down
70 changes: 35 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ SHELL=/bin/bash
# | Compiler ⨯ Engine ⨯ Platform ⨯ Architecture ⨯ libc |
# |------------|-----------|----------|--------------|-------|
# | Cranelift | Universal | Linux | amd64 | glibc |
# | LLVM | Native | Darwin | aarch64 | musl |
# | LLVM | Dylib | Darwin | aarch64 | musl |
# | Singlepass | | Windows | | |
# |------------|-----------|----------|--------------|-------|
#
# Here is what works and what doesn't:
#
# * Cranelift with the Universal engine works everywhere,
#
# * Cranelift with the Native engine works on Linux+Darwin/`amd64`,
# but it doesn't work on */`aarch64` or Windows/*.
# * Cranelift with the Dylib engine works on Linux+Darwin/`amd64`, but
# it doesn't work on */`aarch64` or Windows/*.
#
# * LLVM with the Universal engine works on Linux+Darwin/`amd64`,
# but it doesn't work on */`aarch64` or Windows/*.
#
# * LLVM with the Native engine works on
# * LLVM with the Dylib engine works on
# Linux+Darwin/`amd64`+`aarch64`, but it doesn't work on Windows/*.
#
# * Singlepass with the Universal engine works on Linux+Darwin/`amd64`, but
# it doesn't work on */`aarch64` or Windows/*.
#
# * Singlepass with the Native engine doesn't work because it doesn't
# * Singlepass with the Dylib engine doesn't work because it doesn't
# know how to output object files for the moment.
#
# * Windows isn't tested on `aarch64`, that's why we consider it's not
Expand Down Expand Up @@ -210,12 +210,12 @@ ifeq ($(ENABLE_CRANELIFT), 1)
ifneq (, $(filter 1, $(IS_DARWIN) $(IS_LINUX)))
ifeq ($(IS_AMD64), 1)
ifneq ($(LIBC), musl)
compilers_engines += cranelift-native
compilers_engines += cranelift-dylib
endif
else ifeq ($(IS_AARCH64), 1)
# The object crate doesn't support yet Darwin + Aarch64 relocations
ifneq ($(IS_DARWIN), 1)
compilers_engines += cranelift-native
compilers_engines += cranelift-dylib
endif
endif
endif
Expand All @@ -229,9 +229,9 @@ ifeq ($(ENABLE_LLVM), 1)
ifneq (, $(filter 1, $(IS_DARWIN) $(IS_LINUX)))
ifeq ($(IS_AMD64), 1)
compilers_engines += llvm-universal
compilers_engines += llvm-native
compilers_engines += llvm-dylib
else ifeq ($(IS_AARCH64), 1)
compilers_engines += llvm-native
compilers_engines += llvm-dylib
endif
endif
endif
Expand Down Expand Up @@ -297,10 +297,10 @@ compiler_features := --features $(subst $(space),$(comma),$(compilers))
capi_compilers_engines_exclude :=

# Define the compiler Cargo features for the C API. It always excludes
# LLVM for the moment because it causes the linker to fail since llvm is not statically linked.
# TODO: Reenable llvm in C-API
# LLVM for the moment because it causes the linker to fail since LLVM is not statically linked.
# TODO: Reenable LLVM in C-API
capi_compiler_features := --features $(subst $(space),$(comma),$(filter-out llvm, $(compilers)))
capi_compilers_engines_exclude += llvm-universal llvm-native
capi_compilers_engines_exclude += llvm-universal llvm-dylib

# We exclude singlepass-universal because it doesn't support multivalue (required in wasm-c-api tests)
capi_compilers_engines_exclude += singlepass-universal
Expand Down Expand Up @@ -423,59 +423,59 @@ endif

build-docs-capi: capi-setup
cd lib/c-api/doc/deprecated/ && doxygen doxyfile
RUSTFLAGS="${RUSTFLAGS}" cargo doc --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,universal,object-file,native,cranelift,wasi $(capi_default_features)
RUSTFLAGS="${RUSTFLAGS}" cargo doc --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,universal,object-file,dylib,cranelift,wasi $(capi_default_features)

build-capi: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features)
--no-default-features --features deprecated,wat,universal,dylib,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features)

build-capi-singlepass: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,singlepass,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,universal,dylib,object-file,singlepass,wasi,middlewares $(capi_default_features)

build-capi-singlepass-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,singlepass,wasi,middlewares $(capi_default_features)

build-capi-singlepass-native: capi-setup
build-capi-singlepass-dylib: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,native,singlepass,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,dylib,singlepass,wasi,middlewares $(capi_default_features)

build-capi-singlepass-object-file: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,object-file,singlepass,wasi,middlewares $(capi_default_features)

build-capi-cranelift: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,cranelift,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,universal,dylib,object-file,cranelift,wasi,middlewares $(capi_default_features)

build-capi-cranelift-system-libffi: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,cranelift,wasi,middlewares,system-libffi $(capi_default_features)
--no-default-features --features deprecated,wat,universal,dylib,object-file,cranelift,wasi,middlewares,system-libffi $(capi_default_features)

build-capi-cranelift-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,cranelift,wasi,middlewares $(capi_default_features)

build-capi-cranelift-native: capi-setup
build-capi-cranelift-dylib: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,native,cranelift,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,dylib,cranelift,wasi,middlewares $(capi_default_features)

build-capi-cranelift-object-file: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,native,object-file,cranelift,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,dylib,object-file,cranelift,wasi,middlewares $(capi_default_features)

build-capi-llvm: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,llvm,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,universal,dylib,object-file,llvm,wasi,middlewares $(capi_default_features)

build-capi-llvm-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,llvm,wasi,middlewares $(capi_default_features)

build-capi-llvm-native: capi-setup
build-capi-llvm-dylib: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,native,llvm,wasi,middlewares $(capi_default_features)
--no-default-features --features deprecated,wat,dylib,llvm,wasi,middlewares $(capi_default_features)

build-capi-llvm-object-file: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
Expand All @@ -487,17 +487,17 @@ build-capi-headless-universal: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features universal,wasi

build-capi-headless-native: capi-setup
build-capi-headless-dylib: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features native,wasi
--no-default-features --features dylib,wasi

build-capi-headless-object-file: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features object-file,wasi

build-capi-headless-all: capi-setup
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features universal,native,object-file,wasi
--no-default-features --features universal,dylib,object-file,wasi

###########
# Testing #
Expand All @@ -520,20 +520,20 @@ test-packages:

test-compilers-compat: $(foreach compiler,$(compilers),test-$(compiler))

test-singlepass-native:
cargo test --release --tests $(compiler_features) -- singlepass::native
test-singlepass-dylib:
cargo test --release --tests $(compiler_features) -- singlepass::dylib

test-singlepass-universal:
cargo test --release --tests $(compiler_features) -- singlepass::universal

test-cranelift-native:
cargo test --release --tests $(compiler_features) -- cranelift::native
test-cranelift-dylib:
cargo test --release --tests $(compiler_features) -- cranelift::dylib

test-cranelift-universal:
cargo test --release --tests $(compiler_features) -- cranelift::universal

test-llvm-native:
cargo test --release --tests $(compiler_features) -- llvm::native
test-llvm-dylib:
cargo test --release --tests $(compiler_features) -- llvm::dylib

test-llvm-universal:
cargo test --release --tests $(compiler_features) -- llvm::universal
Expand All @@ -550,7 +550,7 @@ test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_en

test-capi-crate-%:
WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) cargo test --manifest-path lib/c-api/Cargo.toml --release \
--no-default-features --features deprecated,wat,universal,native,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features) -- --nocapture
--no-default-features --features deprecated,wat,universal,dylib,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features) -- --nocapture

test-capi-integration-%:
# Test the Wasmer C API tests for C
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ qjs >
[swift integration]: https://github.com/AlwaysRightInstitute/SwiftyWasmer

[zig logo]: https://raw.githubusercontent.com/ziglang/logo/master/zig-favicon.png
[zig integration]: https://github.com/kubkon/wasmer-zig
[zig integration]: https://github.com/zigwasm/wasmer-zig

## Contribute

Expand Down
6 changes: 5 additions & 1 deletion docs/cn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ qjs >
| ![R logo] | [**R**][R integration] | *没有已发布的软件包* | [文档][r docs] |
| ![Postgres logo] | [**Postgres**][Postgres integration] | *没有已发布的软件包* | [文档][postgres docs] |
| | [**Swift**][Swift integration] | *没有已发布的软件包* | |
| ![Zig logo] | [**Zig**][Zig integration] | *no published package* | |

[👋 缺少语言?](https://github.com/wasmerio/wasmer/issues/new?assignees=&labels=%F0%9F%8E%89+enhancement&template=---feature-request.md&title=)

Expand Down Expand Up @@ -169,6 +170,9 @@ qjs >

[swift integration]: https://github.com/AlwaysRightInstitute/SwiftyWasmer

[zig logo]: https://raw.githubusercontent.com/ziglang/logo/master/zig-favicon.png
[zig integration]: https://github.com/zigwasm/wasmer-zig

## 贡献

**我们欢迎任何形式的贡献,尤其是来自社区新成员的贡献** 💜
Expand All @@ -188,4 +192,4 @@ Wasmer 拥有一个由出色的开发人员和贡献者组成的社区。 欢迎
- [Slack](https://slack.wasmer.io/)
- [Twitter](https://twitter.com/wasmerio)
- [Facebook](https://www.facebook.com/wasmerio)
- [Email](mailto:[email protected])
- [Email](mailto:[email protected])
4 changes: 2 additions & 2 deletions docs/deps_dedup.dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ digraph dependencies {
n1 [label="wasmer-compiler", color=orange];
n5 [label="wasmer-engine", color=orange];
n6 [label="wasmer-engine-universal", color=orange];
n7 [label="wasmer-engine-native", color=orange];
n7 [label="wasmer-engine-dylib", color=orange];
n8 [label="wasmer-types", color=orange];
n9 [label="wasmer-vm", color=orange];
n10 [label="wasmer-c-api", color=orange];
Expand All @@ -29,7 +29,7 @@ digraph dependencies {
color=brown;

n6 [label="wasmer-engine-universal", color=orange];
n7 [label="wasmer-engine-native", color=orange];
n7 [label="wasmer-engine-dylib", color=orange];
}

{
Expand Down
Loading

0 comments on commit 6c33341

Please sign in to comment.