From e39f0ae00eef0c3e143df291f8c64eec9af38982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Franke?= Date: Fri, 29 Mar 2024 15:00:48 +0100 Subject: [PATCH] feat: bump up rust 1.77.1, wasmtime 19.0.0, arrow 51.0.0, time 0.3.34, anyhow 1.0.81 --- .github/workflows/build.yml | 2 +- wasm-app/Cargo.toml | 11 ++++++----- wasm-app/src/main.rs | 11 ++++++----- wasm-module2/Cargo.toml | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd4ae71..ab88efa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: rust-wasm-study on: [push] env: - RUSTUP_TOOLCHAIN: "1.75.0" + RUSTUP_TOOLCHAIN: "1.77.1" RUSTUP_HOME: "./rust/rustup" CARGO_HOME: "./rust/cargo" diff --git a/wasm-app/Cargo.toml b/wasm-app/Cargo.toml index 066104c..e1cc0c3 100644 --- a/wasm-app/Cargo.toml +++ b/wasm-app/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = {version = "1.0.76"} -arrow = { version = "50.0.0", default-features = false, features = ["ipc","prettyprint"] } -time = {version = "0.3.31", features = ["macros"]} -wasmtime = { version = "17.0.0"} -wasmtime-wasi = { version = "17.0.0"} \ No newline at end of file +anyhow = {version = "1.0.81"} +arrow = { version = "51.0.0", default-features = false, features = ["ipc","prettyprint"] } +time = {version = "0.3.34", features = ["macros"]} +wasmtime = { version = "19.0.0"} +wasmtime-wasi = { version = "19.0.0"} +wasi-common = { version = "19.0.0"} \ No newline at end of file diff --git a/wasm-app/src/main.rs b/wasm-app/src/main.rs index 4db0465..1938967 100644 --- a/wasm-app/src/main.rs +++ b/wasm-app/src/main.rs @@ -6,7 +6,8 @@ use wasmtime::Instance; use wasmtime::Linker; use wasmtime::Module; use wasmtime::Store; -use wasmtime_wasi::{sync::WasiCtxBuilder, WasiCtx}; +use wasi_common::sync::WasiCtxBuilder; +use wasi_common::WasiCtx; use std::ffi::CStr; use std::ffi::CString; @@ -101,7 +102,7 @@ fn init_wasm_module_2(engine: &Engine) -> anyhow::Result { fn wrapper_answer(engine: &Engine, module: &Module) -> anyhow::Result { // Load function an instantiate it let mut linker = Linker::new(&engine); - wasmtime_wasi::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; + wasi_common::sync::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; // store to exchange data with the WASM module let wasi = WasiCtxBuilder::new() .inherit_stdio() @@ -140,7 +141,7 @@ fn wrapper_wasm_c_format_hello_world( let param_name_cstring_as_bytes: &[u8] = param_name_cstring.to_bytes_with_nul(); // Load function an instantiate it let mut linker = Linker::new(&engine); - wasmtime_wasi::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; + wasi_common::sync::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; // store to exchange data with the WASM module let wasi = WasiCtxBuilder::new() .inherit_stdio() @@ -228,7 +229,7 @@ fn wrapper_wasm_rust_format_hello_world( ) -> anyhow::Result { // Load function an instantiate it let mut linker = Linker::new(&engine); - wasmtime_wasi::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; + wasi_common::sync::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; // store to exchange data with the WASM module let wasi = WasiCtxBuilder::new() .inherit_stdio() @@ -329,7 +330,7 @@ fn wrapper_wasm_rust_format_hello_world( fn wrapper_wasm_process_data_arrow(engine: &Engine, module: &Module) -> anyhow::Result { // Load function an instantiate it let mut linker = Linker::new(&engine); - wasmtime_wasi::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; + wasi_common::sync::add_to_linker(&mut linker, |state: &mut MyState| &mut state.wasi)?; // store to exchange data with the WASM module let wasi = WasiCtxBuilder::new() .inherit_stdio() diff --git a/wasm-module2/Cargo.toml b/wasm-module2/Cargo.toml index 17c4f44..ded73cb 100644 --- a/wasm-module2/Cargo.toml +++ b/wasm-module2/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ['cdylib'] [dependencies] -arrow = { version = "50.0.0", default-features = false, features = ["ipc"] } -time = {version = "0.3.31", features = ["macros"]} \ No newline at end of file +arrow = { version = "51.0.0", default-features = false, features = ["ipc"] } +time = {version = "0.3.34", features = ["macros"]} \ No newline at end of file