Skip to content

Commit

Permalink
Merge pull request #4050 from wasmerio/asynchronous-io-with-fs-fixes
Browse files Browse the repository at this point in the history
`epoll` with fs fixes
  • Loading branch information
john-sharratt authored Jul 21, 2023
2 parents 4380bb3 + 09ee543 commit 6ccf29d
Show file tree
Hide file tree
Showing 119 changed files with 5,275 additions and 13,382 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,24 +541,28 @@ jobs:
build: linux-x64,
os: ubuntu-22.04,
target: x86_64-unknown-linux-gnu,
exe: '',
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz'
},
{
build: macos-x64,
os: macos-11,
target: x86_64-apple-darwin,
exe: '',
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz'
},
{
build: windows-x64,
os: windows-2019,
target: x86_64-pc-windows-msvc,
exe: '.exe',
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz'
},
{
build: linux-musl,
target: x86_64-unknown-linux-musl,
os: ubuntu-22.04,
exe: '',
container: 'alpine:latest'
}
]
Expand Down Expand Up @@ -789,7 +793,9 @@ jobs:
- name: Test integration CLI
if: matrix.build != 'macos-arm'
shell: bash
run: export WASMER_DIR=`pwd`/package && make test-integration-cli-ci
run: |
export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }}
export WASMER_DIR=`pwd`/package && make test-integration-cli-ci
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/${{ matrix.target }}/release
Expand Down
24 changes: 23 additions & 1 deletion Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ wasmer-cache = { version = "=4.0.0", path = "lib/cache", optional = true }
wasmer-types = { version = "=4.0.0", path = "lib/types" }
wasmer-middlewares = { version = "=4.0.0", path = "lib/middlewares", optional = true }
cfg-if = "1.0"
tokio = { version = "1", features = [ "rt", "rt-multi-thread", "macros" ], optional = true }

[workspace]
members = [
Expand All @@ -49,6 +50,7 @@ members = [
"lib/registry",
"lib/sys-utils",
"lib/types",
"lib/virtual-io",
"lib/virtual-fs",
"lib/virtual-net",
"lib/vm",
Expand Down Expand Up @@ -234,12 +236,12 @@ required-features = ["backend", "wasi"]
[[example]]
name = "wasi-manual-setup"
path = "examples/wasi_manual_setup.rs"
required-features = ["backend", "wasi"]
required-features = ["tokio", "backend", "wasi"]

[[example]]
name = "wasi-pipes"
path = "examples/wasi_pipes.rs"
required-features = ["backend", "wasi"]
required-features = ["tokio", "backend", "wasi"]

[[example]]
name = "table"
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ endif
# If findstring is not empty, then it have found the value

exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli
# Is failing to compile in Linux for some reason
exclude_tests += --exclude wasmer-wasi-experimental-io-devices
# We run integration tests separately (it requires building the c-api)
exclude_tests += --exclude wasmer-integration-tests-cli
exclude_tests += --exclude wasmer-integration-tests-ios
Expand Down Expand Up @@ -626,7 +624,7 @@ test-integration-cli: build-wasmer build-capi package-capi-headless package dist
# Before running this in the CI, we need to set up link.tar.gz and /cache/wasmer-[target].tar.gz
test-integration-cli-ci:
rustup target add wasm32-wasi
$(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-cli -- --test-threads=1
$(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-cli -- --test-threads=1 --nocapture

test-integration-ios:
$(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-ios
Expand Down
7 changes: 7 additions & 0 deletions examples/wasi_manual_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Let's compile the Wasm module.
let module = Module::new(&store, wasm_bytes)?;

println!("Starting `tokio` runtime...");
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
let _guard = runtime.enter();

println!("Creating `WasiEnv`...");
// First, we create the `WasiEnv`
let mut wasi_env = WasiEnv::builder("hello")
Expand Down
3 changes: 2 additions & 1 deletion lib/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ libc = { version = "^0.2", default-features = false }
thiserror = "1"
typetag = { version = "0.1", optional = true }
paste = "1.0"
tokio = { version = "1", features = [ "rt", "rt-multi-thread", "io-util", "sync", "macros"], default_features = false }

[dev-dependencies]
field-offset = "0.3.3"
Expand Down Expand Up @@ -97,7 +98,7 @@ wasmer-artifact-load = ["wasmer-compiler/wasmer-artifact-load"]
wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"]
static-artifact-load = ["wasmer-compiler/static-artifact-load"]
static-artifact-create = ["wasmer-compiler/static-artifact-create"]
webc_runner = ["wasmer-wasix/webc_runner", "virtual-fs", "webc"]
webc_runner = ["virtual-fs", "webc"]
# Deprecated features.
jit = ["compiler"]

Expand Down
Loading

0 comments on commit 6ccf29d

Please sign in to comment.