Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/sdk preview #83

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ecaa6cb
[Refactor] Add #[form] for subtypes of WasmEdgeError.
L-jasmine Sep 8, 2023
2116d0b
[Refactor] fix memory leak
L-jasmine Sep 24, 2023
949c987
[Fix] Avoid the CPU 100% by tokio-wasi.
L-jasmine Oct 9, 2023
0524f22
[Fix] Fix blocking during tokio-wasi TCP connect.
L-jasmine Oct 9, 2023
d7f841e
[Fix] async-wasi get envs & args
L-jasmine Oct 10, 2023
7408e62
[Perf] Optimize the wasi-ctx
L-jasmine Oct 19, 2023
882a3b2
[Chore] Temporarily disable the serialize feature.
L-jasmine Oct 20, 2023
47a3604
[feat] virtual file system
L-jasmine Oct 20, 2023
f71e855
[Refactor] update the argument type of `run_func_with_timeout` and `r…
L-jasmine Oct 2, 2023
317c7a9
[Refactor] delete useless code from validator
L-jasmine Oct 27, 2023
89ea9a2
[Refactor] To pass the clippy
L-jasmine Oct 27, 2023
7cfb547
Disable timeout in musl libc (#71)
jprendes Sep 22, 2023
bf772c0
Disable timeout in musl libc
L-jasmine Oct 27, 2023
2ffdbb0
[Doc] update doc
L-jasmine Oct 30, 2023
9c95c51
[Fix] fix ffi::WasmEdge_String to String
L-jasmine Oct 30, 2023
aa2639d
[Fix] Fix unit test
L-jasmine Oct 31, 2023
4cccc4a
[Fix] Modify the `WasiModule`.
L-jasmine Nov 2, 2023
c80ddb4
[refactor] Introduce `WasmEdge_FunctionInstanceGetData` to drop host …
apepkuss Nov 7, 2023
e475ea7
doc: update `CHANGELOG` (#85)
apepkuss Nov 8, 2023
a27724d
[Chore] Update build script (#86)
apepkuss Nov 8, 2023
d7c814c
Merge commit 'e5bcf0aa991b495ed6ef6b4431a8cd752a817bd5' into refactor…
L-jasmine Nov 14, 2023
0c3b743
Merge commit '373221d9a73cbc39aab64686b50626a99e9ace38' into refactor…
L-jasmine Nov 14, 2023
48273d3
Merge commit 'e657ea27db5c6c23af3710065bf44c4d346d2471' into refactor…
L-jasmine Nov 14, 2023
6cffdc2
Merge commit '07e84b70ba7e9011ae6774e2ce28c968e25c576a' into refactor…
L-jasmine Nov 14, 2023
03e1573
Merge commit '3146e89f6808fc44471daa009d7a8dfce04bd69d' into refactor…
L-jasmine Nov 14, 2023
18073d3
[Fix] Fix sys test
L-jasmine Nov 14, 2023
c99e30d
Relax the version of `wat` dep (#90)
apepkuss Nov 14, 2023
6132ffe
[CI] skip test_vmbuilder on fedora
L-jasmine Nov 14, 2023
b5daace
Fix static build to link agains zstd (#91)
jprendes Nov 15, 2023
06e7d2d
Update doc for releasing `v0.13.2` (#93)
apepkuss Nov 15, 2023
e914908
[Version] Bump `wasmedge-sys` to `v0.17.5` (#94)
apepkuss Nov 15, 2023
6d72f15
doc: update `CHANGELOG` (#95)
apepkuss Nov 15, 2023
6be2ef9
[CI] Update `rust-static-lib` workflow (#96)
apepkuss Nov 16, 2023
6175164
Merge commit '6be2ef9107e05ff46174f27bd50d56cbf208bb18' into refactor…
L-jasmine Nov 17, 2023
2d27eab
[Fix] Temporary FuncRef extraction implementation.
L-jasmine Nov 17, 2023
17221d0
[CI] fix test wat
L-jasmine Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ on:
paths-ignore:
- "**/*.md"
- ".github/workflows/standalone.yml"
- ".github/workflows/rust-static-lib.yml"
pull_request:
paths-ignore:
- "**/*.md"
- ".github/workflows/standalone.yml"
- ".github/workflows/rust-static-lib.yml"

jobs:
build_ubuntu:
Expand All @@ -21,7 +23,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]
container:
image: wasmedge/wasmedge:ubuntu-build-clang

Expand Down Expand Up @@ -90,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]
container:
image: fedora:latest

Expand Down Expand Up @@ -159,15 +161,15 @@ jobs:
export WASMEDGE_BUILD_DIR="$(pwd)/WasmEdge/build"
export WASMEDGE_PLUGIN_PATH="$(pwd)/WasmEdge/build/plugins/wasmedge_process"
export LD_LIBRARY_PATH="$(pwd)/WasmEdge/build/lib/api"
cargo test --workspace --locked --features aot,async,wasmedge_process,ffi -- --nocapture --test-threads=1
cargo test --workspace --locked --features aot,async,wasmedge_process,ffi -- --nocapture --test-threads=1 --skip test_vmbuilder
L-jasmine marked this conversation as resolved.
Show resolved Hide resolved

build_macos:
name: MacOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12]
rust: [1.72, 1.71, 1.70.0]
os: [macos-12, macos-13]
rust: [1.73, 1.72, 1.71]

steps:
- name: Checkout sources
Expand Down Expand Up @@ -222,7 +224,7 @@ jobs:
runs-on: windows-2022
strategy:
matrix:
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]
env:
WASMEDGE_DIR: ${{ github.workspace }}\WasmEdge
WASMEDGE_BUILD_DIR: ${{ github.workspace }}\WasmEdge\build
Expand Down
66 changes: 20 additions & 46 deletions .github/workflows/rust-static-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ concurrency:

on:
push:
branches:
- master
- "rust/*"
paths:
- ".github/workflows/rust-static-lib.yml"
- "bindings/rust/**"
- "include/api/wasmedge/**"
- "lib/api/**"
paths-ignore:
- "**/*.md"
- ".github/workflows/standalone.yml"
- ".github/workflows/ci-build.yml"
pull_request:
branches:
- master
paths:
- ".github/workflows/rust-static-lib.yml"
- "bindings/rust/**"
- "include/api/wasmedge/**"
- "lib/api/**"
paths-ignore:
- "**/*.md"
- ".github/workflows/standalone.yml"
- ".github/workflows/ci-build.yml"

jobs:
build_ubuntu:
Expand All @@ -30,49 +23,30 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
rust: [1.69, 1.68]
rust: [1.73, 1.72, 1.71]
container:
image: wasmedge/wasmedge:latest
image: wasmedge/wasmedge:ubuntu-build-clang

steps:
- uses: actions/checkout@v3
- name: Checkout WasmEdge Rust SDK
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build WasmEdge with Release mode
- name: Install dependencies
run: |
apt update
apt install -y software-properties-common libboost-all-dev llvm-15-dev liblld-15-dev ninja-build
cmake cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_LINK_LLVM_STATIC=ON -DWASMEDGE_BUILD_SHARED_LIB=OFF -DWASMEDGE_BUILD_STATIC_LIB=ON -DWASMEDGE_LINK_TOOLS_STATIC=ON -DWASMEDGE_BUILD_PLUGINS=OFF .
cmake --build build

- name: Install Rust-nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

- name: Rustfmt
working-directory: bindings/rust/
run: cargo +nightly fmt --all -- --check

- name: Clippy
working-directory: bindings/rust/
run: |
export WASMEDGE_DIR="$(pwd)/../../"
export WASMEDGE_BUILD_DIR="$(pwd)/../../build"
cargo +nightly clippy -V
cargo +nightly clippy --lib --examples --features static -- -D warnings
apt install -y software-properties-common llvm-15-dev liblld-15-dev ninja-build

- name: Install Rust-stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}

- name: Test Rust Bindings
working-directory: bindings/rust/
- name: Test Rust SDK
run: |
cargo test -p wasmedge-sdk --all --examples --features static,aot,wasmedge_process,ffi -- --nocapture --test-threads=1

- name: Test Rust SDK with async feature
run: |
export WASMEDGE_DIR="$(pwd)/../../"
export WASMEDGE_BUILD_DIR="$(pwd)/../../build"
cargo +nightly -Z sparse-registry update
cargo test --workspace --features static --locked -- --test-threads=1
cargo test --examples --features static --locked -- --test-threads=1
cargo test -p wasmedge-sdk --all --examples --features static,aot,async,wasmedge_process,ffi -- --nocapture --test-threads=1
12 changes: 7 additions & 5 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ on:
paths-ignore:
- "**/*.md"
- ".github/workflows/ci-build.yml"
- ".github/workflows/rust-static-lib.yml"

pull_request:
paths-ignore:
- "**/*.md"
- ".github/workflows/ci-build.yml"
- ".github/workflows/rust-static-lib.yml"

jobs:
build_ubuntu_2204:
name: Ubuntu
runs-on: ubuntu-22.04
strategy:
matrix:
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]

steps:
- name: Checkout WasmEdge Rust SDK
Expand Down Expand Up @@ -55,7 +57,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]

steps:
- name: Checkout WasmEdge Rust SDK
Expand Down Expand Up @@ -89,8 +91,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12]
rust: [1.72, 1.71, 1.70.0]
os: [macos-12, macos-13]
rust: [1.73, 1.72, 1.71]

steps:
- name: Checkout sources
Expand Down Expand Up @@ -119,7 +121,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.72, 1.71, 1.70.0]
rust: [1.73, 1.72, 1.71]
container:
image: fedora:latest

Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

All notable changes to this project will be documented in this file.

## [0.13.2] - 2023-11-15

### 🐛 Bug Fixes

- Fix the static build to link against `zstd` ([#91](https://github.com/orhun/git-cliff/issues/91))

## [0.13.1] - 2023-11-14

- Update the `wat` dep. This update is to fix [#88](https://github.com/WasmEdge/wasmedge-rust-sdk/issues/88).

## [0.13.0] - 2023-11-07

### ⛰️ Features

- New API `PluginManager::nn_preload`. This API is used to initialize the `wasi_nn` plug-in with given preloads ([#74](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/74))

- Implement `FromStr` trait for `NNPreload` struct ([#81](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/81))

### 🚜 Refactor

- [BREAKING] Update the argument types ([#82](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/82)):
- `VmBuilder::with_plugin`
- `VmBuilder::with_plugin_wasi_nn`
- `VmBuilder::with_plugin_wasi_crypto`
- `VmBuilder::with_plugin_wasmedge_process`

- [BREAKING] Update the argument types ([#76](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/76)):
- `Executor::run_func_with_timeout` and `Executor::run_func_async_with_timeout`
- `Vm::run_func_with_timeout` and `Vm::run_func_async_with_timeout`
- `Func::run_with_timeout` and `Func::run_async_with_timeout`

### 🐛 Bug Fixes

- Introduce new C-API `WasmEdge_FunctionInstanceGetData` to fix the memory leak issue caused by host data ([#84](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/84))

### Ci

- Support `macos-13` and remove `macos-11` from the `ci-build` and `standalone` workflows ([#84](https://github.com/WasmEdge/wasmedge-rust-sdk/pull/84))

## [0.12.2] - 2023-09-22

### 🚜 Refactor
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Apache-2.0"
name = "wasmedge-sdk"
readme = "README.md"
repository = "https://github.com/WasmEdge/wasmedge-rust-sdk"
version = "0.12.3-dev"
version = "0.13.2"

[dependencies]
anyhow = "1.0"
Expand All @@ -17,7 +17,7 @@ num-derive = "0.3"
num-traits = "0.2"
thiserror = "1.0.30"
wasmedge-macro.workspace = true
wasmedge-sys = { path = "crates/wasmedge-sys", version = "0.17", default-features = false }
wasmedge-sys = { path = "crates/wasmedge-sys", version = "0.17.5", default-features = false }
wasmedge-types.workspace = true

[workspace.dependencies]
Expand All @@ -26,15 +26,15 @@ cfg-if = "1.0.0"
parking_lot = "0.12.1"
wasmedge-macro = { path = "crates/wasmedge-macro", version = "0.6" }
wasmedge-types = { path = "crates/wasmedge-types", version = "0.4" }
wat = "=1.0.67"
wat = "1.0"

[target.'cfg(target_os = "linux")'.dependencies]
async-wasi = { workspace = true, optional = true }

[features]
aot = ["wasmedge-sys/aot"]
async = ["wasmedge-sys/async", "dep:async-wasi"]
default = []
default = ["async"]
ffi = ["wasmedge-sys/ffi"]
standalone = ["wasmedge-sys/standalone"]
static = ["wasmedge-sys/static"]
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ This crate depends on the WasmEdge C API. In linux/macOS the crate can download

| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
| 0.13.2 | 0.13.5 | 0.17.5 | 0.4.4 | 0.6.1 | 0.1.0 |
| 0.13.1 | 0.13.5 | 0.17.4 | 0.4.4 | 0.6.1 | 0.1.0 |
| 0.13.0 | 0.13.5 | 0.17.3 | 0.4.4 | 0.6.1 | 0.1.0 |
| 0.12.2 | 0.13.4 | 0.17.2 | 0.4.4 | 0.6.1 | 0.1.0 |
| 0.12.1 | 0.13.4 | 0.17.1 | 0.4.4 | 0.6.1 | 0.1.0 |
| 0.12.0 | 0.13.4 | 0.17.0 | 0.4.4 | 0.6.1 | 0.1.0 |
Expand Down Expand Up @@ -58,7 +61,7 @@ The following architectures are supported for automatic downloads:

This crate uses `rust-bindgen` during the build process. If you would like to use an external `rust-bindgen` you can set the `WASMEDGE_RUST_BINDGEN_PATH` environment variable to the `bindgen` executable path. This is particularly useful in systems like Alpine Linux (see [rust-lang/rust-bindgen#2360](https://github.com/rust-lang/rust-bindgen/issues/2360#issuecomment-1595869379), [rust-lang/rust-bindgen#2333](https://github.com/rust-lang/rust-bindgen/issues/2333)).

**Notice:** The minimum supported Rust version is 1.70.
**Notice:** The minimum supported Rust version is 1.71.

## API Reference

Expand Down
14 changes: 7 additions & 7 deletions crates/async-wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ version = "0.1.0"
[dependencies]
bitflags = "2.0.2"
cfg-if = "1.0.0"
futures = {version = "0.3"}
futures = { version = "0.3" }
getrandom = "0.2"
libc = "0.2"
path-absolutize = "3.0.13"
serde = {version = "1", features = ["derive"], optional = true}
socket2 = {version = "^0.4.9", features = ["all"]}
tokio = {version = "1", features = ["full"], optional = true}
serde = { version = "1", features = ["derive"] }
socket2 = { version = "^0.4.9", features = ["all"] }
tokio = { version = "1", features = ["full"], optional = true }
parking_lot.workspace = true

[dev-dependencies]
serde_json = {version = "1"}
serde_json = { version = "1" }

[features]
async_tokio = ["tokio"]
default = ["async_tokio", "serialize"]
serialize = ["serde"]
default = ["async_tokio"]
serialize = []
Loading
Loading