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

release preparation #15

Merged
merged 20 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
export CXX=clang++
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib
cargo test -p wasmedge-sdk --all --examples --features standalone
wasmedge --version

build_ubuntu_2004:
name: Ubuntu
Expand Down Expand Up @@ -74,10 +75,11 @@ jobs:
export CXX=clang++
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib
cargo test -p wasmedge-sdk --all --examples --features standalone
wasmedge --version

build_fedora:
name: Fedora latest
runs-on: Fedora-latest
name: Fedora
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.70.0, 1.69, 1.68]
Expand Down Expand Up @@ -109,6 +111,7 @@ jobs:
export CXX=clang++
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib
cargo test -p wasmedge-sdk --all --examples --features standalone
wasmedge --version

build_macos:
name: MacOS
Expand Down Expand Up @@ -139,3 +142,4 @@ jobs:
export CXX=clang++
export DYLD_LIBRARY_PATH=$HOME/.wasmedge/lib
cargo test -p wasmedge-sdk --all --examples --features standalone
wasmedge --version
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
name: binding-rust
name: Continuous integration

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
- "feat/*"
- "refactor/*"
- "test/*"
- "fix/*"
- "doc/*"
- "ci/*"
- "release/*"
paths:
- ".github/workflows/bindings-rust.yml"
- "src/**"
Expand Down
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,37 @@ WasmEdge Rust SDK provides idiomatic [Rust](https://www.rust-lang.org/) language

**Notice:** This project is still under active development and not guaranteed to have a stable API.

- [Documentation]()
- [Documentation](https://wasmedge.org/docs/)
- [WasmEdge website](https://wasmedge.org/)
- [WasmEdge GitHub page](https://github.com/WasmEdge/WasmEdge)
- [WasmEdge GitHub Page](https://github.com/WasmEdge/WasmEdge)
- [WasmEdge Rust SDK GitHub Page](https://github.com/WasmEdge/wasmedge-rust-sdk)
- [WasmEdge Rust SDK Examples](https://github.com/second-state/wasmedge-rustsdk-examples)

## Get Started

Since this crate depends on the WasmEdge C API, it needs to be installed in your system first. Please refer to [WasmEdge Installation and Uninstallation](https://wasmedge.org/book/en/quick_start/install.html) to install the WasmEdge library. The versioning table below shows the version of the WasmEdge library required by each version of the `wasmedge-sdk` crate.

| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 |
| 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 |
| 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 |
| 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 |
| 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 |
| 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - |
| 0.3.0 | 0.10.1 | 0.8 | 0.2 | - |
| 0.1.0 | 0.10.0 | 0.7 | 0.1 | - |
| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
| 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
| 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 | - |
| 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 | - |
| 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 | - |
| 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 | - |
| 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - | - |
| 0.3.0 | 0.10.1 | 0.8 | 0.2 | - | - |
| 0.1.0 | 0.10.0 | 0.7 | 0.1 | - | - |

WasmEdge Rust SDK can automatically search the following paths for the WasmEdge library:

- `/usr/local` (Linux/macOS)
- `$HOME/.wasmedge` (Linux/macOS)
- `/usr/local` (Linux/macOS)

If you have installed the WasmEdge library in a different path, you can set the `WASMEDGE_INCLUDE_DIR` and `WASMEDGE_LIB_DIR` environment variables to the path of the WasmEdge library.

**Notice:** The minimum supported Rust version is 1.67.
**Notice:** The minimum supported Rust version is 1.68.

## Examples

Expand All @@ -43,4 +46,4 @@ Please read the [contribution guidelines](https://github.com/WasmEdge/wasmedge-r

## License

This project is licensed under the terms of the [Apache 2.0 license](https://github.com/tensorflow/rust/blob/HEAD/LICENSE).
This project is licensed under the terms of the [Apache 2.0 license](https://github.com/tensorflow/rust/blob/HEAD/LICENSE).
2 changes: 1 addition & 1 deletion crates/wasmedge-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.43"
quote = "1"
syn = {version = "2.0.18", features = ["full", "extra-traits"]}
syn = {version = "2", features = ["full", "extra-traits"]}
2 changes: 2 additions & 0 deletions crates/wasmedge-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ fn expand_async_host_func_with_three_args(item_fn: &syn::ItemFn) -> proc_macro2:

// ================== macros for wasmedge-sys ==================

#[doc(hidden)]
#[proc_macro_attribute]
pub fn sys_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
let body_ast = parse_macro_input!(item as Item);
Expand Down Expand Up @@ -228,6 +229,7 @@ fn sys_expand_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::Token
Ok(ret)
}

#[doc(hidden)]
#[proc_macro_attribute]
pub fn sys_async_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
let body_ast = parse_macro_input!(item as Item);
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmedge-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ wasmedge-types = {path = "../wasmedge-types", version = "0.4"}
wat = "1.0"

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

[build-dependencies]
bindgen = {version = "0.65", default-features = false, features = ["runtime"]}
Expand Down
23 changes: 12 additions & 11 deletions crates/wasmedge-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ To use or build the `wasmedge-sys` crate, the `WasmEdge` library is required. Pl

* The following table provides the versioning information about each crate of WasmEdge Rust bindings.

| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 |
| 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 |
| 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 |
| 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 |
| 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 |
| 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - |
| 0.3.0 | 0.10.1 | 0.8 | 0.2 | - |
| 0.1.0 | 0.10.0 | 0.7 | 0.1 | - |
| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
| 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
| 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 | - |
| 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 | - |
| 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 | - |
| 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 | - |
| 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - | - |
| 0.3.0 | 0.10.1 | 0.8 | 0.2 | - | - |
| 0.1.0 | 0.10.0 | 0.7 | 0.1 | - | - |

## See also

Expand Down
2 changes: 1 addition & 1 deletion crates/wasmedge-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const WASMEDGE_H: &str = "wasmedge.h";
target_family = "unix",
not(feature = "static")
))]
const WASMEDGE_RELEASE_VERSION: &str = "0.12.1";
const WASMEDGE_RELEASE_VERSION: &str = "0.13.0";

macro_rules! env_path {
($env_var:literal) => {
Expand Down
2 changes: 2 additions & 0 deletions crates/wasmedge-sys/src/instance/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::pin::Pin;
use std::{convert::TryInto, sync::Arc};
use wasmedge_types::{NeverType, ValType};

/// Defines the signature of an asynchronous host function.
#[cfg(all(feature = "async", target_os = "linux"))]
pub type AsyncHostFn<T> =
fn(
Expand All @@ -20,6 +21,7 @@ pub type AsyncHostFn<T> =
Option<&'static mut T>,
) -> Box<dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send>;

/// Defines the signature of a host function.
pub type HostFn<T> = fn(
CallingFrame,
Vec<WasmValue>,
Expand Down
1 change: 1 addition & 0 deletions crates/wasmedge-sys/src/instance/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ impl AsImport for WasiModule {
}
}

/// A [AsyncWasiModule] is a module instance for the WASI specification and used in the `async` scenario.
#[cfg(all(feature = "async", target_os = "linux"))]
#[derive(Debug, Clone)]
pub struct AsyncWasiModule {
Expand Down
24 changes: 13 additions & 11 deletions crates/wasmedge-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
//!
//! * The following table provides the versioning information about each crate of WasmEdge Rust bindings.
//!
//! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro|
//! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: |
//! | 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 |
//! | 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 |
//! | 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 |
//! | 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 |
//! | 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 |
//! | 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 |
//! | 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - |
//! | 0.3.0 | 0.10.1 | 0.8 | 0.2 | - |
//! | 0.1.0 | 0.10.0 | 0.7 | 0.1 | - |
//! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
//! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
//! | 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
//! | 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
//! | 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
//! | 0.7.1 | 0.11.2 | 0.12.2 | 0.3.1 | 0.3.0 | - |
//! | 0.7.0 | 0.11.2 | 0.12 | 0.3.1 | 0.3.0 | - |
//! | 0.6.0 | 0.11.2 | 0.11 | 0.3.0 | 0.2.0 | - |
//! | 0.5.0 | 0.11.1 | 0.10 | 0.3.0 | 0.1.0 | - |
//! | 0.4.0 | 0.11.0 | 0.9 | 0.2.1 | - | - |
//! | 0.3.0 | 0.10.1 | 0.8 | 0.2 | - | - |
//! | 0.1.0 | 0.10.0 | 0.7 | 0.1 | - | - |
//!
//!
//!
Expand Down Expand Up @@ -114,6 +115,7 @@ pub use types::WasmValue;
pub use validator::Validator;
use wasmedge_types::{error, WasmEdgeResult};

/// Type of wasi context that is used to configure the wasi environment.
#[cfg(all(feature = "async", target_os = "linux"))]
pub type WasiCtx = ::async_wasi::snapshots::WasiCtx;

Expand Down
Loading