From db28c218e87b84594103c84377b198e497c369e0 Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Fri, 22 Sep 2023 06:34:29 -0500 Subject: [PATCH] [Refactor] Disable `Plugin::nn_preload` (#72) * refactor(rust-sys): disable `nn_preload` API Signed-off-by: Xin Liu * refactor(rust-sdk): disable `nn_preload` API Signed-off-by: Xin Liu * version(rust-sdk): bump to `0.12.2` Signed-off-by: Xin Liu * doc(rust-sys): update rustdoc and `README` Signed-off-by: Xin Liu * doc(rust-sdk): update rustdoc and `README` Signed-off-by: Xin Liu --------- Signed-off-by: Xin Liu --- Cargo.toml | 2 +- README.md | 3 ++- crates/wasmedge-sys/README.md | 2 +- crates/wasmedge-sys/src/lib.rs | 3 ++- crates/wasmedge-sys/src/plugin.rs | 22 +++++++++++----------- src/lib.rs | 3 ++- src/plugin.rs | 10 +++++----- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f729e8d32..35900cdd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.2-dev" +version = "0.12.2" [dependencies] anyhow = "1.0" diff --git a/README.md b/README.md index bd81d4941..e06749f53 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ 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.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 | | 0.11.2 | 0.13.3 | 0.16.2 | 0.4.3 | 0.6.1 | 0.1.0 | @@ -57,7 +58,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.69. +**Notice:** The minimum supported Rust version is 1.70. ## API Reference diff --git a/crates/wasmedge-sys/README.md b/crates/wasmedge-sys/README.md index 1ed1ca63f..f7a204180 100644 --- a/crates/wasmedge-sys/README.md +++ b/crates/wasmedge-sys/README.md @@ -4,7 +4,7 @@ The [wasmedge-sys](https://crates.io/crates/wasmedge-sys) crate defines a group For developers, it is recommended that the APIs in `wasmedge-sys` are used to construct high-level libraries, while `wasmedge-sdk` is for building up business applications. -* Notice that [wasmedge-sys](https://crates.io/crates/wasmedge-sys) requires **Rust v1.69 or above** in the **stable** channel. +* Notice that [wasmedge-sys](https://crates.io/crates/wasmedge-sys) requires **Rust v1.70 or above** in the **stable** channel. ## Build diff --git a/crates/wasmedge-sys/src/lib.rs b/crates/wasmedge-sys/src/lib.rs index 13a39a00a..b4b696a62 100644 --- a/crates/wasmedge-sys/src/lib.rs +++ b/crates/wasmedge-sys/src/lib.rs @@ -8,7 +8,7 @@ //! //! For developers, it is strongly recommended that the APIs in `wasmedge-sys` are used to construct high-level libraries, while `wasmedge-sdk` is for building up business applications. //! -//! * Notice that [wasmedge-sys](https://crates.io/crates/wasmedge-sys) requires **Rust v1.69 or above** in the **stable** channel. +//! * Notice that [wasmedge-sys](https://crates.io/crates/wasmedge-sys) requires **Rust v1.70 or above** in the **stable** channel. //! //! ## Build @@ -19,6 +19,7 @@ //! //! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi| //! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: | +//! | 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 | //! | 0.11.2 | 0.13.3 | 0.16.2 | 0.4.3 | 0.6.1 | 0.1.0 | diff --git a/crates/wasmedge-sys/src/plugin.rs b/crates/wasmedge-sys/src/plugin.rs index cf139842d..d162c5f2a 100644 --- a/crates/wasmedge-sys/src/plugin.rs +++ b/crates/wasmedge-sys/src/plugin.rs @@ -48,17 +48,17 @@ impl PluginManager { Ok(()) } - #[cfg(feature = "wasi_nn")] - #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))] - pub fn nn_preload(preloads: Vec<&str>) { - let c_args: Vec = preloads - .iter() - .map(|&x| std::ffi::CString::new(x).unwrap()) - .collect(); - let c_strs: Vec<*const i8> = c_args.iter().map(|x| x.as_ptr()).collect(); - let len = c_strs.len() as u32; - unsafe { ffi::WasmEdge_PluginInitWASINN(c_strs.as_ptr(), len) } - } + // #[cfg(feature = "wasi_nn")] + // #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))] + // pub fn nn_preload(preloads: Vec<&str>) { + // let c_args: Vec = preloads + // .iter() + // .map(|&x| std::ffi::CString::new(x).unwrap()) + // .collect(); + // let c_strs: Vec<*const i8> = c_args.iter().map(|x| x.as_ptr()).collect(); + // let len = c_strs.len() as u32; + // unsafe { ffi::WasmEdge_PluginInitWASINN(c_strs.as_ptr(), len) } + // } /// Returns the count of loaded plugins. pub fn count() -> u32 { diff --git a/src/lib.rs b/src/lib.rs index ee99f589d..8b19ac227 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ //! //! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi| //! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: | +//! | 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 | //! | 0.11.2 | 0.13.3 | 0.16.2 | 0.4.3 | 0.6.1 | 0.1.0 | @@ -66,7 +67,7 @@ //! //! 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.69. +//! **Notice:** The minimum supported Rust version is 1.70. //! //! ## API Reference //! diff --git a/src/plugin.rs b/src/plugin.rs index ee28b9d18..8bd5e0e32 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -46,11 +46,11 @@ impl PluginManager { } } - #[cfg(feature = "wasi_nn")] - #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))] - pub fn nn_preload(preloads: Vec<&str>) { - sys::plugin::PluginManager::nn_preload(preloads); - } + // #[cfg(feature = "wasi_nn")] + // #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))] + // pub fn nn_preload(preloads: Vec<&str>) { + // sys::plugin::PluginManager::nn_preload(preloads); + // } /// Returns the count of loaded plugins. pub fn count() -> u32 {