Skip to content

Commit

Permalink
feat: bump up rust 1.77.1, wasmtime 19.0.0, arrow 51.0.0, time 0.3.34…
Browse files Browse the repository at this point in the history
…, anyhow 1.0.81
  • Loading branch information
jornfranke committed Mar 29, 2024
1 parent a821331 commit e39f0ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
11 changes: 6 additions & 5 deletions wasm-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
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"}
11 changes: 6 additions & 5 deletions wasm-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -101,7 +102,7 @@ fn init_wasm_module_2(engine: &Engine) -> anyhow::Result<Module> {
fn wrapper_answer(engine: &Engine, module: &Module) -> anyhow::Result<i32> {
// 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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -228,7 +229,7 @@ fn wrapper_wasm_rust_format_hello_world(
) -> anyhow::Result<String> {
// 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()
Expand Down Expand Up @@ -329,7 +330,7 @@ fn wrapper_wasm_rust_format_hello_world(
fn wrapper_wasm_process_data_arrow(engine: &Engine, module: &Module) -> anyhow::Result<String> {
// 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()
Expand Down
4 changes: 2 additions & 2 deletions wasm-module2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
arrow = { version = "51.0.0", default-features = false, features = ["ipc"] }
time = {version = "0.3.34", features = ["macros"]}

0 comments on commit e39f0ae

Please sign in to comment.