From ec3a9286b8156e50d66a4fc3adbd41c6fd90f679 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 31 Aug 2023 17:47:19 +0400 Subject: [PATCH 01/24] bump version --- crates/common/Cargo.toml | 2 +- crates/guest/Cargo.toml | 4 ++-- crates/host/Cargo.toml | 4 ++-- test/Cargo.toml | 2 +- test/common/Cargo.toml | 2 +- test/test_wasm/Cargo.toml | 2 +- test/wasm_empty/Cargo.toml | 2 +- test/wasm_io/Cargo.toml | 2 +- test/wasm_memory/Cargo.toml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 0605756d..fdf5df0f 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -2,7 +2,7 @@ name = "holochain_wasmer_common" description = "commons for both host and guest" license = "Apache-2.0" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/crates/guest/Cargo.toml b/crates/guest/Cargo.toml index 61a17dce..4998a852 100644 --- a/crates/guest/Cargo.toml +++ b/crates/guest/Cargo.toml @@ -2,7 +2,7 @@ name = "holochain_wasmer_guest" description = "wasm guest code" license = "Apache-2.0" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" @@ -15,7 +15,7 @@ path = "src/guest.rs" [dependencies] holochain_serialized_bytes = { version = "=0.0.53", features = [] } -holochain_wasmer_common = { version = "=0.0.84", path = "../common" } +holochain_wasmer_common = { version = "=0.0.85", path = "../common" } serde = "1" tracing = "0.1" parking_lot = "0.12" diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index 7298ee7c..bcccef0f 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -2,13 +2,13 @@ name = "holochain_wasmer_host" description = "wasm host code" license = "Apache-2.0" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" [dependencies] wasmer = "=2.3.0" -holochain_wasmer_common = { version = "=0.0.84", path = "../common" } +holochain_wasmer_common = { version = "=0.0.85", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" tracing = "0.1" diff --git a/test/Cargo.toml b/test/Cargo.toml index c64571ff..4300ea40 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/common/Cargo.toml b/test/common/Cargo.toml index 149b6b1b..57a09bb5 100644 --- a/test/common/Cargo.toml +++ b/test/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_common" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/test_wasm/Cargo.toml b/test/test_wasm/Cargo.toml index 5a4cadb9..9dc2e6e8 100644 --- a/test/test_wasm/Cargo.toml +++ b/test/test_wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/wasm_empty/Cargo.toml b/test/wasm_empty/Cargo.toml index 7117aede..144a2f2f 100644 --- a/test/wasm_empty/Cargo.toml +++ b/test/wasm_empty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm_empty" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/wasm_io/Cargo.toml b/test/wasm_io/Cargo.toml index 85ec6f1e..f32cea54 100644 --- a/test/wasm_io/Cargo.toml +++ b/test/wasm_io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm_io" -version = "0.0.84" +version = "0.0.85" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/wasm_memory/Cargo.toml b/test/wasm_memory/Cargo.toml index a58e5b2e..bd4d1c1e 100644 --- a/test/wasm_memory/Cargo.toml +++ b/test/wasm_memory/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm_memory" -version = "2.0.0" +version = "0.0.84" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" From f66d1c4f58f9f0817f070d06673ed075d0127dad Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 20 Sep 2023 14:33:33 +0400 Subject: [PATCH 02/24] wasmer 3 --- crates/common/Cargo.toml | 3 +-- crates/host/Cargo.toml | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index fdf5df0f..37f7e6f4 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -18,5 +18,4 @@ default = [] error_as_host = [] [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -wasmer = "=2.3.0" -wasmer-engine = "=2.3.0" \ No newline at end of file +wasmer = "=3.0.0" diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index bcccef0f..518493f6 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -7,7 +7,7 @@ authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" [dependencies] -wasmer = "=2.3.0" +wasmer = "=3.0.0" holochain_wasmer_common = { version = "=0.0.85", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" @@ -25,5 +25,4 @@ path = "src/host.rs" [features] default = ["error_as_host"] debug_memory = [] -error_as_host = ["holochain_wasmer_common/error_as_host"] -dylib = ["wasmer/dylib"] +error_as_host = ["holochain_wasmer_common/error_as_host"] \ No newline at end of file From fe9b897488d1b8f5f4ecd9099f6ef0e6c8cb9b76 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 20 Sep 2023 14:34:47 +0400 Subject: [PATCH 03/24] clippy --- crates/common/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 9b349e2d..e24e1d6d 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -86,9 +86,9 @@ pub fn split_u64(u: u64) -> Result<(u32, u32), WasmError> { /// Performs the inverse of `merge_usize`. pub fn split_usize(u: DoubleUSize) -> Result<(usize, usize), WasmError> { #[cfg(target_pointer_width = "64")] - return split_u128(u as u128).map(|(a, b)| (a as usize, b as usize)); + return split_u128(u).map(|(a, b)| (a as usize, b as usize)); #[cfg(target_pointer_width = "32")] - return split_u64(u as u64).map(|(a, b)| (a as usize, b as usize)); + return split_u64(u).map(|(a, b)| (a as usize, b as usize)); } #[cfg(test)] From 08f6311b94853f3879ffd49984a0aa763961c803 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 20 Sep 2023 20:06:04 +0400 Subject: [PATCH 04/24] wip on wasmer 3 --- crates/host/Cargo.toml | 1 + crates/host/src/env.rs | 190 +++++++++---------- crates/host/src/guest.rs | 90 +++++---- crates/host/src/module.rs | 11 +- crates/host/src/prelude.rs | 4 +- test/Cargo.lock | 353 +++++++++++++++++++++++++++++----- test/wasm_empty/Cargo.lock | 379 +++++++++---------------------------- 7 files changed, 549 insertions(+), 479 deletions(-) diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index 518493f6..4902a3c5 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -16,6 +16,7 @@ parking_lot = "0.12" once_cell = "1" rand = "0.8" bimap = "0.6" +bytes = "1" [lib] name = "holochain_wasmer_host" diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index 6a76131a..e18d8f29 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -1,99 +1,99 @@ -use std::num::TryFromIntError; +// use std::num::TryFromIntError; -use crate::guest::read_bytes; -use crate::prelude::*; -use wasmer::Function; -use wasmer::LazyInit; -use wasmer::Memory; -use wasmer::WasmerEnv; +// use crate::guest::read_bytes; +// use crate::prelude::*; +// use wasmer::Function; +// use wasmer::LazyInit; +// use wasmer::Memory; +// use wasmer::WasmerEnv; -#[derive(Clone, Default, WasmerEnv)] -pub struct Env { - #[wasmer(export)] - memory: LazyInit, - #[wasmer(export(name = "__hc__allocate_1"))] - allocate: LazyInit, - #[wasmer(export(name = "__hc__deallocate_1"))] - deallocate: LazyInit, -} +// #[derive(Clone, Default, WasmerEnv)] +// pub struct Env { +// #[wasmer(export)] +// memory: LazyInit, +// #[wasmer(export(name = "__hc__allocate_1"))] +// allocate: LazyInit, +// #[wasmer(export(name = "__hc__deallocate_1"))] +// deallocate: LazyInit, +// } -impl Env { - /// Given some input I that can be serialized, request an allocation from the - /// guest and copy the serialized bytes to the allocated pointer. The guest - /// MUST subsequently take ownership of these bytes or it will leak memory. - pub fn move_data_to_guest(&self, input: I) -> Result - where - I: serde::Serialize + std::fmt::Debug, - { - let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; - let guest_ptr: GuestPtr = match self - .allocate_ref() - .ok_or(wasm_error!(WasmErrorInner::Memory))? - .call(&[Value::I32( - data.len() - .try_into() - .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, - )]) - .map_err(|e| wasm_error!(e.to_string()))? - .get(0) - { - Some(Value::I32(guest_ptr)) => (*guest_ptr) - .try_into() - .map_err(|e: TryFromIntError| wasm_error!(e))?, - _ => return Err(wasm_error!(WasmErrorInner::PointerMap).into()), - }; - let len: Len = match data.len().try_into() { - Ok(len) => len, - Err(e) => return Err(wasm_error!(e).into()), - }; - crate::guest::write_bytes( - self.memory_ref() - .ok_or(wasm_error!(WasmErrorInner::Memory))?, - guest_ptr, - &data, - )?; - Ok(merge_u32(guest_ptr, len)?) - } +// impl Env { +// /// Given some input I that can be serialized, request an allocation from the +// /// guest and copy the serialized bytes to the allocated pointer. The guest +// /// MUST subsequently take ownership of these bytes or it will leak memory. +// pub fn move_data_to_guest(&self, input: I) -> Result +// where +// I: serde::Serialize + std::fmt::Debug, +// { +// let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; +// let guest_ptr: GuestPtr = match self +// .allocate_ref() +// .ok_or(wasm_error!(WasmErrorInner::Memory))? +// .call(&[Value::I32( +// data.len() +// .try_into() +// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, +// )]) +// .map_err(|e| wasm_error!(e.to_string()))? +// .get(0) +// { +// Some(Value::I32(guest_ptr)) => (*guest_ptr) +// .try_into() +// .map_err(|e: TryFromIntError| wasm_error!(e))?, +// _ => return Err(wasm_error!(WasmErrorInner::PointerMap).into()), +// }; +// let len: Len = match data.len().try_into() { +// Ok(len) => len, +// Err(e) => return Err(wasm_error!(e).into()), +// }; +// crate::guest::write_bytes( +// self.memory_ref() +// .ok_or(wasm_error!(WasmErrorInner::Memory))?, +// guest_ptr, +// &data, +// )?; +// Ok(merge_u32(guest_ptr, len)?) +// } - /// Given a pointer and length for a region of memory in the guest, copy the - /// bytes to the host and attempt to deserialize type `O` from the data. The - /// guest will be asked to deallocate the copied bytes whether or not the - /// deserialization is successful. - pub fn consume_bytes_from_guest( - &self, - guest_ptr: GuestPtr, - len: Len, - ) -> Result - where - O: serde::de::DeserializeOwned + std::fmt::Debug, - { - let bytes = read_bytes( - self.memory_ref() - .ok_or(wasm_error!(WasmErrorInner::Memory))?, - guest_ptr, - len, - ) - .map_err(|_| wasm_error!(WasmErrorInner::Memory))?; - self.deallocate_ref() - .ok_or(wasm_error!(WasmErrorInner::Memory))? - .call(&[ - Value::I32( - guest_ptr - .try_into() - .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, - ), - Value::I32( - len.try_into() - .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, - ), - ]) - .map_err(|e| wasm_error!(e.to_string()))?; - match holochain_serialized_bytes::decode(&bytes) { - Ok(v) => Ok(v), - Err(e) => { - tracing::error!(input_type = std::any::type_name::(), bytes = ?bytes, "{}", e); - Err(wasm_error!(e).into()) - } - } - } -} +// /// Given a pointer and length for a region of memory in the guest, copy the +// /// bytes to the host and attempt to deserialize type `O` from the data. The +// /// guest will be asked to deallocate the copied bytes whether or not the +// /// deserialization is successful. +// pub fn consume_bytes_from_guest( +// &self, +// guest_ptr: GuestPtr, +// len: Len, +// ) -> Result +// where +// O: serde::de::DeserializeOwned + std::fmt::Debug, +// { +// let bytes = read_bytes( +// self.memory_ref() +// .ok_or(wasm_error!(WasmErrorInner::Memory))?, +// guest_ptr, +// len, +// ) +// .map_err(|_| wasm_error!(WasmErrorInner::Memory))?; +// self.deallocate_ref() +// .ok_or(wasm_error!(WasmErrorInner::Memory))? +// .call(&[ +// Value::I32( +// guest_ptr +// .try_into() +// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, +// ), +// Value::I32( +// len.try_into() +// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, +// ), +// ]) +// .map_err(|e| wasm_error!(e.to_string()))?; +// match holochain_serialized_bytes::decode(&bytes) { +// Ok(v) => Ok(v), +// Err(e) => { +// tracing::error!(input_type = std::any::type_name::(), bytes = ?bytes, "{}", e); +// Err(wasm_error!(e).into()) +// } +// } +// } +// } diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index f14753a9..1f07c9e2 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -1,8 +1,8 @@ use crate::prelude::*; use core::num::TryFromIntError; use holochain_serialized_bytes::prelude::*; -use parking_lot::Mutex; -use std::sync::Arc; +// use parking_lot::Mutex; +// use std::sync::Arc; use wasmer::Instance; use wasmer::Memory; use wasmer::Value; @@ -51,6 +51,7 @@ use wasmer::Value; /// /// @see read_bytes() pub fn write_bytes( + store: &impl AsStoreMut, memory: &Memory, guest_ptr: GuestPtr, slice: &[u8], @@ -62,15 +63,17 @@ pub fn write_bytes( #[cfg(feature = "debug_memory")] tracing::debug!("writing bytes from host to guest at: {} {}", guest_ptr, len); - let ptr: WasmPtr = WasmPtr::new(guest_ptr); - // Write the length prefix immediately before the slice at the guest pointer position. - for (byte, cell) in slice.iter().zip( - ptr.deref(memory, 0, len) - .ok_or(wasm_error!(WasmErrorInner::Memory))? - .iter(), - ) { - cell.set(*byte) - } + WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.write_slice(slice)?; + + // let ptr: WasmPtr = WasmPtr::new(guest_ptr); + // // Write the length prefix immediately before the slice at the guest pointer position. + // for (byte, cell) in slice.iter().zip( + // ptr.deref(memory, 0, len) + // .ok_or(wasm_error!(WasmErrorInner::Memory))? + // .iter(), + // ) { + // cell.set(*byte) + // } Ok(()) } @@ -94,25 +97,20 @@ pub fn write_bytes( /// /// A better approach is to use an immutable deref from a `WasmPtr`, which checks against memory /// bounds for the guest, and map over the whole thing to a `Vec`. -pub fn read_bytes( - memory: &Memory, - guest_ptr: GuestPtr, - len: Len, -) -> Result, wasmer::RuntimeError> { - #[cfg(feature = "debug_memory")] - tracing::debug!("reading bytes from guest to host at: {} {}", guest_ptr, len); +// pub fn read_bytes( +// memory: &Memory, +// guest_ptr: GuestPtr, +// len: Len, +// ) -> Result, wasmer::RuntimeError> { +// #[cfg(feature = "debug_memory")] +// tracing::debug!("reading bytes from guest to host at: {} {}", guest_ptr, len); - let ptr: WasmPtr = WasmPtr::new(guest_ptr); - Ok(ptr - .deref(memory, 0, len) - .ok_or(wasm_error!(WasmErrorInner::Memory))? - .iter() - .map(|cell| cell.get()) - .collect::>()) -} +// WasmSlice::new(guest_ptr, len)?.read_to_vec() +// } /// Deserialize any DeserializeOwned type out of the guest from a guest pointer. pub fn from_guest_ptr( + store: &impl AsStoreMut, memory: &Memory, guest_ptr: GuestPtr, len: Len, @@ -120,7 +118,8 @@ pub fn from_guest_ptr( where O: serde::de::DeserializeOwned + std::fmt::Debug, { - let bytes = read_bytes(memory, guest_ptr, len)?; + // let bytes = read_bytes(memory, guest_ptr, len)?; + let bytes = WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.read_to_vec()?; match holochain_serialized_bytes::decode(&bytes) { Ok(v) => Ok(v), Err(e) => { @@ -134,7 +133,9 @@ where /// result is either a vector of bytes from the guest found at the location of the returned guest /// allocation pointer or a `RuntimeError` built from a `WasmError`. pub fn call( - instance: Arc>, + store: &mut impl AsStoreMut, + // instance: Arc>, + instance: Instance, f: &str, input: I, ) -> Result @@ -142,7 +143,7 @@ where I: serde::Serialize + std::fmt::Debug, O: serde::de::DeserializeOwned + std::fmt::Debug, { - let instance = instance.lock(); + // let instance = instance.lock(); // The guest will use the same crate for decoding if it uses the wasm common crate. let payload: Vec = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; @@ -157,7 +158,7 @@ where .exports .get_function("__hc__allocate_1") .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? - .call(&[guest_input_length_value.clone()]) + .call(store, &[guest_input_length_value.clone()]) .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? .get(0) { @@ -179,6 +180,7 @@ where // Write the input payload into the guest at the offset specified by the allocation. write_bytes( + store, instance .exports .get_memory("memory") @@ -193,7 +195,7 @@ where .exports .get_function(f) .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? - .call(&[guest_input_ptr_value, guest_input_length_value]) + .call(store, &[guest_input_ptr_value, guest_input_length_value]) { Ok(v) => match v.get(0) { Some(Value::I64(i)) => { @@ -230,6 +232,7 @@ where // The host MUST discard any wasm instance that errors at this point to avoid memory leaks. // The WasmError in the result type here is for deserializing out of the guest. let return_value: Result = from_guest_ptr( + store, instance .exports .get_memory("memory") @@ -243,17 +246,20 @@ where .exports .get_function("__hc__deallocate_1") .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? - .call(&[ - Value::I32( - guest_return_ptr - .try_into() - .map_err(|e: TryFromIntError| wasm_error!(e))?, - ), - Value::I32( - len.try_into() - .map_err(|e: TryFromIntError| wasm_error!(e))?, - ), - ]) + .call( + store, + &[ + Value::I32( + guest_return_ptr + .try_into() + .map_err(|e: TryFromIntError| wasm_error!(e))?, + ), + Value::I32( + len.try_into() + .map_err(|e: TryFromIntError| wasm_error!(e))?, + ), + ], + ) .map_err(|e| wasm_error!(WasmErrorInner::CallError(format!("{:?}", e))))?; return_value.map_err(|e| e.into()) diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index 7f5d07fc..6de10c76 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -9,7 +9,8 @@ use std::collections::BTreeMap; use std::sync::Arc; use wasmer::Module; use wasmer::Store; -use wasmer::Universal; +// use wasmer::Universal; +use bytes::Bytes; /// We expect cache keys to be produced via hashing so 32 bytes is enough for all /// purposes. @@ -18,7 +19,7 @@ pub type CacheKey = [u8; 32]; /// keys and the bits used to evict things from the cache. pub type PlruKeyMap = BiMap; /// Modules serialize to a vec of bytes as per wasmer. -pub type SerializedModule = Vec; +pub type SerializedModule = Bytes; /// Higher level trait over the plru cache to make it a bit easier to interact /// with consistently. Default implementations for key functions are provided. @@ -154,7 +155,7 @@ impl SerializedModuleCache { key: CacheKey, wasm: &[u8], ) -> Result { - let store = Store::new(&Universal::new((self.cranelift)()).engine()); + let store = Store::new((self.cranelift)()); let module = Module::from_binary(&store, wasm) .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; let serialized_module = module @@ -169,8 +170,8 @@ impl SerializedModuleCache { pub fn get(&mut self, key: CacheKey, wasm: &[u8]) -> Result { match self.cache.get(&key) { Some(serialized_module) => { - let store = Store::new(&Universal::new((self.cranelift)()).engine()); - let module = unsafe { Module::deserialize(&store, serialized_module) } + let store = Store::new((self.cranelift)()); + let module = unsafe { Module::deserialize(&store, (**serialized_module).clone()) } .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; self.touch(&key); Ok(module) diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index ff7d89ea..fba72d4b 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,9 +1,9 @@ -pub use crate::env::Env; +// pub use crate::env::Env; pub use crate::guest; pub use crate::module::MODULE_CACHE; pub use holochain_serialized_bytes::prelude::*; pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; pub use parking_lot::Mutex; -pub use wasmer::WasmerEnv; +// pub use wasmer::WasmerEnv; pub use wasmer::*; diff --git a/test/Cargo.lock b/test/Cargo.lock index ca8e04e4..31b81000 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -144,6 +144,12 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + [[package]] name = "camino" version = "1.1.2" @@ -233,7 +239,16 @@ version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" dependencies = [ - "cranelift-entity", + "cranelift-entity 0.82.3", +] + +[[package]] +name = "cranelift-bforest" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "529ffacce2249ac60edba2941672dfedf3d96558b415d0d8083cd007456e0f55" +dependencies = [ + "cranelift-entity 0.86.1", ] [[package]] @@ -242,10 +257,10 @@ version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", + "cranelift-bforest 0.82.3", + "cranelift-codegen-meta 0.82.3", + "cranelift-codegen-shared 0.82.3", + "cranelift-entity 0.82.3", "gimli 0.26.2", "log", "regalloc", @@ -253,13 +268,40 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-codegen" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427d105f617efc8cb55f8d036a7fded2e227892d8780b4985e5551f8d27c4a92" +dependencies = [ + "cranelift-bforest 0.86.1", + "cranelift-codegen-meta 0.86.1", + "cranelift-codegen-shared 0.86.1", + "cranelift-entity 0.86.1", + "cranelift-isle", + "gimli 0.26.2", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + [[package]] name = "cranelift-codegen-meta" version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" dependencies = [ - "cranelift-codegen-shared", + "cranelift-codegen-shared 0.82.3", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551674bed85b838d45358e3eab4f0ffaa6790c70dc08184204b9a54b41cdb7d1" +dependencies = [ + "cranelift-codegen-shared 0.86.1", ] [[package]] @@ -268,24 +310,54 @@ version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +[[package]] +name = "cranelift-codegen-shared" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b3a63ae57498c3eb495360944a33571754241e15e47e3bcae6082f40fec5866" + [[package]] name = "cranelift-entity" version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +[[package]] +name = "cranelift-entity" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11aa8aa624c72cc1c94ea3d0739fa61248260b5b14d3646f51593a88d67f3e6e" + [[package]] name = "cranelift-frontend" version = "0.82.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" dependencies = [ - "cranelift-codegen", + "cranelift-codegen 0.82.3", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-frontend" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "544ee8f4d1c9559c9aa6d46e7aaeac4a13856d620561094f35527356c7d21bd0" +dependencies = [ + "cranelift-codegen 0.86.1", "log", "smallvec", "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.86.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed16b14363d929b8c37e3c557d0a7396791b383ecc302141643c054343170aad" + [[package]] name = "crc32fast" version = "1.3.2" @@ -542,6 +614,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.6" @@ -640,7 +721,22 @@ version = "0.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9805b3e01e7b5c144782a0823db4dc895fec18a9ccd45a492ce7c7bf157a9e38" dependencies = [ - "holochain_serialized_bytes_derive", + "holochain_serialized_bytes_derive 0.0.51", + "rmp-serde", + "serde", + "serde-transcode", + "serde_bytes", + "serde_json", + "thiserror", +] + +[[package]] +name = "holochain_serialized_bytes" +version = "0.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7a5fc7c745a107f8ebcb04caab7a6b7a8463e2811f07ced19c281977583de7" +dependencies = [ + "holochain_serialized_bytes_derive 0.0.53", "rmp-serde", "serde", "serde-transcode", @@ -659,32 +755,42 @@ dependencies = [ "syn", ] +[[package]] +name = "holochain_serialized_bytes_derive" +version = "0.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3e0cf02005cbf0f514476d40e02125b26df6d4922d7a2c48a84fc588539d71" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "holochain_wasmer_common" -version = "0.0.84" +version = "0.0.85" dependencies = [ - "holochain_serialized_bytes", + "holochain_serialized_bytes 0.0.53", "serde", "serde_bytes", "test-fuzz", "thiserror", - "wasmer", - "wasmer-engine", + "wasmer 3.0.0", ] [[package]] name = "holochain_wasmer_host" -version = "0.0.84" +version = "0.0.85" dependencies = [ "bimap", - "holochain_serialized_bytes", + "bytes", + "holochain_serialized_bytes 0.0.53", "holochain_wasmer_common", "once_cell", "parking_lot", "rand", "serde", "tracing", - "wasmer", + "wasmer 3.0.0", ] [[package]] @@ -1154,6 +1260,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.7.1" @@ -1215,6 +1333,7 @@ checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" dependencies = [ "bytecheck", "hashbrown 0.12.3", + "indexmap", "ptr_meta", "rend", "rkyv_derive", @@ -1344,6 +1463,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.8" @@ -1397,6 +1527,12 @@ dependencies = [ "digest", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "smallvec" version = "1.10.0" @@ -1480,12 +1616,12 @@ dependencies = [ [[package]] name = "test" -version = "0.0.84" +version = "0.0.85" dependencies = [ "criterion", "ctor", "env_logger", - "holochain_serialized_bytes", + "holochain_serialized_bytes 0.0.51", "holochain_wasmer_common", "holochain_wasmer_host", "parking_lot", @@ -1494,7 +1630,7 @@ dependencies = [ "serde_bytes", "test-fuzz", "test_common", - "wasmer", + "wasmer 2.3.0", "wasmer-middlewares", ] @@ -1557,7 +1693,7 @@ dependencies = [ [[package]] name = "test_common" -version = "0.0.84" +version = "0.0.85" dependencies = [ "holochain_wasmer_common", "serde", @@ -1785,14 +1921,39 @@ dependencies = [ "thiserror", "wasm-bindgen", "wasmer-artifact", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-derive", + "wasmer-compiler 2.3.0", + "wasmer-compiler-cranelift 2.3.0", + "wasmer-derive 2.3.0", "wasmer-engine", "wasmer-engine-dylib", "wasmer-engine-universal", - "wasmer-types", - "wasmer-vm", + "wasmer-types 2.3.0", + "wasmer-vm 2.3.0", + "wat", + "winapi", +] + +[[package]] +name = "wasmer" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42842b89f029af8661ccac9575a5d17640a66c93dd10c48795e7a4532b0820c6" +dependencies = [ + "bytes", + "cfg-if", + "indexmap", + "js-sys", + "more-asserts", + "serde", + "serde-wasm-bindgen", + "target-lexicon", + "thiserror", + "wasm-bindgen", + "wasmer-compiler 3.0.0", + "wasmer-compiler-cranelift 3.0.0", + "wasmer-derive 3.0.0", + "wasmer-types 3.0.0", + "wasmer-vm 3.0.0", "wat", "winapi", ] @@ -1806,8 +1967,8 @@ dependencies = [ "enumset", "loupe", "thiserror", - "wasmer-compiler", - "wasmer-types", + "wasmer-compiler 2.3.0", + "wasmer-types 2.3.0", ] [[package]] @@ -1824,8 +1985,32 @@ dependencies = [ "smallvec", "target-lexicon", "thiserror", - "wasmer-types", + "wasmer-types 2.3.0", + "wasmparser", +] + +[[package]] +name = "wasmer-compiler" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197d3a3f54e890a2ff51ed43feacb542d6165f0e38e9b88f8331f2b320635664" +dependencies = [ + "backtrace", + "cfg-if", + "enum-iterator", + "enumset", + "lazy_static", + "leb128", + "memmap2", + "more-asserts", + "region", + "rustc-demangle", + "smallvec", + "thiserror", + "wasmer-types 3.0.0", + "wasmer-vm 3.0.0", "wasmparser", + "winapi", ] [[package]] @@ -1834,9 +2019,9 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", + "cranelift-codegen 0.82.3", + "cranelift-entity 0.82.3", + "cranelift-frontend 0.82.3", "gimli 0.26.2", "loupe", "more-asserts", @@ -1844,8 +2029,27 @@ dependencies = [ "smallvec", "target-lexicon", "tracing", - "wasmer-compiler", - "wasmer-types", + "wasmer-compiler 2.3.0", + "wasmer-types 2.3.0", +] + +[[package]] +name = "wasmer-compiler-cranelift" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5cb0cbe8bc9de18c8a548a7708047ecfcb4ea765634bec3612e521f81b6c0" +dependencies = [ + "cranelift-codegen 0.86.1", + "cranelift-entity 0.86.1", + "cranelift-frontend 0.86.1", + "gimli 0.26.2", + "more-asserts", + "rayon", + "smallvec", + "target-lexicon", + "tracing", + "wasmer-compiler 3.0.0", + "wasmer-types 3.0.0", ] [[package]] @@ -1860,6 +2064,18 @@ dependencies = [ "syn", ] +[[package]] +name = "wasmer-derive" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2894c70a832e05a8734515470322d402b7d4826a9c932e39f8080f516b9acae4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "wasmer-engine" version = "2.3.0" @@ -1878,9 +2094,9 @@ dependencies = [ "target-lexicon", "thiserror", "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", + "wasmer-compiler 2.3.0", + "wasmer-types 2.3.0", + "wasmer-vm 2.3.0", ] [[package]] @@ -1901,11 +2117,11 @@ dependencies = [ "tempfile", "tracing", "wasmer-artifact", - "wasmer-compiler", + "wasmer-compiler 2.3.0", "wasmer-engine", "wasmer-object", - "wasmer-types", - "wasmer-vm", + "wasmer-types 2.3.0", + "wasmer-vm 2.3.0", "which", ] @@ -1921,11 +2137,11 @@ dependencies = [ "loupe", "region", "rkyv", - "wasmer-compiler", + "wasmer-compiler 2.3.0", "wasmer-engine", "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", + "wasmer-types 2.3.0", + "wasmer-vm 2.3.0", "winapi", ] @@ -1941,8 +2157,8 @@ dependencies = [ "rkyv", "thiserror", "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "wasmer-compiler 2.3.0", + "wasmer-types 2.3.0", ] [[package]] @@ -1952,9 +2168,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" dependencies = [ "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "wasmer 2.3.0", + "wasmer-types 2.3.0", + "wasmer-vm 2.3.0", ] [[package]] @@ -1965,8 +2181,8 @@ checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" dependencies = [ "object 0.28.4", "thiserror", - "wasmer-compiler", - "wasmer-types", + "wasmer-compiler 2.3.0", + "wasmer-types 2.3.0", ] [[package]] @@ -1985,6 +2201,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "wasmer-types" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90642ba01b94c4f4da761a94f1e5e42226bafdbf918127d0c2b376bbab3c7396" +dependencies = [ + "enum-iterator", + "enumset", + "indexmap", + "more-asserts", + "rkyv", + "target-lexicon", + "thiserror", +] + [[package]] name = "wasmer-vm" version = "2.3.0" @@ -2009,7 +2240,31 @@ dependencies = [ "serde", "thiserror", "wasmer-artifact", - "wasmer-types", + "wasmer-types 2.3.0", + "winapi", +] + +[[package]] +name = "wasmer-vm" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c11d73e4ed1a4efb4cf2c87c67a65e867dce991cd1cf6d665511d9f757f9d8" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "corosensei", + "enum-iterator", + "indexmap", + "lazy_static", + "libc", + "mach", + "memoffset 0.6.5", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types 3.0.0", "winapi", ] diff --git a/test/wasm_empty/Cargo.lock b/test/wasm_empty/Cargo.lock index d0cc5976..13bdcb94 100644 --- a/test/wasm_empty/Cargo.lock +++ b/test/wasm_empty/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.30.2", + "object", "rustc-demangle", ] @@ -115,6 +115,12 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + [[package]] name = "camino" version = "1.1.2" @@ -183,56 +189,57 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "529ffacce2249ac60edba2941672dfedf3d96558b415d0d8083cd007456e0f55" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "427d105f617efc8cb55f8d036a7fded2e227892d8780b4985e5551f8d27c4a92" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", + "cranelift-isle", "gimli 0.26.2", "log", - "regalloc", + "regalloc2", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "551674bed85b838d45358e3eab4f0ffaa6790c70dc08184204b9a54b41cdb7d1" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +checksum = "2b3a63ae57498c3eb495360944a33571754241e15e47e3bcae6082f40fec5866" [[package]] name = "cranelift-entity" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "11aa8aa624c72cc1c94ea3d0739fa61248260b5b14d3646f51593a88d67f3e6e" [[package]] name = "cranelift-frontend" -version = "0.82.3" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "544ee8f4d1c9559c9aa6d46e7aaeac4a13856d620561094f35527356c7d21bd0" dependencies = [ "cranelift-codegen", "log", @@ -241,13 +248,10 @@ dependencies = [ ] [[package]] -name = "crc32fast" -version = "1.3.2" +name = "cranelift-isle" +version = "0.86.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] +checksum = "ed16b14363d929b8c37e3c557d0a7396791b383ecc302141643c054343170aad" [[package]] name = "crossbeam-channel" @@ -400,21 +404,21 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.6" @@ -453,15 +457,6 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -494,9 +489,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "holochain_serialized_bytes" -version = "0.0.51" +version = "0.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9805b3e01e7b5c144782a0823db4dc895fec18a9ccd45a492ce7c7bf157a9e38" +checksum = "5f7a5fc7c745a107f8ebcb04caab7a6b7a8463e2811f07ced19c281977583de7" dependencies = [ "holochain_serialized_bytes_derive", "rmp-serde", @@ -509,9 +504,9 @@ dependencies = [ [[package]] name = "holochain_serialized_bytes_derive" -version = "0.0.51" +version = "0.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1077232d0c427d64feb9e138fa22800e447eafb1810682d6c13beb95333cb32c" +checksum = "ec3e0cf02005cbf0f514476d40e02125b26df6d4922d7a2c48a84fc588539d71" dependencies = [ "quote", "syn", @@ -519,7 +514,7 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.84" +version = "0.0.85" dependencies = [ "holochain_serialized_bytes", "serde", @@ -527,12 +522,11 @@ dependencies = [ "test-fuzz", "thiserror", "wasmer", - "wasmer-engine", ] [[package]] name = "holochain_wasmer_guest" -version = "0.0.84" +version = "0.0.85" dependencies = [ "holochain_serialized_bytes", "holochain_wasmer_common", @@ -570,17 +564,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", + "hashbrown", ] [[package]] @@ -616,16 +600,6 @@ version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "lock_api" version = "0.4.9" @@ -645,27 +619,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] - -[[package]] -name = "loupe-derive" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "mach" version = "0.3.2" @@ -742,18 +695,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.30.2" @@ -908,13 +849,14 @@ dependencies = [ ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regalloc2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ + "fxhash", "log", - "rustc-hash", + "slice-group-by", "smallvec", ] @@ -947,15 +889,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rend" version = "0.3.6" @@ -972,7 +905,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" dependencies = [ "bytecheck", - "hashbrown 0.12.3", + "hashbrown", + "indexmap", "ptr_meta", "rend", "rkyv_derive", @@ -1018,12 +952,6 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustversion" version = "1.0.11" @@ -1102,6 +1030,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.8" @@ -1145,6 +1084,12 @@ dependencies = [ "digest", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "smallvec" version = "1.10.0" @@ -1203,20 +1148,6 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - [[package]] name = "test-fuzz" version = "3.0.4" @@ -1276,7 +1207,7 @@ dependencies = [ [[package]] name = "test_wasm_empty" -version = "0.0.84" +version = "0.0.85" dependencies = [ "holochain_wasmer_guest", ] @@ -1321,7 +1252,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1470,73 +1400,63 @@ dependencies = [ [[package]] name = "wasmer" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "42842b89f029af8661ccac9575a5d17640a66c93dd10c48795e7a4532b0820c6" dependencies = [ + "bytes", "cfg-if", "indexmap", "js-sys", - "loupe", "more-asserts", + "serde", + "serde-wasm-bindgen", "target-lexicon", "thiserror", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "wat", "winapi", ] -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "197d3a3f54e890a2ff51ed43feacb542d6165f0e38e9b88f8331f2b320635664" dependencies = [ + "backtrace", + "cfg-if", + "enum-iterator", "enumset", - "loupe", - "rkyv", - "serde", - "serde_bytes", + "lazy_static", + "leb128", + "memmap2", + "more-asserts", + "region", + "rustc-demangle", "smallvec", - "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", + "winapi", ] [[package]] name = "wasmer-compiler-cranelift" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" +checksum = "caf5cb0cbe8bc9de18c8a548a7708047ecfcb4ea765634bec3612e521f81b6c0" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "gimli 0.26.2", - "loupe", "more-asserts", "rayon", "smallvec", @@ -1548,9 +1468,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "2894c70a832e05a8734515470322d402b7d4826a9c932e39f8080f516b9acae4" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1558,124 +1478,26 @@ dependencies = [ "syn", ] -[[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" -dependencies = [ - "cfg-if", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" -dependencies = [ - "cfg-if", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-object" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" -dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - [[package]] name = "wasmer-types" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "90642ba01b94c4f4da761a94f1e5e42226bafdbf918127d0c2b376bbab3c7396" dependencies = [ - "backtrace", "enum-iterator", + "enumset", "indexmap", - "loupe", "more-asserts", "rkyv", - "serde", + "target-lexicon", "thiserror", ] [[package]] name = "wasmer-vm" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "76c11d73e4ed1a4efb4cf2c87c67a65e867dce991cd1cf6d665511d9f757f9d8" dependencies = [ "backtrace", "cc", @@ -1685,16 +1507,12 @@ dependencies = [ "indexmap", "lazy_static", "libc", - "loupe", "mach", "memoffset 0.6.5", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", "wasmer-types", "winapi", ] @@ -1726,17 +1544,6 @@ dependencies = [ "wast", ] -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "winapi" version = "0.3.9" From 68e2b958425026b8f11ac5f6e29896f0a3106e0c Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 27 Sep 2023 19:03:08 +0400 Subject: [PATCH 05/24] wip on 3 --- crates/common/Cargo.toml | 2 +- crates/host/Cargo.toml | 2 +- crates/host/src/env.rs | 18 +- crates/host/src/guest.rs | 2 + crates/host/src/module.rs | 2 + crates/host/src/prelude.rs | 4 +- test/Cargo.lock | 826 ++++++++++++++----------------------- test/Cargo.toml | 4 +- test/src/import.rs | 72 ++-- test/src/test.rs | 18 +- test/src/wasms.rs | 13 +- test/wasm_empty/Cargo.lock | 367 ++++++++++++---- 12 files changed, 678 insertions(+), 652 deletions(-) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 37f7e6f4..bc41fb20 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -18,4 +18,4 @@ default = [] error_as_host = [] [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -wasmer = "=3.0.0" +wasmer = "=3.3.0" diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index 4902a3c5..3a97a1c2 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -7,7 +7,7 @@ authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" [dependencies] -wasmer = "=3.0.0" +wasmer = "=3.3.0" holochain_wasmer_common = { version = "=0.0.85", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index e18d8f29..410dca5a 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -4,18 +4,16 @@ // use crate::prelude::*; // use wasmer::Function; // use wasmer::LazyInit; -// use wasmer::Memory; +use wasmer::Memory; +use wasmer::TypedFunction; // use wasmer::WasmerEnv; -// #[derive(Clone, Default, WasmerEnv)] -// pub struct Env { -// #[wasmer(export)] -// memory: LazyInit, -// #[wasmer(export(name = "__hc__allocate_1"))] -// allocate: LazyInit, -// #[wasmer(export(name = "__hc__deallocate_1"))] -// deallocate: LazyInit, -// } +#[derive(Clone, Default)] +pub struct Env { + // memory: Option, + // allocate: Option>, + // deallocate: Option>, +} // impl Env { // /// Given some input I that can be serialized, request an allocation from the diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index 1f07c9e2..9c0fccd3 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -3,9 +3,11 @@ use core::num::TryFromIntError; use holochain_serialized_bytes::prelude::*; // use parking_lot::Mutex; // use std::sync::Arc; +use wasmer::AsStoreMut; use wasmer::Instance; use wasmer::Memory; use wasmer::Value; +use wasmer::WasmSlice; /// Write a slice of bytes to the guest in a safe-ish way. /// diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index 6de10c76..c5fc8a8f 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -7,6 +7,8 @@ use parking_lot::Mutex; use parking_lot::RwLock; use std::collections::BTreeMap; use std::sync::Arc; +use wasmer::Cranelift; +use wasmer::Instance; use wasmer::Module; use wasmer::Store; // use wasmer::Universal; diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index fba72d4b..c22a2d5d 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,4 +1,4 @@ -// pub use crate::env::Env; +pub use crate::env::Env; pub use crate::guest; pub use crate::module::MODULE_CACHE; pub use holochain_serialized_bytes::prelude::*; @@ -6,4 +6,4 @@ pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; pub use parking_lot::Mutex; // pub use wasmer::WasmerEnv; -pub use wasmer::*; +// pub use wasmer::*; diff --git a/test/Cargo.lock b/test/Cargo.lock index 31b81000..5a949d26 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -37,6 +37,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "atty" version = "0.2.14" @@ -65,7 +71,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.30.2", + "object", "rustc-demangle", ] @@ -90,6 +96,18 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.3" @@ -119,19 +137,20 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecheck" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ "bytecheck_derive", "ptr_meta", + "simdutf8", ] [[package]] name = "bytecheck_derive" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", @@ -221,7 +240,7 @@ dependencies = [ "cfg-if", "libc", "scopeguard", - "windows-sys 0.33.0", + "windows-sys", ] [[package]] @@ -235,49 +254,26 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" dependencies = [ - "cranelift-entity 0.82.3", -] - -[[package]] -name = "cranelift-bforest" -version = "0.86.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529ffacce2249ac60edba2941672dfedf3d96558b415d0d8083cd007456e0f55" -dependencies = [ - "cranelift-entity 0.86.1", + "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ - "cranelift-bforest 0.82.3", - "cranelift-codegen-meta 0.82.3", - "cranelift-codegen-shared 0.82.3", - "cranelift-entity 0.82.3", - "gimli 0.26.2", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen" -version = "0.86.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427d105f617efc8cb55f8d036a7fded2e227892d8780b4985e5551f8d27c4a92" -dependencies = [ - "cranelift-bforest 0.86.1", - "cranelift-codegen-meta 0.86.1", - "cranelift-codegen-shared 0.86.1", - "cranelift-entity 0.86.1", + "arrayvec", + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-egraph", + "cranelift-entity", "cranelift-isle", "gimli 0.26.2", "log", @@ -288,65 +284,46 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" dependencies = [ - "cranelift-codegen-shared 0.82.3", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.86.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551674bed85b838d45358e3eab4f0ffaa6790c70dc08184204b9a54b41cdb7d1" -dependencies = [ - "cranelift-codegen-shared 0.86.1", + "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-codegen-shared" -version = "0.86.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b3a63ae57498c3eb495360944a33571754241e15e47e3bcae6082f40fec5866" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" [[package]] -name = "cranelift-entity" -version = "0.86.1" +name = "cranelift-egraph" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11aa8aa624c72cc1c94ea3d0739fa61248260b5b14d3646f51593a88d67f3e6e" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" dependencies = [ - "cranelift-codegen 0.82.3", + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap", "log", "smallvec", - "target-lexicon", ] +[[package]] +name = "cranelift-entity" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" + [[package]] name = "cranelift-frontend" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "544ee8f4d1c9559c9aa6d46e7aaeac4a13856d620561094f35527356c7d21bd0" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" dependencies = [ - "cranelift-codegen 0.86.1", + "cranelift-codegen", "log", "smallvec", "target-lexicon", @@ -354,18 +331,9 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed16b14363d929b8c37e3c557d0a7396791b383ecc302141643c054343170aad" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" [[package]] name = "criterion" @@ -523,6 +491,30 @@ dependencies = [ "syn", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.0", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.6" @@ -600,19 +592,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] -name = "fastrand" -version = "1.8.0" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "instant", + "percent-encoding", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "funty" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "fxhash" @@ -669,21 +667,18 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -774,7 +769,7 @@ dependencies = [ "serde_bytes", "test-fuzz", "thiserror", - "wasmer 3.0.0", + "wasmer", ] [[package]] @@ -790,7 +785,7 @@ dependencies = [ "rand", "serde", "tracing", - "wasmer 3.0.0", + "wasmer", ] [[package]] @@ -814,6 +809,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -828,16 +833,6 @@ checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", ] [[package]] @@ -888,21 +883,11 @@ version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -917,27 +902,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] - -[[package]] -name = "loupe-derive" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "mach" version = "0.3.2" @@ -964,18 +928,18 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "memoffset" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -1014,18 +978,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.30.2" @@ -1037,9 +989,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "oorandom" @@ -1059,15 +1011,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-targets", ] [[package]] @@ -1076,6 +1028,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pest" version = "2.5.3" @@ -1188,6 +1146,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.8.5" @@ -1242,29 +1206,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags", ] -[[package]] -name = "regalloc" -version = "0.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" -dependencies = [ - "log", - "rustc-hash", - "smallvec", -] - [[package]] name = "regalloc2" -version = "0.3.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ "fxhash", "log", @@ -1307,30 +1260,22 @@ dependencies = [ "winapi", ] -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rend" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "rkyv" -version = "0.7.39" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ + "bitvec", "bytecheck", "hashbrown 0.12.3", "indexmap", @@ -1338,13 +1283,15 @@ dependencies = [ "rend", "rkyv_derive", "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.39" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", @@ -1379,12 +1326,6 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustversion" version = "1.0.11" @@ -1527,6 +1468,12 @@ dependencies = [ "digest", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1586,24 +1533,16 @@ dependencies = [ ] [[package]] -name = "target-lexicon" -version = "0.12.5" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "tempfile" -version = "3.3.0" +name = "target-lexicon" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] +checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "termcolor" @@ -1630,7 +1569,7 @@ dependencies = [ "serde_bytes", "test-fuzz", "test_common", - "wasmer 2.3.0", + "wasmer", "wasmer-middlewares", ] @@ -1739,6 +1678,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toolchain_find" version = "0.2.0" @@ -1759,7 +1713,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1797,12 +1750,27 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.1.10" @@ -1820,6 +1788,23 @@ dependencies = [ "syn", ] +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" + [[package]] name = "version_check" version = "0.9.4" @@ -1868,6 +1853,29 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-downcast" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dac026d43bcca6e7ce1c0956ba68f59edf6403e8e930a5d891be72c31a44340" +dependencies = [ + "js-sys", + "once_cell", + "wasm-bindgen", + "wasm-bindgen-downcast-macros", +] + +[[package]] +name = "wasm-bindgen-downcast-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.83" @@ -1908,92 +1916,37 @@ dependencies = [ [[package]] name = "wasmer" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" -dependencies = [ - "cfg-if", - "indexmap", - "js-sys", - "loupe", - "more-asserts", - "target-lexicon", - "thiserror", - "wasm-bindgen", - "wasmer-artifact", - "wasmer-compiler 2.3.0", - "wasmer-compiler-cranelift 2.3.0", - "wasmer-derive 2.3.0", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", - "wasmer-types 2.3.0", - "wasmer-vm 2.3.0", - "wat", - "winapi", -] - -[[package]] -name = "wasmer" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42842b89f029af8661ccac9575a5d17640a66c93dd10c48795e7a4532b0820c6" +checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" dependencies = [ "bytes", "cfg-if", + "derivative", "indexmap", "js-sys", "more-asserts", + "rustc-demangle", "serde", "serde-wasm-bindgen", "target-lexicon", "thiserror", "wasm-bindgen", - "wasmer-compiler 3.0.0", - "wasmer-compiler-cranelift 3.0.0", - "wasmer-derive 3.0.0", - "wasmer-types 3.0.0", - "wasmer-vm 3.0.0", + "wasm-bindgen-downcast", + "wasmer-compiler", + "wasmer-compiler-cranelift", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", "wat", "winapi", ] -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler 2.3.0", - "wasmer-types 2.3.0", -] - [[package]] name = "wasmer-compiler" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" -dependencies = [ - "enumset", - "loupe", - "rkyv", - "serde", - "serde_bytes", - "smallvec", - "target-lexicon", - "thiserror", - "wasmer-types 2.3.0", - "wasmparser", -] - -[[package]] -name = "wasmer-compiler" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197d3a3f54e890a2ff51ed43feacb542d6165f0e38e9b88f8331f2b320635664" +checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" dependencies = [ "backtrace", "cfg-if", @@ -2004,71 +1957,38 @@ dependencies = [ "memmap2", "more-asserts", "region", - "rustc-demangle", "smallvec", "thiserror", - "wasmer-types 3.0.0", - "wasmer-vm 3.0.0", + "wasmer-types", + "wasmer-vm", "wasmparser", "winapi", ] [[package]] name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen 0.82.3", - "cranelift-entity 0.82.3", - "cranelift-frontend 0.82.3", - "gimli 0.26.2", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler 2.3.0", - "wasmer-types 2.3.0", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5cb0cbe8bc9de18c8a548a7708047ecfcb4ea765634bec3612e521f81b6c0" +checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" dependencies = [ - "cranelift-codegen 0.86.1", - "cranelift-entity 0.86.1", - "cranelift-frontend 0.86.1", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", "gimli 0.26.2", "more-asserts", "rayon", "smallvec", "target-lexicon", "tracing", - "wasmer-compiler 3.0.0", - "wasmer-types 3.0.0", -] - -[[package]] -name = "wasmer-derive" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", + "wasmer-compiler", + "wasmer-types", ] [[package]] name = "wasmer-derive" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2894c70a832e05a8734515470322d402b7d4826a9c932e39f8080f516b9acae4" +checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" dependencies = [ "proc-macro-error", "proc-macro2", @@ -2076,137 +1996,24 @@ dependencies = [ "syn", ] -[[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler 2.3.0", - "wasmer-types 2.3.0", - "wasmer-vm 2.3.0", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" -dependencies = [ - "cfg-if", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler 2.3.0", - "wasmer-engine", - "wasmer-object", - "wasmer-types 2.3.0", - "wasmer-vm 2.3.0", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" -dependencies = [ - "cfg-if", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler 2.3.0", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types 2.3.0", - "wasmer-vm 2.3.0", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler 2.3.0", - "wasmer-types 2.3.0", -] - [[package]] name = "wasmer-middlewares" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" -dependencies = [ - "loupe", - "wasmer 2.3.0", - "wasmer-types 2.3.0", - "wasmer-vm 2.3.0", -] - -[[package]] -name = "wasmer-object" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" -dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler 2.3.0", - "wasmer-types 2.3.0", -] - -[[package]] -name = "wasmer-types" -version = "2.3.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "9e028013811035111beb768074b6ccc09eabd77811b1e01fd099b5471924ca16" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "wasmer", + "wasmer-types", + "wasmer-vm", ] [[package]] name = "wasmer-types" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90642ba01b94c4f4da761a94f1e5e42226bafdbf918127d0c2b376bbab3c7396" +checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" dependencies = [ + "bytecheck", "enum-iterator", "enumset", "indexmap", @@ -2218,62 +2025,41 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "2.3.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "dashmap", + "derivative", "enum-iterator", + "fnv", "indexmap", "lazy_static", "libc", - "loupe", "mach", - "memoffset 0.6.5", + "memoffset 0.8.0", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", - "wasmer-types 2.3.0", + "wasmer-types", "winapi", ] [[package]] -name = "wasmer-vm" -version = "3.0.0" +name = "wasmparser" +version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c11d73e4ed1a4efb4cf2c87c67a65e867dce991cd1cf6d665511d9f757f9d8" +checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", "indexmap", - "lazy_static", - "libc", - "mach", - "memoffset 0.6.5", - "more-asserts", - "region", - "scopeguard", - "thiserror", - "wasmer-types 3.0.0", - "winapi", + "url", ] -[[package]] -name = "wasmparser" -version = "0.83.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" - [[package]] name = "wast" version = "50.0.0" @@ -2305,17 +2091,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2361,25 +2136,25 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -2389,9 +2164,9 @@ checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -2401,9 +2176,9 @@ checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -2413,9 +2188,9 @@ checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -2425,15 +2200,15 @@ checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -2443,6 +2218,15 @@ checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "wyz" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/test/Cargo.toml b/test/Cargo.toml index 4300ea40..5b3fcba3 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -14,8 +14,8 @@ criterion = "0.3" rand = "0.8" serde_bytes = "0.11" parking_lot = "0.12" -wasmer = "=2.3.0" -wasmer-middlewares = "=2.3.0" +wasmer = "=3.3.0" +wasmer-middlewares = "=3.3.0" test-fuzz = "=3.0.4" [dev-dependencies] diff --git a/test/src/import.rs b/test/src/import.rs index 1bff3de3..50a19b51 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -1,38 +1,62 @@ -use crate::debug; +// use crate::debug; use crate::pages; use crate::short_circuit; use crate::test_process_string; use crate::test_process_struct; use holochain_wasmer_host::prelude::*; +use wasmer::imports; +use wasmer::AsStoreMut; +use wasmer::Function; +use wasmer::FunctionEnv; +use wasmer::FunctionEnvMut; +use wasmer::Imports; -pub fn import_object(store: &Store, env: &Env) -> ImportObject { +pub fn debug(_env: FunctionEnvMut, some_number: i32) -> i32 { + println!("debug {:?}", some_number); + // env.move_data_to_guest(()) + 0 +} + +/// ``` +/// # use wasmer::{Store, Function, FunctionEnv, FunctionEnvMut}; +/// # let mut store = Store::default(); +/// # let env = FunctionEnv::new(&mut store, ()); +/// # +/// fn sum(_env: FunctionEnvMut<()>, a: i32, b: i32) -> i32 { +/// a + b +/// } +/// +/// let f = Function::new_typed_with_env(&mut store, &env, sum); +/// ``` + +pub fn imports(store: &mut impl AsStoreMut, env: FunctionEnv<()>) -> Imports { imports! { "env" => { - "__hc__short_circuit_5" => Function::new_native_with_env( + // "__hc__short_circuit_5" => Function::new_typed_with_env( + // store, + // env.clone(), + // short_circuit + // ), + // "__hc__test_process_string_2" => Function::new_typed_with_env( + // store, + // env.clone(), + // test_process_string + // ), + // "__hc__test_process_struct_2" => Function::new_typed_with_env( + // store, + // env.clone(), + // test_process_struct + // ), + "__hc__debug_1" => Function::new_typed_with_env( store, - env.clone(), - short_circuit - ), - "__hc__test_process_string_2" => Function::new_native_with_env( - store, - env.clone(), - test_process_string - ), - "__hc__test_process_struct_2" => Function::new_native_with_env( - store, - env.clone(), - test_process_struct - ), - "__hc__debug_1" => Function::new_native_with_env( - store, - env.clone(), + &FunctionEnv::new(&mut store, Env::default()), debug ), - "__hc__pages_1" => Function::new_native_with_env( - store, - env.clone(), - pages - ), + // "__hc__pages_1" => Function::new_typed_with_env( + // store, + // env.clone(), + // pages + // ), }, } } diff --git a/test/src/test.rs b/test/src/test.rs index d86ff237..559778a3 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -3,8 +3,13 @@ pub mod wasms; use holochain_wasmer_host::prelude::*; use test_common::SomeStruct; +use wasmer::FunctionEnv; -pub fn short_circuit(_: &Env, _: GuestPtr, _: Len) -> Result { +pub fn short_circuit( + env: FunctionEnv, + _: GuestPtr, + _: Len, +) -> Result { Err(wasm_error!(WasmErrorInner::HostShortCircuit( holochain_serialized_bytes::encode(&String::from("shorts")).map_err(|e| wasm_error!(e))?, )) @@ -12,7 +17,7 @@ pub fn short_circuit(_: &Env, _: GuestPtr, _: Len) -> Result, guest_ptr: GuestPtr, len: Len, ) -> Result { @@ -22,7 +27,7 @@ pub fn test_process_string( } pub fn test_process_struct( - env: &Env, + env: FunctionEnv, guest_ptr: GuestPtr, len: Len, ) -> Result { @@ -31,12 +36,13 @@ pub fn test_process_struct( env.move_data_to_guest(Ok::(some_struct)) } -pub fn debug(env: &Env, some_number: WasmSize) -> Result { +pub fn debug(env: FunctionEnv, some_number: i32) -> i32 { println!("debug {:?}", some_number); - env.move_data_to_guest(()) + // env.move_data_to_guest(()) + 0 } -pub fn pages(env: &Env, _: WasmSize) -> Result { +pub fn pages(env: FunctionEnv, _: WasmSize) -> Result { Ok(env .memory_ref() .ok_or(wasm_error!(WasmErrorInner::Memory))? diff --git a/test/src/wasms.rs b/test/src/wasms.rs index b16c8906..f4098f60 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -1,10 +1,13 @@ -use crate::import::import_object; -use crate::wasmparser::Operator; +use crate::import::imports; use holochain_wasmer_host::module::SerializedModuleCache; use holochain_wasmer_host::module::SERIALIZED_MODULE_CACHE; use holochain_wasmer_host::prelude::*; use parking_lot::Mutex; use std::sync::Arc; +use wasmer::Cranelift; +use wasmer::Imports; +use wasmer::Instance; +use wasmer::Module; use wasmer_middlewares::Metering; pub enum TestWasm { @@ -108,9 +111,9 @@ impl TestWasm { pub fn _instance(&self, metered: bool) -> Arc> { let module = self.module(metered); - let env = Env::default(); - let import_object: ImportObject = import_object(module.store(), &env); - Arc::new(Mutex::new(Instance::new(&module, &import_object).unwrap())) + // let env = Env::default(); + let imports: Imports = imports(module.store()); + Arc::new(Mutex::new(Instance::new(&module, &imports).unwrap())) } pub fn instance(&self) -> Arc> { diff --git a/test/wasm_empty/Cargo.lock b/test/wasm_empty/Cargo.lock index 13bdcb94..5ddff29d 100644 --- a/test/wasm_empty/Cargo.lock +++ b/test/wasm_empty/Cargo.lock @@ -37,6 +37,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "autocfg" version = "1.1.0" @@ -73,6 +79,18 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.3" @@ -90,19 +108,20 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecheck" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ "bytecheck_derive", "ptr_meta", + "simdutf8", ] [[package]] name = "bytecheck_derive" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", @@ -175,7 +194,7 @@ dependencies = [ "cfg-if", "libc", "scopeguard", - "windows-sys 0.33.0", + "windows-sys", ] [[package]] @@ -189,22 +208,25 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529ffacce2249ac60edba2941672dfedf3d96558b415d0d8083cd007456e0f55" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427d105f617efc8cb55f8d036a7fded2e227892d8780b4985e5551f8d27c4a92" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ + "arrayvec", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-egraph", "cranelift-entity", "cranelift-isle", "gimli 0.26.2", @@ -216,30 +238,44 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551674bed85b838d45358e3eab4f0ffaa6790c70dc08184204b9a54b41cdb7d1" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.86.1" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b3a63ae57498c3eb495360944a33571754241e15e47e3bcae6082f40fec5866" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap", + "log", + "smallvec", +] [[package]] name = "cranelift-entity" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11aa8aa624c72cc1c94ea3d0739fa61248260b5b14d3646f51593a88d67f3e6e" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" [[package]] name = "cranelift-frontend" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "544ee8f4d1c9559c9aa6d46e7aaeac4a13856d620561094f35527356c7d21bd0" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" dependencies = [ "cranelift-codegen", "log", @@ -249,9 +285,9 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.86.1" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed16b14363d929b8c37e3c557d0a7396791b383ecc302141643c054343170aad" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" [[package]] name = "crossbeam-channel" @@ -341,6 +377,30 @@ dependencies = [ "syn", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.0", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.6" @@ -410,6 +470,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "fxhash" version = "0.2.1" @@ -466,6 +541,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" version = "0.4.0" @@ -551,6 +632,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -564,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -602,9 +693,9 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -645,18 +736,18 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "memoffset" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -706,9 +797,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "parking_lot" @@ -722,15 +813,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-targets", ] [[package]] @@ -739,6 +830,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pest" version = "2.5.3" @@ -817,6 +914,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rayon" version = "1.6.1" @@ -841,18 +944,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags", ] [[package]] name = "regalloc2" -version = "0.3.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ "fxhash", "log", @@ -891,33 +994,36 @@ dependencies = [ [[package]] name = "rend" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "rkyv" -version = "0.7.39" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ + "bitvec", "bytecheck", - "hashbrown", + "hashbrown 0.12.3", "indexmap", "ptr_meta", "rend", "rkyv_derive", "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.39" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", @@ -1084,6 +1190,12 @@ dependencies = [ "digest", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1142,6 +1254,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" version = "0.12.5" @@ -1232,6 +1350,21 @@ dependencies = [ "syn", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toolchain_find" version = "0.2.0" @@ -1289,12 +1422,27 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.1.10" @@ -1312,6 +1460,23 @@ dependencies = [ "syn", ] +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" + [[package]] name = "version_check" version = "0.9.4" @@ -1360,6 +1525,29 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-downcast" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dac026d43bcca6e7ce1c0956ba68f59edf6403e8e930a5d891be72c31a44340" +dependencies = [ + "js-sys", + "once_cell", + "wasm-bindgen", + "wasm-bindgen-downcast-macros", +] + +[[package]] +name = "wasm-bindgen-downcast-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.83" @@ -1400,20 +1588,23 @@ dependencies = [ [[package]] name = "wasmer" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42842b89f029af8661ccac9575a5d17640a66c93dd10c48795e7a4532b0820c6" +checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" dependencies = [ "bytes", "cfg-if", + "derivative", "indexmap", "js-sys", "more-asserts", + "rustc-demangle", "serde", "serde-wasm-bindgen", "target-lexicon", "thiserror", "wasm-bindgen", + "wasm-bindgen-downcast", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-derive", @@ -1425,9 +1616,9 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197d3a3f54e890a2ff51ed43feacb542d6165f0e38e9b88f8331f2b320635664" +checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" dependencies = [ "backtrace", "cfg-if", @@ -1438,7 +1629,6 @@ dependencies = [ "memmap2", "more-asserts", "region", - "rustc-demangle", "smallvec", "thiserror", "wasmer-types", @@ -1449,9 +1639,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5cb0cbe8bc9de18c8a548a7708047ecfcb4ea765634bec3612e521f81b6c0" +checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1468,9 +1658,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2894c70a832e05a8734515470322d402b7d4826a9c932e39f8080f516b9acae4" +checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1480,10 +1670,11 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90642ba01b94c4f4da761a94f1e5e42226bafdbf918127d0c2b376bbab3c7396" +checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" dependencies = [ + "bytecheck", "enum-iterator", "enumset", "indexmap", @@ -1495,20 +1686,23 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c11d73e4ed1a4efb4cf2c87c67a65e867dce991cd1cf6d665511d9f757f9d8" +checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "dashmap", + "derivative", "enum-iterator", + "fnv", "indexmap", "lazy_static", "libc", "mach", - "memoffset 0.6.5", + "memoffset 0.8.0", "more-asserts", "region", "scopeguard", @@ -1519,9 +1713,13 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" +dependencies = [ + "indexmap", + "url", +] [[package]] name = "wast" @@ -1589,25 +1787,25 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -1617,9 +1815,9 @@ checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -1629,9 +1827,9 @@ checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -1641,9 +1839,9 @@ checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -1653,15 +1851,15 @@ checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -1671,6 +1869,15 @@ checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "wyz" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] From 19d774018fe24a3aafdd501ef72674b149a48579 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 1 Oct 2023 17:56:45 +0400 Subject: [PATCH 06/24] wip on 3 --- crates/host/Cargo.toml | 1 + crates/host/src/env.rs | 171 +++++++++++++++++++------------------ crates/host/src/guest.rs | 19 +++-- crates/host/src/host.rs | 1 + crates/host/src/prelude.rs | 1 + crates/host/src/store.rs | 19 +++++ test/Cargo.lock | 1 + test/src/import.rs | 10 ++- test/src/test.rs | 5 ++ test/src/wasms.rs | 11 ++- 10 files changed, 142 insertions(+), 97 deletions(-) create mode 100644 crates/host/src/store.rs diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index 3a97a1c2..b9fa69b5 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" [dependencies] wasmer = "=3.3.0" +wasmer-middlewares = "=3.3.0" holochain_wasmer_common = { version = "=0.0.85", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index 410dca5a..e2a46cc5 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -1,97 +1,102 @@ // use std::num::TryFromIntError; -// use crate::guest::read_bytes; -// use crate::prelude::*; +use crate::guest::read_bytes; +use crate::prelude::*; // use wasmer::Function; // use wasmer::LazyInit; use wasmer::Memory; use wasmer::TypedFunction; // use wasmer::WasmerEnv; +use wasmer::AsStoreMut; +use wasmer::AsStoreRef; +use wasmer::Value; #[derive(Clone, Default)] pub struct Env { - // memory: Option, + memory: Option, // allocate: Option>, - // deallocate: Option>, + deallocate: Option>, } -// impl Env { -// /// Given some input I that can be serialized, request an allocation from the -// /// guest and copy the serialized bytes to the allocated pointer. The guest -// /// MUST subsequently take ownership of these bytes or it will leak memory. -// pub fn move_data_to_guest(&self, input: I) -> Result -// where -// I: serde::Serialize + std::fmt::Debug, -// { -// let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; -// let guest_ptr: GuestPtr = match self -// .allocate_ref() -// .ok_or(wasm_error!(WasmErrorInner::Memory))? -// .call(&[Value::I32( -// data.len() -// .try_into() -// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, -// )]) -// .map_err(|e| wasm_error!(e.to_string()))? -// .get(0) -// { -// Some(Value::I32(guest_ptr)) => (*guest_ptr) -// .try_into() -// .map_err(|e: TryFromIntError| wasm_error!(e))?, -// _ => return Err(wasm_error!(WasmErrorInner::PointerMap).into()), -// }; -// let len: Len = match data.len().try_into() { -// Ok(len) => len, -// Err(e) => return Err(wasm_error!(e).into()), -// }; -// crate::guest::write_bytes( -// self.memory_ref() -// .ok_or(wasm_error!(WasmErrorInner::Memory))?, -// guest_ptr, -// &data, -// )?; -// Ok(merge_u32(guest_ptr, len)?) -// } +impl Env { + // /// Given some input I that can be serialized, request an allocation from the + // /// guest and copy the serialized bytes to the allocated pointer. The guest + // /// MUST subsequently take ownership of these bytes or it will leak memory. + // pub fn move_data_to_guest(&self, input: I) -> Result + // where + // I: serde::Serialize + std::fmt::Debug, + // { + // let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; + // let guest_ptr: GuestPtr = match self + // .allocate_ref() + // .ok_or(wasm_error!(WasmErrorInner::Memory))? + // .call(&[Value::I32( + // data.len() + // .try_into() + // .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, + // )]) + // .map_err(|e| wasm_error!(e.to_string()))? + // .get(0) + // { + // Some(Value::I32(guest_ptr)) => (*guest_ptr) + // .try_into() + // .map_err(|e: TryFromIntError| wasm_error!(e))?, + // _ => return Err(wasm_error!(WasmErrorInner::PointerMap).into()), + // }; + // let len: Len = match data.len().try_into() { + // Ok(len) => len, + // Err(e) => return Err(wasm_error!(e).into()), + // }; + // crate::guest::write_bytes( + // self.memory_ref() + // .ok_or(wasm_error!(WasmErrorInner::Memory))?, + // guest_ptr, + // &data, + // )?; + // Ok(merge_u32(guest_ptr, len)?) + // } -// /// Given a pointer and length for a region of memory in the guest, copy the -// /// bytes to the host and attempt to deserialize type `O` from the data. The -// /// guest will be asked to deallocate the copied bytes whether or not the -// /// deserialization is successful. -// pub fn consume_bytes_from_guest( -// &self, -// guest_ptr: GuestPtr, -// len: Len, -// ) -> Result -// where -// O: serde::de::DeserializeOwned + std::fmt::Debug, -// { -// let bytes = read_bytes( -// self.memory_ref() -// .ok_or(wasm_error!(WasmErrorInner::Memory))?, -// guest_ptr, -// len, -// ) -// .map_err(|_| wasm_error!(WasmErrorInner::Memory))?; -// self.deallocate_ref() -// .ok_or(wasm_error!(WasmErrorInner::Memory))? -// .call(&[ -// Value::I32( -// guest_ptr -// .try_into() -// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, -// ), -// Value::I32( -// len.try_into() -// .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, -// ), -// ]) -// .map_err(|e| wasm_error!(e.to_string()))?; -// match holochain_serialized_bytes::decode(&bytes) { -// Ok(v) => Ok(v), -// Err(e) => { -// tracing::error!(input_type = std::any::type_name::(), bytes = ?bytes, "{}", e); -// Err(wasm_error!(e).into()) -// } -// } -// } -// } + /// Given a pointer and length for a region of memory in the guest, copy the + /// bytes to the host and attempt to deserialize type `O` from the data. The + /// guest will be asked to deallocate the copied bytes whether or not the + /// deserialization is successful. + pub fn consume_bytes_from_guest( + &self, + guest_ptr: GuestPtr, + len: Len, + ) -> Result + where + O: serde::de::DeserializeOwned + std::fmt::Debug, + { + let bytes = read_bytes( + &self + .memory + .as_ref() + .ok_or(wasm_error!(WasmErrorInner::Memory))? + .view(&STORE.as_store_ref()), + guest_ptr, + len, + ) + .map_err(|_| wasm_error!(WasmErrorInner::Memory))?; + let mut store_mut = STORE.as_store_mut(); + self.deallocate + .as_ref() + .ok_or(wasm_error!(WasmErrorInner::Memory))? + .call( + &mut store_mut, + guest_ptr + .try_into() + .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, + len.try_into() + .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, + ) + .map_err(|e| wasm_error!(e.to_string()))?; + match holochain_serialized_bytes::decode(&bytes) { + Ok(v) => Ok(v), + Err(e) => { + tracing::error!(input_type = std::any::type_name::(), bytes = ?bytes, "{}", e); + Err(wasm_error!(e).into()) + } + } + } +} diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index 9c0fccd3..225137c9 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -6,6 +6,7 @@ use holochain_serialized_bytes::prelude::*; use wasmer::AsStoreMut; use wasmer::Instance; use wasmer::Memory; +use wasmer::MemoryView; use wasmer::Value; use wasmer::WasmSlice; @@ -99,16 +100,16 @@ pub fn write_bytes( /// /// A better approach is to use an immutable deref from a `WasmPtr`, which checks against memory /// bounds for the guest, and map over the whole thing to a `Vec`. -// pub fn read_bytes( -// memory: &Memory, -// guest_ptr: GuestPtr, -// len: Len, -// ) -> Result, wasmer::RuntimeError> { -// #[cfg(feature = "debug_memory")] -// tracing::debug!("reading bytes from guest to host at: {} {}", guest_ptr, len); +pub fn read_bytes( + memory_view: &MemoryView, + guest_ptr: GuestPtr, + len: Len, +) -> Result, wasmer::MemoryAccessError> { + #[cfg(feature = "debug_memory")] + tracing::debug!("reading bytes from guest to host at: {} {}", guest_ptr, len); -// WasmSlice::new(guest_ptr, len)?.read_to_vec() -// } + WasmSlice::new(memory_view, guest_ptr.into(), len.into())?.read_to_vec() +} /// Deserialize any DeserializeOwned type out of the guest from a guest pointer. pub fn from_guest_ptr( diff --git a/crates/host/src/host.rs b/crates/host/src/host.rs index 0a6610ba..58b76243 100644 --- a/crates/host/src/host.rs +++ b/crates/host/src/host.rs @@ -5,3 +5,4 @@ pub mod module; /// Updated for latest stable rust. pub mod plru; pub mod prelude; +pub mod store; diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index c22a2d5d..f0119e5a 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,6 +1,7 @@ pub use crate::env::Env; pub use crate::guest; pub use crate::module::MODULE_CACHE; +pub use crate::store::STORE; pub use holochain_serialized_bytes::prelude::*; pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; diff --git a/crates/host/src/store.rs b/crates/host/src/store.rs new file mode 100644 index 00000000..3da9fa76 --- /dev/null +++ b/crates/host/src/store.rs @@ -0,0 +1,19 @@ +use once_cell::sync::Lazy; +use std::sync::Arc; +use wasmer::wasmparser::Operator; +use wasmer::CompilerConfig; +use wasmer::Cranelift; +use wasmer::Store; +use wasmer_middlewares::Metering; + +const METERING_LIMIT: u64 = 10_000_000_000; + +pub static STORE: Lazy = Lazy::new(|| { + let const_function = |_operator: &Operator| -> u64 { 1 }; + let metering = Metering::new(METERING_LIMIT, const_function); + let mut cranelift = Cranelift::default(); + cranelift + .canonicalize_nans(true) + .push_middleware(Arc::new(metering)); + Store::new(cranelift) +}); diff --git a/test/Cargo.lock b/test/Cargo.lock index 5a949d26..54c6ade4 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -786,6 +786,7 @@ dependencies = [ "serde", "tracing", "wasmer", + "wasmer-middlewares", ] [[package]] diff --git a/test/src/import.rs b/test/src/import.rs index 50a19b51..4b8e0450 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -1,4 +1,5 @@ // use crate::debug; +use crate::err; use crate::pages; use crate::short_circuit; use crate::test_process_string; @@ -29,7 +30,7 @@ pub fn debug(_env: FunctionEnvMut, some_number: i32) -> i32 { /// let f = Function::new_typed_with_env(&mut store, &env, sum); /// ``` -pub fn imports(store: &mut impl AsStoreMut, env: FunctionEnv<()>) -> Imports { +pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { imports! { "env" => { // "__hc__short_circuit_5" => Function::new_typed_with_env( @@ -49,9 +50,14 @@ pub fn imports(store: &mut impl AsStoreMut, env: FunctionEnv<()>) -> Imports { // ), "__hc__debug_1" => Function::new_typed_with_env( store, - &FunctionEnv::new(&mut store, Env::default()), + &FunctionEnv::new(&mut store, env.clone()), debug ), + "__hc__guest_err_1" => Function::new_typed_with_env( + store, + &FunctionEnv::new(&mut store, env), + err + ), // "__hc__pages_1" => Function::new_typed_with_env( // store, // env.clone(), diff --git a/test/src/test.rs b/test/src/test.rs index 559778a3..d2e3e5dc 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -4,6 +4,7 @@ pub mod wasms; use holochain_wasmer_host::prelude::*; use test_common::SomeStruct; use wasmer::FunctionEnv; +use wasmer::FunctionEnvMut; pub fn short_circuit( env: FunctionEnv, @@ -42,6 +43,10 @@ pub fn debug(env: FunctionEnv, some_number: i32) -> i32 { 0 } +pub fn err(env: FunctionEnvMut) -> Result<(), wasmer::RuntimeError> { + Err(wasm_error!(WasmErrorInner::Guest("oh no!".into())).into()) +} + pub fn pages(env: FunctionEnv, _: WasmSize) -> Result { Ok(env .memory_ref() diff --git a/test/src/wasms.rs b/test/src/wasms.rs index f4098f60..203eab20 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -4,6 +4,9 @@ use holochain_wasmer_host::module::SERIALIZED_MODULE_CACHE; use holochain_wasmer_host::prelude::*; use parking_lot::Mutex; use std::sync::Arc; +use wasmer::wasmparser::Operator; +use wasmer::AsStoreMut; +use wasmer::CompilerConfig; use wasmer::Cranelift; use wasmer::Imports; use wasmer::Instance; @@ -111,9 +114,11 @@ impl TestWasm { pub fn _instance(&self, metered: bool) -> Arc> { let module = self.module(metered); - // let env = Env::default(); - let imports: Imports = imports(module.store()); - Arc::new(Mutex::new(Instance::new(&module, &imports).unwrap())) + let env = Env::default(); + let imports: Imports = imports(&mut STORE.as_store_mut(), env); + Arc::new(Mutex::new( + Instance::new(&mut STORE.as_store_mut(), &module, &imports).unwrap(), + )) } pub fn instance(&self) -> Arc> { From da267184da3f3a5badf1ee7f3d1409d4b9f2e0b8 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 3 Oct 2023 01:01:35 +0400 Subject: [PATCH 07/24] wip on 3 --- crates/host/src/env.rs | 90 ++++++++++++++++++++------------------ crates/host/src/module.rs | 34 ++++++++------ crates/host/src/prelude.rs | 2 +- crates/host/src/store.rs | 34 +++++++------- test/src/test.rs | 35 ++++++++++----- test/src/wasms.rs | 24 +++++----- 6 files changed, 122 insertions(+), 97 deletions(-) diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index e2a46cc5..4b710dc2 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -1,4 +1,4 @@ -// use std::num::TryFromIntError; +use std::num::TryFromIntError; use crate::guest::read_bytes; use crate::prelude::*; @@ -9,52 +9,56 @@ use wasmer::TypedFunction; // use wasmer::WasmerEnv; use wasmer::AsStoreMut; use wasmer::AsStoreRef; +use wasmer::StoreMut; use wasmer::Value; #[derive(Clone, Default)] pub struct Env { - memory: Option, - // allocate: Option>, - deallocate: Option>, + pub memory: Option, + pub allocate: Option>, + pub deallocate: Option>, } impl Env { - // /// Given some input I that can be serialized, request an allocation from the - // /// guest and copy the serialized bytes to the allocated pointer. The guest - // /// MUST subsequently take ownership of these bytes or it will leak memory. - // pub fn move_data_to_guest(&self, input: I) -> Result - // where - // I: serde::Serialize + std::fmt::Debug, - // { - // let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; - // let guest_ptr: GuestPtr = match self - // .allocate_ref() - // .ok_or(wasm_error!(WasmErrorInner::Memory))? - // .call(&[Value::I32( - // data.len() - // .try_into() - // .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, - // )]) - // .map_err(|e| wasm_error!(e.to_string()))? - // .get(0) - // { - // Some(Value::I32(guest_ptr)) => (*guest_ptr) - // .try_into() - // .map_err(|e: TryFromIntError| wasm_error!(e))?, - // _ => return Err(wasm_error!(WasmErrorInner::PointerMap).into()), - // }; - // let len: Len = match data.len().try_into() { - // Ok(len) => len, - // Err(e) => return Err(wasm_error!(e).into()), - // }; - // crate::guest::write_bytes( - // self.memory_ref() - // .ok_or(wasm_error!(WasmErrorInner::Memory))?, - // guest_ptr, - // &data, - // )?; - // Ok(merge_u32(guest_ptr, len)?) - // } + /// Given some input I that can be serialized, request an allocation from the + /// guest and copy the serialized bytes to the allocated pointer. The guest + /// MUST subsequently take ownership of these bytes or it will leak memory. + pub fn move_data_to_guest( + &self, + store_mut: &mut StoreMut, + input: I, + ) -> Result + where + I: serde::Serialize + std::fmt::Debug, + { + let data = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; + let guest_ptr: GuestPtr = self + .allocate + .as_ref() + .ok_or(wasm_error!(WasmErrorInner::Memory))? + .call( + store_mut, + data.len() + .try_into() + .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, + ) + .map_err(|e| wasm_error!(e.to_string()))? + .try_into() + .map_err(|e: TryFromIntError| wasm_error!(e))?; + let len: Len = match data.len().try_into() { + Ok(len) => len, + Err(e) => return Err(wasm_error!(e).into()), + }; + crate::guest::write_bytes( + store_mut, + self.memory + .as_ref() + .ok_or(wasm_error!(WasmErrorInner::Memory))?, + guest_ptr, + &data, + )?; + Ok(merge_u32(guest_ptr, len)?) + } /// Given a pointer and length for a region of memory in the guest, copy the /// bytes to the host and attempt to deserialize type `O` from the data. The @@ -62,6 +66,7 @@ impl Env { /// deserialization is successful. pub fn consume_bytes_from_guest( &self, + store_mut: &mut StoreMut, guest_ptr: GuestPtr, len: Len, ) -> Result @@ -73,17 +78,16 @@ impl Env { .memory .as_ref() .ok_or(wasm_error!(WasmErrorInner::Memory))? - .view(&STORE.as_store_ref()), + .view(&store_mut), guest_ptr, len, ) .map_err(|_| wasm_error!(WasmErrorInner::Memory))?; - let mut store_mut = STORE.as_store_mut(); self.deallocate .as_ref() .ok_or(wasm_error!(WasmErrorInner::Memory))? .call( - &mut store_mut, + store_mut, guest_ptr .try_into() .map_err(|_| wasm_error!(WasmErrorInner::PointerMap))?, diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index c5fc8a8f..f82ca8c3 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -156,7 +156,7 @@ impl SerializedModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result { + ) -> Result<(Store, Module), wasmer::RuntimeError> { let store = Store::new((self.cranelift)()); let module = Module::from_binary(&store, wasm) .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; @@ -164,19 +164,23 @@ impl SerializedModuleCache { .serialize() .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; self.put_item(key, Arc::new(serialized_module)); - Ok(module) + Ok((store, module)) } /// Given a wasm, attempts to get the serialized module for it from the cache. /// If the cache misses a new serialized module, will be built from the wasm. - pub fn get(&mut self, key: CacheKey, wasm: &[u8]) -> Result { + pub fn get( + &mut self, + key: CacheKey, + wasm: &[u8], + ) -> Result<(Store, Module), wasmer::RuntimeError> { match self.cache.get(&key) { Some(serialized_module) => { let store = Store::new((self.cranelift)()); let module = unsafe { Module::deserialize(&store, (**serialized_module).clone()) } .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; self.touch(&key); - Ok(module) + Ok((store, module)) } None => self.get_with_build_cache(key, wasm), } @@ -189,7 +193,7 @@ impl SerializedModuleCache { pub struct ModuleCache { plru: MicroCache, key_map: PlruKeyMap, - cache: BTreeMap>, + cache: BTreeMap, Module)>>, } pub static MODULE_CACHE: Lazy> = @@ -202,8 +206,8 @@ impl ModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result, wasmer::RuntimeError> { - let module = match SERIALIZED_MODULE_CACHE.get() { + ) -> Result, Module)>, wasmer::RuntimeError> { + let (store, module) = match SERIALIZED_MODULE_CACHE.get() { Some(serialized_module_cache) => serialized_module_cache.write().get(key, wasm)?, None => { return Err(wasmer::RuntimeError::user(Box::new(wasm_error!( @@ -211,22 +215,26 @@ impl ModuleCache { )))) } }; - Ok(self.put_item(key, Arc::new(module))) + Ok(self.put_item(key, Arc::new((Mutex::new(store), module)))) } /// Attempts to retrieve a module ready to build instances from. Builds a new /// module from the provided wasm and caches both the module and a serialized /// copy of the module if there is a miss. - pub fn get(&mut self, key: CacheKey, wasm: &[u8]) -> Result, wasmer::RuntimeError> { + pub fn get( + &mut self, + key: CacheKey, + wasm: &[u8], + ) -> Result, Module)>, wasmer::RuntimeError> { match self.get_item(&key) { - Some(module) => Ok(module), + Some(item) => Ok(item), None => self.get_with_build_cache(key, wasm), } } } impl PlruCache for ModuleCache { - type Item = Module; + type Item = (Mutex, Module); fn plru_mut(&mut self) -> &mut MicroCache { &mut self.plru @@ -257,13 +265,13 @@ impl PlruCache for ModuleCache { pub struct InstanceCache { plru: MicroCache, key_map: PlruKeyMap, - cache: BTreeMap>>, + cache: BTreeMap, Mutex)>>, } pub static INSTANCE_CACHE: Lazy> = Lazy::new(|| RwLock::new(InstanceCache::default())); impl PlruCache for InstanceCache { - type Item = Mutex; + type Item = (Mutex, Mutex); fn plru_mut(&mut self) -> &mut MicroCache { &mut self.plru diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index f0119e5a..0c3bc747 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,7 +1,7 @@ pub use crate::env::Env; pub use crate::guest; pub use crate::module::MODULE_CACHE; -pub use crate::store::STORE; +// pub use crate::store::STORE; pub use holochain_serialized_bytes::prelude::*; pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; diff --git a/crates/host/src/store.rs b/crates/host/src/store.rs index 3da9fa76..8dec8c9d 100644 --- a/crates/host/src/store.rs +++ b/crates/host/src/store.rs @@ -1,19 +1,19 @@ -use once_cell::sync::Lazy; -use std::sync::Arc; -use wasmer::wasmparser::Operator; -use wasmer::CompilerConfig; -use wasmer::Cranelift; -use wasmer::Store; -use wasmer_middlewares::Metering; +// use once_cell::sync::Lazy; +// use std::sync::Arc; +// use wasmer::wasmparser::Operator; +// use wasmer::CompilerConfig; +// use wasmer::Cranelift; +// use wasmer::Store; +// use wasmer_middlewares::Metering; -const METERING_LIMIT: u64 = 10_000_000_000; +// const METERING_LIMIT: u64 = 10_000_000_000; -pub static STORE: Lazy = Lazy::new(|| { - let const_function = |_operator: &Operator| -> u64 { 1 }; - let metering = Metering::new(METERING_LIMIT, const_function); - let mut cranelift = Cranelift::default(); - cranelift - .canonicalize_nans(true) - .push_middleware(Arc::new(metering)); - Store::new(cranelift) -}); +// pub static STORE: Lazy = Lazy::new(|| { +// let const_function = |_operator: &Operator| -> u64 { 1 }; +// let metering = Metering::new(METERING_LIMIT, const_function); +// let mut cranelift = Cranelift::default(); +// cranelift +// .canonicalize_nans(true) +// .push_middleware(Arc::new(metering)); +// Store::new(cranelift) +// }); diff --git a/test/src/test.rs b/test/src/test.rs index d2e3e5dc..3596676f 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -18,39 +18,52 @@ pub fn short_circuit( } pub fn test_process_string( - env: FunctionEnv, + function_env: FunctionEnvMut, guest_ptr: GuestPtr, len: Len, ) -> Result { - let string: String = env.consume_bytes_from_guest(guest_ptr, len)?; + let (env, store_mut) = function_env.data_and_store_mut(); + let string: String = env.consume_bytes_from_guest(&mut store_mut, guest_ptr, len)?; let processed_string = format!("host: {}", string); - env.move_data_to_guest(Ok::(processed_string)) + env.move_data_to_guest(&mut store_mut, Ok::(processed_string)) } pub fn test_process_struct( - env: FunctionEnv, + function_env: FunctionEnvMut, guest_ptr: GuestPtr, len: Len, ) -> Result { - let mut some_struct: SomeStruct = env.consume_bytes_from_guest(guest_ptr, len)?; + let (env, store_mut) = function_env.data_and_store_mut(); + let mut some_struct: SomeStruct = + env.consume_bytes_from_guest(&mut store_mut, guest_ptr, len)?; some_struct.process(); - env.move_data_to_guest(Ok::(some_struct)) + env.move_data_to_guest(&mut store_mut, Ok::(some_struct)) } -pub fn debug(env: FunctionEnv, some_number: i32) -> i32 { +pub fn debug( + function_env: FunctionEnvMut, + some_number: i32, +) -> Result<(), wasmer::RuntimeError> { + let (env, store_mut) = function_env.data_and_store_mut(); println!("debug {:?}", some_number); - // env.move_data_to_guest(()) - 0 + env.move_data_to_guest(&mut store_mut, ()); + Ok(()) } pub fn err(env: FunctionEnvMut) -> Result<(), wasmer::RuntimeError> { Err(wasm_error!(WasmErrorInner::Guest("oh no!".into())).into()) } -pub fn pages(env: FunctionEnv, _: WasmSize) -> Result { +pub fn pages( + function_env: FunctionEnvMut, + _: WasmSize, +) -> Result { + let (env, store_mut) = function_env.data_and_store_mut(); Ok(env - .memory_ref() + .memory + .as_ref() .ok_or(wasm_error!(WasmErrorInner::Memory))? + .view(&store_mut) .size() .0) } diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 203eab20..a1e09866 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -11,6 +11,7 @@ use wasmer::Cranelift; use wasmer::Imports; use wasmer::Instance; use wasmer::Module; +use wasmer::Store; use wasmer_middlewares::Metering; pub enum TestWasm { @@ -64,7 +65,7 @@ impl TestWasm { } } - pub fn module(&self, metered: bool) -> Arc { + pub fn module(&self, metered: bool) -> Arc<(Mutex, Module)> { match MODULE_CACHE.write().get(self.key(metered), self.bytes()) { Ok(v) => v, Err(runtime_error) => match runtime_error.downcast::() { @@ -97,14 +98,13 @@ impl TestWasm { )) .is_ok()); } - Arc::new( - SERIALIZED_MODULE_CACHE - .get() - .unwrap() - .write() - .get(self.key(metered), self.bytes()) - .unwrap(), - ) + let (store, module) = SERIALIZED_MODULE_CACHE + .get() + .unwrap() + .write() + .get(self.key(metered), self.bytes()) + .unwrap(); + Arc::new((Mutex::new(store), module)) } _ => unreachable!(), @@ -113,11 +113,11 @@ impl TestWasm { } pub fn _instance(&self, metered: bool) -> Arc> { - let module = self.module(metered); + let (store, module) = *self.module(metered); let env = Env::default(); - let imports: Imports = imports(&mut STORE.as_store_mut(), env); + let imports: Imports = imports(&mut store.get_mut().as_store_mut(), env); Arc::new(Mutex::new( - Instance::new(&mut STORE.as_store_mut(), &module, &imports).unwrap(), + Instance::new(&mut store.get_mut().as_store_mut(), &module, &imports).unwrap(), )) } From 20b6d5a1a6309d4bd44308e2510e2cd983824b57 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 3 Oct 2023 19:54:32 +0400 Subject: [PATCH 08/24] wip on 3 --- crates/host/src/env.rs | 6 +++--- test/Cargo.lock | 33 ++++----------------------------- test/Cargo.toml | 2 +- test/src/import.rs | 13 +++++++------ test/src/test.rs | 20 ++++++++++---------- test/src/wasms.rs | 5 +++-- test/test_wasm/Cargo.toml | 2 +- test/wasm_io/Cargo.toml | 2 +- test/wasm_memory/Cargo.toml | 2 +- 9 files changed, 31 insertions(+), 54 deletions(-) diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index 4b710dc2..a4565203 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -7,10 +7,10 @@ use crate::prelude::*; use wasmer::Memory; use wasmer::TypedFunction; // use wasmer::WasmerEnv; -use wasmer::AsStoreMut; -use wasmer::AsStoreRef; +// use wasmer::AsStoreMut; +// use wasmer::AsStoreRef; use wasmer::StoreMut; -use wasmer::Value; +// use wasmer::Value; #[derive(Clone, Default)] pub struct Env { diff --git a/test/Cargo.lock b/test/Cargo.lock index 54c6ade4..1506f81d 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -710,28 +710,13 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "holochain_serialized_bytes" -version = "0.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9805b3e01e7b5c144782a0823db4dc895fec18a9ccd45a492ce7c7bf157a9e38" -dependencies = [ - "holochain_serialized_bytes_derive 0.0.51", - "rmp-serde", - "serde", - "serde-transcode", - "serde_bytes", - "serde_json", - "thiserror", -] - [[package]] name = "holochain_serialized_bytes" version = "0.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f7a5fc7c745a107f8ebcb04caab7a6b7a8463e2811f07ced19c281977583de7" dependencies = [ - "holochain_serialized_bytes_derive 0.0.53", + "holochain_serialized_bytes_derive", "rmp-serde", "serde", "serde-transcode", @@ -740,16 +725,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "holochain_serialized_bytes_derive" -version = "0.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1077232d0c427d64feb9e138fa22800e447eafb1810682d6c13beb95333cb32c" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "holochain_serialized_bytes_derive" version = "0.0.53" @@ -764,7 +739,7 @@ dependencies = [ name = "holochain_wasmer_common" version = "0.0.85" dependencies = [ - "holochain_serialized_bytes 0.0.53", + "holochain_serialized_bytes", "serde", "serde_bytes", "test-fuzz", @@ -778,7 +753,7 @@ version = "0.0.85" dependencies = [ "bimap", "bytes", - "holochain_serialized_bytes 0.0.53", + "holochain_serialized_bytes", "holochain_wasmer_common", "once_cell", "parking_lot", @@ -1561,7 +1536,7 @@ dependencies = [ "criterion", "ctor", "env_logger", - "holochain_serialized_bytes 0.0.51", + "holochain_serialized_bytes", "holochain_wasmer_common", "holochain_wasmer_host", "parking_lot", diff --git a/test/Cargo.toml b/test/Cargo.toml index 5b3fcba3..4a3c5e25 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] holochain_wasmer_common = { path = "../crates/common", features = []} holochain_wasmer_host = { path = "../crates/host" } -holochain_serialized_bytes = "=0.0.51" +holochain_serialized_bytes = "=0.0.53" serde = "1" test_common = { path = "./common" } criterion = "0.3" diff --git a/test/src/import.rs b/test/src/import.rs index 4b8e0450..0e897ba1 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -1,9 +1,9 @@ // use crate::debug; use crate::err; -use crate::pages; -use crate::short_circuit; -use crate::test_process_string; -use crate::test_process_struct; +// use crate::pages; +// use crate::short_circuit; +// use crate::test_process_string; +// use crate::test_process_struct; use holochain_wasmer_host::prelude::*; use wasmer::imports; use wasmer::AsStoreMut; @@ -31,6 +31,7 @@ pub fn debug(_env: FunctionEnvMut, some_number: i32) -> i32 { /// ``` pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { + let function_env = FunctionEnv::new(store, env); imports! { "env" => { // "__hc__short_circuit_5" => Function::new_typed_with_env( @@ -50,12 +51,12 @@ pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { // ), "__hc__debug_1" => Function::new_typed_with_env( store, - &FunctionEnv::new(&mut store, env.clone()), + &function_env, debug ), "__hc__guest_err_1" => Function::new_typed_with_env( store, - &FunctionEnv::new(&mut store, env), + &function_env, err ), // "__hc__pages_1" => Function::new_typed_with_env( diff --git a/test/src/test.rs b/test/src/test.rs index 3596676f..9699ff83 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -3,11 +3,11 @@ pub mod wasms; use holochain_wasmer_host::prelude::*; use test_common::SomeStruct; -use wasmer::FunctionEnv; +// use wasmer::FunctionEnv; use wasmer::FunctionEnvMut; pub fn short_circuit( - env: FunctionEnv, + _env: FunctionEnvMut, _: GuestPtr, _: Len, ) -> Result { @@ -18,22 +18,22 @@ pub fn short_circuit( } pub fn test_process_string( - function_env: FunctionEnvMut, + mut function_env: FunctionEnvMut, guest_ptr: GuestPtr, len: Len, ) -> Result { - let (env, store_mut) = function_env.data_and_store_mut(); + let (env, mut store_mut) = function_env.data_and_store_mut(); let string: String = env.consume_bytes_from_guest(&mut store_mut, guest_ptr, len)?; let processed_string = format!("host: {}", string); env.move_data_to_guest(&mut store_mut, Ok::(processed_string)) } pub fn test_process_struct( - function_env: FunctionEnvMut, + mut function_env: FunctionEnvMut, guest_ptr: GuestPtr, len: Len, ) -> Result { - let (env, store_mut) = function_env.data_and_store_mut(); + let (env, mut store_mut) = function_env.data_and_store_mut(); let mut some_struct: SomeStruct = env.consume_bytes_from_guest(&mut store_mut, guest_ptr, len)?; some_struct.process(); @@ -41,21 +41,21 @@ pub fn test_process_struct( } pub fn debug( - function_env: FunctionEnvMut, + mut function_env: FunctionEnvMut, some_number: i32, ) -> Result<(), wasmer::RuntimeError> { - let (env, store_mut) = function_env.data_and_store_mut(); + let (env, mut store_mut) = function_env.data_and_store_mut(); println!("debug {:?}", some_number); env.move_data_to_guest(&mut store_mut, ()); Ok(()) } -pub fn err(env: FunctionEnvMut) -> Result<(), wasmer::RuntimeError> { +pub fn err(_: FunctionEnvMut) -> Result<(), wasmer::RuntimeError> { Err(wasm_error!(WasmErrorInner::Guest("oh no!".into())).into()) } pub fn pages( - function_env: FunctionEnvMut, + mut function_env: FunctionEnvMut, _: WasmSize, ) -> Result { let (env, store_mut) = function_env.data_and_store_mut(); diff --git a/test/src/wasms.rs b/test/src/wasms.rs index a1e09866..952d2836 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -114,10 +114,11 @@ impl TestWasm { pub fn _instance(&self, metered: bool) -> Arc> { let (store, module) = *self.module(metered); + let mut store = store.get_mut(); let env = Env::default(); - let imports: Imports = imports(&mut store.get_mut().as_store_mut(), env); + let imports: Imports = imports(&mut store.as_store_mut(), env); Arc::new(Mutex::new( - Instance::new(&mut store.get_mut().as_store_mut(), &module, &imports).unwrap(), + Instance::new(&mut store.as_store_mut(), &module, &imports).unwrap(), )) } diff --git a/test/test_wasm/Cargo.toml b/test/test_wasm/Cargo.toml index 9dc2e6e8..72af9985 100644 --- a/test/test_wasm/Cargo.toml +++ b/test/test_wasm/Cargo.toml @@ -12,5 +12,5 @@ path = "src/wasm.rs" [dependencies] holochain_wasmer_guest = { path = "../../crates/guest" } test_common = { path = "../common" } -holochain_serialized_bytes = "=0.0.51" +holochain_serialized_bytes = "=0.0.53" serde = "1" diff --git a/test/wasm_io/Cargo.toml b/test/wasm_io/Cargo.toml index f32cea54..5d713216 100644 --- a/test/wasm_io/Cargo.toml +++ b/test/wasm_io/Cargo.toml @@ -12,6 +12,6 @@ path = "src/wasm.rs" [dependencies] holochain_wasmer_guest = { path = "../../crates/guest" } test_common = { path = "../common" } -holochain_serialized_bytes = "=0.0.51" +holochain_serialized_bytes = "=0.0.53" paste = "0.1" serde = "1" diff --git a/test/wasm_memory/Cargo.toml b/test/wasm_memory/Cargo.toml index bd4d1c1e..88faa0e1 100644 --- a/test/wasm_memory/Cargo.toml +++ b/test/wasm_memory/Cargo.toml @@ -12,6 +12,6 @@ path = "src/wasm.rs" [dependencies] holochain_wasmer_guest = { path = "../../crates/guest" } test_common = { path = "../common" } -holochain_serialized_bytes = "=0.0.51" +holochain_serialized_bytes = "=0.0.53" paste = "0.1" serde = "1" From 0c24bb2b96d424f0585d9249db1db1fb0ecf73b8 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 3 Oct 2023 22:48:23 +0400 Subject: [PATCH 09/24] wip on 3 --- crates/host/src/module.rs | 42 ++++++++++++++++++++--------- test/src/import.rs | 56 +++++++++++++++++---------------------- test/src/test.rs | 2 +- test/src/wasms.rs | 36 ++++++++++++++----------- 4 files changed, 77 insertions(+), 59 deletions(-) diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index f82ca8c3..e82830bd 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -23,6 +23,18 @@ pub type PlruKeyMap = BiMap; /// Modules serialize to a vec of bytes as per wasmer. pub type SerializedModule = Bytes; +#[derive(Clone)] +pub struct ModuleWithStore { + pub module: Arc, + pub store: Arc>, +} + +#[derive(Clone)] +pub struct InstanceWithStore { + pub instance: Arc>, + pub store: Arc>, +} + /// Higher level trait over the plru cache to make it a bit easier to interact /// with consistently. Default implementations for key functions are provided. /// Notably handles keeping the mapping between cache keys and items, and the @@ -156,7 +168,7 @@ impl SerializedModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result<(Store, Module), wasmer::RuntimeError> { + ) -> Result, wasmer::RuntimeError> { let store = Store::new((self.cranelift)()); let module = Module::from_binary(&store, wasm) .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; @@ -164,7 +176,10 @@ impl SerializedModuleCache { .serialize() .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; self.put_item(key, Arc::new(serialized_module)); - Ok((store, module)) + Ok(Arc::new(ModuleWithStore { + store: Arc::new(Mutex::new(store)), + module: Arc::new(module), + })) } /// Given a wasm, attempts to get the serialized module for it from the cache. @@ -173,14 +188,17 @@ impl SerializedModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result<(Store, Module), wasmer::RuntimeError> { + ) -> Result, wasmer::RuntimeError> { match self.cache.get(&key) { Some(serialized_module) => { let store = Store::new((self.cranelift)()); let module = unsafe { Module::deserialize(&store, (**serialized_module).clone()) } .map_err(|e| wasm_error!(WasmErrorInner::Compile(e.to_string())))?; self.touch(&key); - Ok((store, module)) + Ok(Arc::new(ModuleWithStore { + store: Arc::new(Mutex::new(store)), + module: Arc::new(module), + })) } None => self.get_with_build_cache(key, wasm), } @@ -193,7 +211,7 @@ impl SerializedModuleCache { pub struct ModuleCache { plru: MicroCache, key_map: PlruKeyMap, - cache: BTreeMap, Module)>>, + cache: BTreeMap>, } pub static MODULE_CACHE: Lazy> = @@ -206,8 +224,8 @@ impl ModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result, Module)>, wasmer::RuntimeError> { - let (store, module) = match SERIALIZED_MODULE_CACHE.get() { + ) -> Result, wasmer::RuntimeError> { + let module_with_store = match SERIALIZED_MODULE_CACHE.get() { Some(serialized_module_cache) => serialized_module_cache.write().get(key, wasm)?, None => { return Err(wasmer::RuntimeError::user(Box::new(wasm_error!( @@ -215,7 +233,7 @@ impl ModuleCache { )))) } }; - Ok(self.put_item(key, Arc::new((Mutex::new(store), module)))) + Ok(self.put_item(key, module_with_store)) } /// Attempts to retrieve a module ready to build instances from. Builds a new @@ -225,7 +243,7 @@ impl ModuleCache { &mut self, key: CacheKey, wasm: &[u8], - ) -> Result, Module)>, wasmer::RuntimeError> { + ) -> Result, wasmer::RuntimeError> { match self.get_item(&key) { Some(item) => Ok(item), None => self.get_with_build_cache(key, wasm), @@ -234,7 +252,7 @@ impl ModuleCache { } impl PlruCache for ModuleCache { - type Item = (Mutex, Module); + type Item = ModuleWithStore; fn plru_mut(&mut self) -> &mut MicroCache { &mut self.plru @@ -265,13 +283,13 @@ impl PlruCache for ModuleCache { pub struct InstanceCache { plru: MicroCache, key_map: PlruKeyMap, - cache: BTreeMap, Mutex)>>, + cache: BTreeMap>, } pub static INSTANCE_CACHE: Lazy> = Lazy::new(|| RwLock::new(InstanceCache::default())); impl PlruCache for InstanceCache { - type Item = (Mutex, Mutex); + type Item = InstanceWithStore; fn plru_mut(&mut self) -> &mut MicroCache { &mut self.plru diff --git a/test/src/import.rs b/test/src/import.rs index 0e897ba1..f7fcdf0a 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -1,9 +1,9 @@ -// use crate::debug; +use crate::debug; use crate::err; -// use crate::pages; -// use crate::short_circuit; -// use crate::test_process_string; -// use crate::test_process_struct; +use crate::pages; +use crate::short_circuit; +use crate::test_process_string; +use crate::test_process_struct; use holochain_wasmer_host::prelude::*; use wasmer::imports; use wasmer::AsStoreMut; @@ -12,12 +12,6 @@ use wasmer::FunctionEnv; use wasmer::FunctionEnvMut; use wasmer::Imports; -pub fn debug(_env: FunctionEnvMut, some_number: i32) -> i32 { - println!("debug {:?}", some_number); - // env.move_data_to_guest(()) - 0 -} - /// ``` /// # use wasmer::{Store, Function, FunctionEnv, FunctionEnvMut}; /// # let mut store = Store::default(); @@ -34,21 +28,21 @@ pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { let function_env = FunctionEnv::new(store, env); imports! { "env" => { - // "__hc__short_circuit_5" => Function::new_typed_with_env( - // store, - // env.clone(), - // short_circuit - // ), - // "__hc__test_process_string_2" => Function::new_typed_with_env( - // store, - // env.clone(), - // test_process_string - // ), - // "__hc__test_process_struct_2" => Function::new_typed_with_env( - // store, - // env.clone(), - // test_process_struct - // ), + "__hc__short_circuit_5" => Function::new_typed_with_env( + store, + &function_env, + short_circuit + ), + "__hc__test_process_string_2" => Function::new_typed_with_env( + store, + &function_env, + test_process_string + ), + "__hc__test_process_struct_2" => Function::new_typed_with_env( + store, + &function_env, + test_process_struct + ), "__hc__debug_1" => Function::new_typed_with_env( store, &function_env, @@ -59,11 +53,11 @@ pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { &function_env, err ), - // "__hc__pages_1" => Function::new_typed_with_env( - // store, - // env.clone(), - // pages - // ), + "__hc__pages_1" => Function::new_typed_with_env( + store, + &function_env, + pages + ), }, } } diff --git a/test/src/test.rs b/test/src/test.rs index 9699ff83..a9689a23 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -46,7 +46,7 @@ pub fn debug( ) -> Result<(), wasmer::RuntimeError> { let (env, mut store_mut) = function_env.data_and_store_mut(); println!("debug {:?}", some_number); - env.move_data_to_guest(&mut store_mut, ()); + env.move_data_to_guest(&mut store_mut, ())?; Ok(()) } diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 952d2836..406b5942 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -1,4 +1,6 @@ use crate::import::imports; +use holochain_wasmer_host::module::InstanceWithStore; +use holochain_wasmer_host::module::ModuleWithStore; use holochain_wasmer_host::module::SerializedModuleCache; use holochain_wasmer_host::module::SERIALIZED_MODULE_CACHE; use holochain_wasmer_host::prelude::*; @@ -10,8 +12,6 @@ use wasmer::CompilerConfig; use wasmer::Cranelift; use wasmer::Imports; use wasmer::Instance; -use wasmer::Module; -use wasmer::Store; use wasmer_middlewares::Metering; pub enum TestWasm { @@ -65,7 +65,7 @@ impl TestWasm { } } - pub fn module(&self, metered: bool) -> Arc<(Mutex, Module)> { + pub fn module(&self, metered: bool) -> Arc { match MODULE_CACHE.write().get(self.key(metered), self.bytes()) { Ok(v) => v, Err(runtime_error) => match runtime_error.downcast::() { @@ -98,13 +98,12 @@ impl TestWasm { )) .is_ok()); } - let (store, module) = SERIALIZED_MODULE_CACHE + SERIALIZED_MODULE_CACHE .get() .unwrap() .write() .get(self.key(metered), self.bytes()) - .unwrap(); - Arc::new((Mutex::new(store), module)) + .unwrap() } _ => unreachable!(), @@ -112,21 +111,28 @@ impl TestWasm { } } - pub fn _instance(&self, metered: bool) -> Arc> { - let (store, module) = *self.module(metered); - let mut store = store.get_mut(); + pub fn _instance(&self, metered: bool) -> InstanceWithStore { + let ModuleWithStore { store, module } = (*self.module(metered)).clone(); + // let mut store = store.get_mut(); let env = Env::default(); - let imports: Imports = imports(&mut store.as_store_mut(), env); - Arc::new(Mutex::new( - Instance::new(&mut store.as_store_mut(), &module, &imports).unwrap(), - )) + let built_imports: Imports; + { + let mut store_lock = store.lock(); + built_imports = imports(&mut store_lock.as_store_mut(), env); + } + { + let mut store_lock = store.lock(); + Arc::new(Mutex::new( + Instance::new(&mut store_lock.as_store_mut(), &module, &built_imports).unwrap(), + )) + } } - pub fn instance(&self) -> Arc> { + pub fn instance(&self) -> InstanceWithStore { self._instance(true) } - pub fn unmetered_instance(&self) -> Arc> { + pub fn unmetered_instance(&self) -> InstanceWithStore { self._instance(false) } } From 69b84d6fa1c7709afb9b11ed4241375e421249a7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 4 Oct 2023 00:28:37 +0400 Subject: [PATCH 10/24] tests passing 3 --- crates/host/src/guest.rs | 39 +++++++----- crates/host/src/module.rs | 4 +- test/src/import.rs | 17 +++--- test/src/test.rs | 122 +++++++++++++++++++++++++++++++------- test/src/wasms.rs | 55 +++++++++++++---- 5 files changed, 177 insertions(+), 60 deletions(-) diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index 225137c9..db72e32a 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -2,11 +2,13 @@ use crate::prelude::*; use core::num::TryFromIntError; use holochain_serialized_bytes::prelude::*; // use parking_lot::Mutex; -// use std::sync::Arc; -use wasmer::AsStoreMut; +use std::sync::Arc; +// use wasmer::AsStoreMut; use wasmer::Instance; use wasmer::Memory; use wasmer::MemoryView; +// use wasmer::Store; +use wasmer::StoreMut; use wasmer::Value; use wasmer::WasmSlice; @@ -54,7 +56,7 @@ use wasmer::WasmSlice; /// /// @see read_bytes() pub fn write_bytes( - store: &impl AsStoreMut, + store_mut: &mut StoreMut, memory: &Memory, guest_ptr: GuestPtr, slice: &[u8], @@ -66,7 +68,9 @@ pub fn write_bytes( #[cfg(feature = "debug_memory")] tracing::debug!("writing bytes from host to guest at: {} {}", guest_ptr, len); - WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.write_slice(slice)?; + WasmSlice::new(&memory.view(store_mut), guest_ptr.into(), len.into())?.write_slice(slice)?; + + // WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.write_slice(slice)?; // let ptr: WasmPtr = WasmPtr::new(guest_ptr); // // Write the length prefix immediately before the slice at the guest pointer position. @@ -113,7 +117,7 @@ pub fn read_bytes( /// Deserialize any DeserializeOwned type out of the guest from a guest pointer. pub fn from_guest_ptr( - store: &impl AsStoreMut, + store_mut: &mut StoreMut, memory: &Memory, guest_ptr: GuestPtr, len: Len, @@ -121,8 +125,9 @@ pub fn from_guest_ptr( where O: serde::de::DeserializeOwned + std::fmt::Debug, { - // let bytes = read_bytes(memory, guest_ptr, len)?; - let bytes = WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.read_to_vec()?; + let bytes = + WasmSlice::new(&memory.view(store_mut), guest_ptr.into(), len.into())?.read_to_vec()?; + match holochain_serialized_bytes::decode(&bytes) { Ok(v) => Ok(v), Err(e) => { @@ -136,9 +141,8 @@ where /// result is either a vector of bytes from the guest found at the location of the returned guest /// allocation pointer or a `RuntimeError` built from a `WasmError`. pub fn call( - store: &mut impl AsStoreMut, - // instance: Arc>, - instance: Instance, + store_mut: &mut StoreMut, + instance: Arc, f: &str, input: I, ) -> Result @@ -157,11 +161,12 @@ where .try_into() .map_err(|e: TryFromIntError| wasm_error!(WasmErrorInner::CallError(e.to_string())))?; let guest_input_length_value: Value = Value::I32(guest_input_length); + let (guest_input_ptr, guest_input_ptr_value) = match instance .exports .get_function("__hc__allocate_1") .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? - .call(store, &[guest_input_length_value.clone()]) + .call(store_mut, &[guest_input_length_value.clone()]) .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? .get(0) { @@ -183,7 +188,7 @@ where // Write the input payload into the guest at the offset specified by the allocation. write_bytes( - store, + store_mut, instance .exports .get_memory("memory") @@ -198,8 +203,10 @@ where .exports .get_function(f) .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? - .call(store, &[guest_input_ptr_value, guest_input_length_value]) - { + .call( + store_mut, + &[guest_input_ptr_value, guest_input_length_value], + ) { Ok(v) => match v.get(0) { Some(Value::I64(i)) => { let u: GuestPtrLen = (*i) @@ -235,7 +242,7 @@ where // The host MUST discard any wasm instance that errors at this point to avoid memory leaks. // The WasmError in the result type here is for deserializing out of the guest. let return_value: Result = from_guest_ptr( - store, + store_mut, instance .exports .get_memory("memory") @@ -250,7 +257,7 @@ where .get_function("__hc__deallocate_1") .map_err(|e| wasm_error!(WasmErrorInner::CallError(e.to_string())))? .call( - store, + store_mut, &[ Value::I32( guest_return_ptr diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index e82830bd..f071000f 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -25,14 +25,14 @@ pub type SerializedModule = Bytes; #[derive(Clone)] pub struct ModuleWithStore { - pub module: Arc, pub store: Arc>, + pub module: Arc, } #[derive(Clone)] pub struct InstanceWithStore { - pub instance: Arc>, pub store: Arc>, + pub instance: Arc, } /// Higher level trait over the plru cache to make it a bit easier to interact diff --git a/test/src/import.rs b/test/src/import.rs index f7fcdf0a..dfcb3644 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -9,8 +9,8 @@ use wasmer::imports; use wasmer::AsStoreMut; use wasmer::Function; use wasmer::FunctionEnv; -use wasmer::FunctionEnvMut; use wasmer::Imports; +use wasmer::StoreMut; /// ``` /// # use wasmer::{Store, Function, FunctionEnv, FunctionEnvMut}; @@ -24,38 +24,37 @@ use wasmer::Imports; /// let f = Function::new_typed_with_env(&mut store, &env, sum); /// ``` -pub fn imports(store: &mut impl AsStoreMut, env: Env) -> Imports { - let function_env = FunctionEnv::new(store, env); +pub fn imports(store: &mut StoreMut, function_env: &FunctionEnv) -> Imports { imports! { "env" => { "__hc__short_circuit_5" => Function::new_typed_with_env( store, - &function_env, + function_env, short_circuit ), "__hc__test_process_string_2" => Function::new_typed_with_env( store, - &function_env, + function_env, test_process_string ), "__hc__test_process_struct_2" => Function::new_typed_with_env( store, - &function_env, + function_env, test_process_struct ), "__hc__debug_1" => Function::new_typed_with_env( store, - &function_env, + function_env, debug ), "__hc__guest_err_1" => Function::new_typed_with_env( store, - &function_env, + function_env, err ), "__hc__pages_1" => Function::new_typed_with_env( store, - &function_env, + function_env, pages ), }, diff --git a/test/src/test.rs b/test/src/test.rs index a9689a23..b5d0ca5f 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -72,7 +72,10 @@ pub fn pages( pub mod tests { use super::*; use crate::wasms; + use holochain_wasmer_host::module::InstanceWithStore; + use holochain_wasmer_host::module::ModuleWithStore; use test_common::StringType; + use wasmer::AsStoreMut; use wasms::TestWasm; #[ctor::ctor] @@ -82,7 +85,7 @@ pub mod tests { #[test] fn host_externs_toolable() { - let module = TestWasm::Test.module(false); + let ModuleWithStore { module, .. } = (*TestWasm::Test.module(false)).clone(); // Imports will be the minimal set of functions actually used by the wasm // NOT the complete list defined by `host_externs!`. assert_eq!( @@ -102,20 +105,35 @@ pub mod tests { fn infinite_loop() { // Instead of looping forever we want the metering to kick in and trap // the execution into an unreachable error. - let result: Result<(), _> = guest::call(TestWasm::Test.instance(), "loop_forever", ()); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: Result<(), _> = guest::call( + &mut store.lock().as_store_mut(), + instance, + "loop_forever", + (), + ); assert!(result.is_err()); } #[test] fn short_circuit() { - let result: String = guest::call(TestWasm::Test.instance(), "short_circuit", ()).unwrap(); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: String = guest::call( + &mut store.lock().as_store_mut(), + instance, + "short_circuit", + (), + ) + .unwrap(); assert_eq!(result, String::from("shorts")); } #[test] fn bytes_round_trip() { + let InstanceWithStore { store, instance } = TestWasm::Memory.instance(); let _: () = dbg!(guest::call( - TestWasm::Memory.instance(), + &mut store.lock().as_store_mut(), + instance, "bytes_round_trip", () )) @@ -124,8 +142,14 @@ pub mod tests { #[test] fn stacked_test() { - let result: String = guest::call(TestWasm::Test.instance(), "stacked_strings", ()) - .expect("stacked strings call"); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: String = guest::call( + &mut store.lock().as_store_mut(), + instance, + "stacked_strings", + (), + ) + .expect("stacked strings call"); assert_eq!("first", &result); } @@ -133,16 +157,23 @@ pub mod tests { #[test] fn literal_bytes() { let input: Vec = vec![1, 2, 3]; - let result: Vec = - guest::call(TestWasm::Test.instance(), "literal_bytes", input.clone()) - .expect("literal_bytes call"); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: Vec = guest::call( + &mut store.lock().as_store_mut(), + instance, + "literal_bytes", + input.clone(), + ) + .expect("literal_bytes call"); assert_eq!(input, result); } #[test] fn ignore_args_process_string_test() { + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); let result: StringType = guest::call( - TestWasm::Test.instance(), + &mut store.lock().as_store_mut(), + instance, "ignore_args_process_string", &StringType::from(String::new()), ) @@ -154,8 +185,10 @@ pub mod tests { #[cfg(not(target_os = "windows"))] #[test_fuzz::test_fuzz] fn process_string_fuzz(s: String) { + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); let result: StringType = guest::call( - TestWasm::Test.instance(), + &mut store.lock().as_store_mut(), + instance, "process_string", &StringType::from(s.clone()), ) @@ -172,8 +205,10 @@ pub mod tests { // and utf-8 are both working OK let starter_string = "╰▐ ✖ 〜 ✖ ▐╯" .repeat(usize::try_from(10_u32 * u32::try_from(std::u16::MAX).unwrap()).unwrap()); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); let result: StringType = guest::call( - TestWasm::Test.instance(), + &mut store.lock().as_store_mut(), + instance, "process_string", // This is by reference just to show that it can be done as borrowed or owned. &StringType::from(starter_string.clone()), @@ -190,8 +225,11 @@ pub mod tests { let some_inner = "foo"; let some_struct = SomeStruct::new(some_inner.into()); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: SomeStruct = guest::call( - TestWasm::Test.instance(), + &mut store.lock().as_store_mut(), + instance, "native_type", some_struct.clone(), ) @@ -205,8 +243,11 @@ pub mod tests { let some_inner = "foo"; let some_struct = SomeStruct::new(some_inner.into()); + let InstanceWithStore { store, instance } = TestWasm::Test.instance(); + let result: SomeStruct = guest::call( - TestWasm::Test.instance(), + &mut store.lock().as_store_mut(), + instance, "process_native", some_struct.clone(), ) @@ -218,12 +259,31 @@ pub mod tests { #[test] fn ret_test() { - let some_struct: SomeStruct = - guest::call(TestWasm::Test.instance(), "some_ret", ()).unwrap(); + let InstanceWithStore { + store: store_foo, + instance: instance_foo, + } = TestWasm::Test.instance(); + + let some_struct: SomeStruct = guest::call( + &mut store_foo.lock().as_store_mut(), + instance_foo, + "some_ret", + (), + ) + .unwrap(); assert_eq!(SomeStruct::new("foo".into()), some_struct,); - let err: Result = - guest::call(TestWasm::Test.instance(), "some_ret_err", ()); + let InstanceWithStore { + store: store_ret_err, + instance: instance_ret_err, + } = TestWasm::Test.instance(); + + let err: Result = guest::call( + &mut store_ret_err.lock().as_store_mut(), + instance_ret_err, + "some_ret_err", + (), + ); match err { Err(runtime_error) => assert_eq!( WasmError { @@ -239,13 +299,31 @@ pub mod tests { #[test] fn try_ptr_test() { - let success_result: Result = - guest::call(TestWasm::Test.instance(), "try_ptr_succeeds", ()).unwrap(); + let InstanceWithStore { + store: store_succeed, + instance: instance_succeed, + } = TestWasm::Test.instance(); + + let success_result: Result = guest::call( + &mut store_succeed.lock().as_store_mut(), + instance_succeed, + "try_ptr_succeeds", + (), + ) + .unwrap(); assert_eq!(SomeStruct::new("foo".into()), success_result.unwrap()); - let fail_result: Result<(), wasmer::RuntimeError> = - guest::call(TestWasm::Test.instance(), "try_ptr_fails_fast", ()); + let InstanceWithStore { + store: store_fail, + instance: instance_fail, + } = TestWasm::Test.instance(); + let fail_result: Result<(), wasmer::RuntimeError> = guest::call( + &mut store_fail.lock().as_store_mut(), + instance_fail, + "try_ptr_fails_fast", + (), + ); match fail_result { Err(runtime_error) => { assert_eq!( diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 406b5942..648a7bb7 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -4,12 +4,13 @@ use holochain_wasmer_host::module::ModuleWithStore; use holochain_wasmer_host::module::SerializedModuleCache; use holochain_wasmer_host::module::SERIALIZED_MODULE_CACHE; use holochain_wasmer_host::prelude::*; -use parking_lot::Mutex; +// use parking_lot::Mutex; use std::sync::Arc; use wasmer::wasmparser::Operator; use wasmer::AsStoreMut; use wasmer::CompilerConfig; use wasmer::Cranelift; +use wasmer::FunctionEnv; use wasmer::Imports; use wasmer::Instance; use wasmer_middlewares::Metering; @@ -112,19 +113,51 @@ impl TestWasm { } pub fn _instance(&self, metered: bool) -> InstanceWithStore { - let ModuleWithStore { store, module } = (*self.module(metered)).clone(); - // let mut store = store.get_mut(); - let env = Env::default(); - let built_imports: Imports; + let module_with_store = self.module(metered); + let function_env; + let instance; { - let mut store_lock = store.lock(); - built_imports = imports(&mut store_lock.as_store_mut(), env); + let mut store_lock = module_with_store.store.lock(); + let mut store_mut = store_lock.as_store_mut(); + function_env = FunctionEnv::new(&mut store_mut, Env::default()); + let built_imports: Imports = imports(&mut store_mut, &function_env); + instance = + Instance::new(&mut store_mut, &module_with_store.module, &built_imports).unwrap(); } + { - let mut store_lock = store.lock(); - Arc::new(Mutex::new( - Instance::new(&mut store_lock.as_store_mut(), &module, &built_imports).unwrap(), - )) + let mut store_lock = module_with_store.store.lock(); + let mut function_env_mut = function_env.into_mut(&mut store_lock); + let (mut data_mut, mut store_mut) = function_env_mut.data_and_store_mut(); + data_mut.memory = Some(instance.exports.get_memory("memory").unwrap().clone()); + data_mut.deallocate = Some( + instance + .exports + .get_typed_function(&mut store_mut, "__hc__deallocate_1") + .unwrap(), + ); + data_mut.allocate = Some( + instance + .exports + .get_typed_function(&mut store_mut, "__hc__allocate_1") + .unwrap(), + ); + } + + // let mut store_mut = (*module_with_store.store).lock().as_store_mut(); + // let ModuleWithStore { store, module } = (*self.module(metered)).clone(); + // let mut store = store.get_mut(); + // let env = Env::default(); + // let mut store_mut; + // { + // let mut store_lock = *store.lock(); + // store_mut = store_lock.as_store_mut(); + // } + // let mut store_mut = (*store).lock().as_store_mut(); + + InstanceWithStore { + store: module_with_store.store.clone(), + instance: Arc::new(instance), } } From 004fec5198da10e7dc1e752d55fd0632b91d856b Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 00:06:02 +0400 Subject: [PATCH 11/24] bump rust --- flake.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index b65e9bd7..fe873382 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ "crate2nix": { "flake": false, "locked": { - "lastModified": 1675642992, - "narHash": "sha256-uDBDZuiq7qyg82Udp82/r4zg5HKfIzBQqgl2U9THiQM=", + "lastModified": 1693149153, + "narHash": "sha256-HUszQcnIal1FFRAWraODDbxTp0HECwczRTD+Zf0v9o0=", "owner": "kolloch", "repo": "crate2nix", - "rev": "45fc83132c8c91c77a1cd61fe0c945411d1edba8", + "rev": "8749f46953b46d44fd181b002399e4a20371f323", "type": "github" }, "original": { @@ -175,16 +175,16 @@ "holochain": { "flake": false, "locked": { - "lastModified": 1692750860, - "narHash": "sha256-6p1AbM390044BiiVbZREEbOosFOkPnRxiuA2Xko+89I=", + "lastModified": 1696380813, + "narHash": "sha256-C8lw4tShiaAQ00dAtP2t/m6NxQtYtE1J4giFP3/F0tA=", "owner": "holochain", "repo": "holochain", - "rev": "e0b5e3ef2d0cfb5e446335428b63d4e57e43fd51", + "rev": "a9df0d68a0ddc85822e54368575bc0397ec7049a", "type": "github" }, "original": { "owner": "holochain", - "ref": "holochain-0.3.0-beta-dev.15", + "ref": "holochain-0.3.0-beta-dev.20", "repo": "holochain", "type": "github" } @@ -224,11 +224,11 @@ ] }, "locked": { - "lastModified": 1693421895, - "narHash": "sha256-hQpaccN0Hn4AAZM3zLzqkCjjC3o/i6so9RLF426fvsE=", + "lastModified": 1696728050, + "narHash": "sha256-xZURYSNnZ4AIVBH4c1qQ4uyNC+r7LF9fP8/Y0akNq8s=", "owner": "holochain", "repo": "holochain", - "rev": "997962fc9246e33643ee33cfc1fc44db21afb53e", + "rev": "4993778514717dc4dcdf86d42c409935b7c0cdaf", "type": "github" }, "original": { @@ -288,11 +288,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1686869522, - "narHash": "sha256-tbJ9B8WLCTnVP/LwESRlg0dII6Zyg2LmUU/mB9Lu98E=", + "lastModified": 1696604326, + "narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7c67f006ea0e7d0265f16d7df07cc076fdffd91f", + "rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64", "type": "github" }, "original": { @@ -393,11 +393,11 @@ ] }, "locked": { - "lastModified": 1693361441, - "narHash": "sha256-TRFdMQj9wSKMduNqe/1xF8TzcPWEdcn/hKWcVcZ5fO8=", + "lastModified": 1696644659, + "narHash": "sha256-l/DgT519At8HhXDQHz3+H8AjaEbrsb7Xkqgj+JNHV6k=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1fb2aa49635e9f30b6fa211ab7c454f7175e1ba3", + "rev": "126829788e99c188be4eeb805f144d73d8a00f2c", "type": "github" }, "original": { @@ -409,11 +409,11 @@ "scaffolding": { "flake": false, "locked": { - "lastModified": 1692147670, - "narHash": "sha256-jFt4LTUaUZTiOg2DLlbUqyeV2edfUxiJSljRjVJlObE=", + "lastModified": 1695674679, + "narHash": "sha256-IwgQbgitUo61ZXYSXBAro5ThfYy/yMGmzZGTb3c6sT0=", "owner": "holochain", "repo": "scaffolding", - "rev": "8a63d356a0856643769adc567e078796c6509511", + "rev": "821439b8dd49d5ce594be04c4720df25e88a4dbc", "type": "github" }, "original": { @@ -447,11 +447,11 @@ }, "locked": { "dir": "versions/weekly", - "lastModified": 1693421895, - "narHash": "sha256-hQpaccN0Hn4AAZM3zLzqkCjjC3o/i6so9RLF426fvsE=", + "lastModified": 1696728050, + "narHash": "sha256-xZURYSNnZ4AIVBH4c1qQ4uyNC+r7LF9fP8/Y0akNq8s=", "owner": "holochain", "repo": "holochain", - "rev": "997962fc9246e33643ee33cfc1fc44db21afb53e", + "rev": "4993778514717dc4dcdf86d42c409935b7c0cdaf", "type": "github" }, "original": { From 9f9085a4f6d0ee764bdc2dd5bb6cbeceefaf334e Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 00:09:07 +0400 Subject: [PATCH 12/24] wip on wasmer 4 --- crates/common/Cargo.toml | 2 +- crates/host/Cargo.toml | 4 ++-- test/Cargo.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index bc41fb20..0c8b3da4 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -18,4 +18,4 @@ default = [] error_as_host = [] [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -wasmer = "=3.3.0" +wasmer = "=4.2.2" diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index b9fa69b5..bfdbbcc8 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -7,8 +7,8 @@ authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" [dependencies] -wasmer = "=3.3.0" -wasmer-middlewares = "=3.3.0" +wasmer = "=4.2.2" +wasmer-middlewares = "=4.2.2" holochain_wasmer_common = { version = "=0.0.85", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" diff --git a/test/Cargo.toml b/test/Cargo.toml index 4a3c5e25..03e34b0a 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -14,8 +14,8 @@ criterion = "0.3" rand = "0.8" serde_bytes = "0.11" parking_lot = "0.12" -wasmer = "=3.3.0" -wasmer-middlewares = "=3.3.0" +wasmer = "=4.2.2" +wasmer-middlewares = "=4.2.2" test-fuzz = "=3.0.4" [dev-dependencies] From 9ea5bbe35218371942383590157a5b4aa40b9abc Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 00:27:05 +0400 Subject: [PATCH 13/24] wasmer 4 --- test/Cargo.lock | 643 ++++++++++++++++++++----------------- test/src/import.rs | 1 - test/src/wasms.rs | 18 +- test/wasm_empty/Cargo.lock | 582 +++++++++++++++++++-------------- 4 files changed, 695 insertions(+), 549 deletions(-) diff --git a/test/Cargo.lock b/test/Cargo.lock index 1506f81d..307ce343 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -4,11 +4,11 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.0", + "gimli 0.28.0", ] [[package]] @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -49,7 +49,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", "winapi", ] @@ -62,9 +62,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "bimap" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bincode" @@ -110,30 +110,18 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -154,14 +142,14 @@ checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -171,31 +159,31 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "camino" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982a0cf6a99c350d7246035613882e376d58cebe571785abc5da4f648d53ac0a" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -209,9 +197,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -232,22 +223,22 @@ dependencies = [ [[package]] name = "corosensei" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.33.0", ] [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -306,7 +297,7 @@ dependencies = [ "cranelift-entity", "fxhash", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "log", "smallvec", ] @@ -372,44 +363,44 @@ dependencies = [ ] [[package]] -name = "crossbeam-channel" -version = "0.5.6" +name = "crossbeam-deque" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", + "crossbeam-epoch", "crossbeam-utils", ] [[package]] -name = "crossbeam-deque" -version = "0.8.2" +name = "crossbeam-epoch" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ + "autocfg", "cfg-if", - "crossbeam-epoch", "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.13" +name = "crossbeam-queue" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ - "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -426,22 +417,21 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.6" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa", "ryu", "serde", ] [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" dependencies = [ "memchr", ] @@ -453,42 +443,76 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", ] [[package]] name = "darling" -version = "0.14.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] name = "darling_core" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.38", ] [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core", + "darling_core 0.14.4", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.38", ] [[package]] @@ -498,7 +522,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "lock_api", "once_cell", "parking_lot_core", @@ -512,14 +536,14 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -527,9 +551,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enum-iterator" @@ -548,28 +572,28 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "enumset" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" +checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.6.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -585,6 +609,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -623,9 +653,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -633,9 +663,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -649,15 +679,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "half" @@ -676,15 +706,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -695,15 +725,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - [[package]] name = "hex" version = "0.4.3" @@ -732,7 +753,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3e0cf02005cbf0f514476d40e02125b26df6d4922d7a2c48a84fc588539d71" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -766,11 +787,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -803,14 +824,24 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + [[package]] name = "itertools" version = "0.10.5" @@ -822,21 +853,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -855,9 +880,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "lock_api" @@ -871,12 +896,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mach" @@ -889,26 +911,26 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] [[package]] -name = "memoffset" -version = "0.7.1" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -920,11 +942,20 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -937,28 +968,18 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - [[package]] name = "object" -version = "0.30.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1000,9 +1021,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" @@ -1012,25 +1033,26 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.5.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "plotters" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -1041,15 +1063,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] @@ -1069,7 +1091,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1086,9 +1108,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -1110,14 +1132,14 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1160,9 +1182,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -1170,14 +1192,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -1203,26 +1223,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", + "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "region" @@ -1254,7 +1280,7 @@ dependencies = [ "bitvec", "bytecheck", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", @@ -1271,14 +1297,14 @@ checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "rmp" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", "num-traits", @@ -1298,21 +1324,21 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -1325,9 +1351,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "seahash" @@ -1335,6 +1361,12 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "self_cell" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c309e515543e67811222dbc9e3dd7e1056279b782e1dacffe4242b718734fb6" + [[package]] name = "semver" version = "0.11.0" @@ -1346,9 +1378,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -1364,9 +1396,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -1393,9 +1425,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.8" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] @@ -1412,23 +1444,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "indexmap", - "itoa 1.0.5", + "indexmap 2.0.2", + "itoa", "ryu", "serde", ] @@ -1444,6 +1476,16 @@ dependencies = [ "digest", ] +[[package]] +name = "shared-buffer" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf61602ee61e2f83dd016b3e6387245291cf728ea071c378b35088125b4d995" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "simdutf8" version = "0.1.4" @@ -1458,9 +1500,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "stable_deref_trait" @@ -1484,7 +1526,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -1499,9 +1541,20 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -1516,15 +1569,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.5" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "termcolor" -version = "1.1.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -1580,13 +1633,13 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "856bbca0314c328004691b9c0639fb198ca764d1ce0e20d4dd8b78f2697c2a6f" dependencies = [ - "darling", + "darling 0.14.4", "if_chain", "lazy_static", "proc-macro2", "quote", "subprocess", - "syn", + "syn 1.0.109", "test-fuzz-internal", "toolchain_find", "unzip-n", @@ -1626,22 +1679,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -1696,35 +1749,35 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicode-bidi" @@ -1734,9 +1787,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1749,9 +1802,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unzip-n" @@ -1761,7 +1814,7 @@ checksum = "c2e7e85a0596447f0f2ac090e16bc4c516c6fe91771fb0c0ccf7fa3dae896b9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1789,12 +1842,11 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1806,9 +1858,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1816,16 +1868,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -1849,14 +1901,14 @@ checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1864,47 +1916,48 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-encoder" -version = "0.20.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05632e0a66a6ed8cca593c24223aabd6262f256c3693ad9822c315285f010614" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasmer" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" +checksum = "0e626f958755a90a6552b9528f59b58a62ae288e6c17fcf40e99495bc33c60f0" dependencies = [ "bytes", "cfg-if", "derivative", - "indexmap", + "indexmap 1.9.3", "js-sys", "more-asserts", "rustc-demangle", "serde", "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", "wasm-bindgen", @@ -1920,19 +1973,23 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" +checksum = "848e1922694cf97f4df680a0534c9d72c836378b5eb2313c1708fe1a75b40044" dependencies = [ "backtrace", + "bytes", "cfg-if", "enum-iterator", "enumset", "lazy_static", "leb128", - "memmap2", + "memmap2 0.5.10", "more-asserts", "region", + "rkyv", + "self_cell", + "shared-buffer", "smallvec", "thiserror", "wasmer-types", @@ -1943,9 +2000,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" +checksum = "3d96bce6fad15a954edcfc2749b59e47ea7de524b6ef3df392035636491a40b4" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1962,21 +2019,21 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" +checksum = "7f08f80d166a9279671b7af7a09409c28ede2e0b4e3acabbf0e3cb22c8038ba7" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "wasmer-middlewares" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e028013811035111beb768074b6ccc09eabd77811b1e01fd099b5471924ca16" +checksum = "eeb4b87c0ea9f8636c81a8ab8f52bad01c8623c9fcbb3db5f367d5f157fada30" dependencies = [ "wasmer", "wasmer-types", @@ -1985,14 +2042,14 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" +checksum = "ae2c892882f0b416783fb4310e5697f5c30587f6f9555f9d4f2be85ab39d5d3d" dependencies = [ "bytecheck", "enum-iterator", "enumset", - "indexmap", + "indexmap 1.9.3", "more-asserts", "rkyv", "target-lexicon", @@ -2001,19 +2058,20 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" +checksum = "7c0a9a57b627fb39e5a491058d4365f099bc9b140031c000fded24a3306d9480" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "crossbeam-queue", "dashmap", "derivative", "enum-iterator", "fnv", - "indexmap", + "indexmap 1.9.3", "lazy_static", "libc", "mach", @@ -2032,15 +2090,15 @@ version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] [[package]] name = "wast" -version = "50.0.0" +version = "66.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2cbb59d4ac799842791fe7e806fa5dbbf6b5554d538e51cc8e176db6ff0ae34" +checksum = "0da7529bb848d58ab8bf32230fc065b363baee2bd338d5e58c589a1e7d83ad07" dependencies = [ "leb128", "memchr", @@ -2050,18 +2108,18 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.52" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "584aaf7a1ecf4d383bbe1a25eeab0cbb8ff96acc6796707ff65cde48f4632f15" +checksum = "4780374047c65b6b6e86019093fe80c18b66825eb684df778a4e068282a780e7" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -2085,9 +2143,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2111,6 +2169,15 @@ dependencies = [ "windows_x86_64_msvc 0.33.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.48.5" diff --git a/test/src/import.rs b/test/src/import.rs index dfcb3644..adcabb47 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -6,7 +6,6 @@ use crate::test_process_string; use crate::test_process_struct; use holochain_wasmer_host::prelude::*; use wasmer::imports; -use wasmer::AsStoreMut; use wasmer::Function; use wasmer::FunctionEnv; use wasmer::Imports; diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 648a7bb7..f38c55cd 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -4,7 +4,6 @@ use holochain_wasmer_host::module::ModuleWithStore; use holochain_wasmer_host::module::SerializedModuleCache; use holochain_wasmer_host::module::SERIALIZED_MODULE_CACHE; use holochain_wasmer_host::prelude::*; -// use parking_lot::Mutex; use std::sync::Arc; use wasmer::wasmparser::Operator; use wasmer::AsStoreMut; @@ -128,33 +127,22 @@ impl TestWasm { { let mut store_lock = module_with_store.store.lock(); let mut function_env_mut = function_env.into_mut(&mut store_lock); - let (mut data_mut, mut store_mut) = function_env_mut.data_and_store_mut(); + let (data_mut, store_mut) = function_env_mut.data_and_store_mut(); data_mut.memory = Some(instance.exports.get_memory("memory").unwrap().clone()); data_mut.deallocate = Some( instance .exports - .get_typed_function(&mut store_mut, "__hc__deallocate_1") + .get_typed_function(&store_mut, "__hc__deallocate_1") .unwrap(), ); data_mut.allocate = Some( instance .exports - .get_typed_function(&mut store_mut, "__hc__allocate_1") + .get_typed_function(&store_mut, "__hc__allocate_1") .unwrap(), ); } - // let mut store_mut = (*module_with_store.store).lock().as_store_mut(); - // let ModuleWithStore { store, module } = (*self.module(metered)).clone(); - // let mut store = store.get_mut(); - // let env = Env::default(); - // let mut store_mut; - // { - // let mut store_lock = *store.lock(); - // store_mut = store_lock.as_store_mut(); - // } - // let mut store_mut = (*store).lock().as_store_mut(); - InstanceWithStore { store: module_with_store.store.clone(), instance: Arc::new(instance), diff --git a/test/wasm_empty/Cargo.lock b/test/wasm_empty/Cargo.lock index 5ddff29d..5a18158b 100644 --- a/test/wasm_empty/Cargo.lock +++ b/test/wasm_empty/Cargo.lock @@ -4,11 +4,11 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.0", + "gimli 0.28.0", ] [[package]] @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -51,9 +51,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -93,18 +93,18 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -125,14 +125,14 @@ checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -142,31 +142,31 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "camino" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982a0cf6a99c350d7246035613882e376d58cebe571785abc5da4f648d53ac0a" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -174,9 +174,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -186,22 +189,22 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.33.0", ] [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -260,7 +263,7 @@ dependencies = [ "cranelift-entity", "fxhash", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "log", "smallvec", ] @@ -290,44 +293,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" [[package]] -name = "crossbeam-channel" -version = "0.5.6" +name = "crossbeam-deque" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", + "crossbeam-epoch", "crossbeam-utils", ] [[package]] -name = "crossbeam-deque" -version = "0.8.2" +name = "crossbeam-epoch" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ + "autocfg", "cfg-if", - "crossbeam-epoch", "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.13" +name = "crossbeam-queue" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ - "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -344,37 +347,71 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.2" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] name = "darling_core" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core", + "darling_core 0.20.3", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -384,7 +421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "lock_api", "once_cell", "parking_lot_core", @@ -398,14 +435,14 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -413,9 +450,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enum-iterator" @@ -434,30 +471,36 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "enumset" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" +checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.6.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -496,9 +539,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -506,9 +549,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -522,15 +565,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "hashbrown" @@ -543,24 +586,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.2.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hex" @@ -590,7 +624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3e0cf02005cbf0f514476d40e02125b26df6d4922d7a2c48a84fc588539d71" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -619,11 +653,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -650,25 +684,35 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -687,9 +731,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "lock_api" @@ -703,12 +747,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mach" @@ -721,26 +762,26 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] [[package]] -name = "memoffset" -version = "0.7.1" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -752,11 +793,20 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -769,28 +819,18 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.30.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -826,9 +866,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" @@ -838,19 +878,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.5.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "proc-macro-error" @@ -861,7 +902,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -878,9 +919,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -902,14 +943,14 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -922,9 +963,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rayon" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -932,14 +973,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -965,9 +1004,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -976,9 +1027,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "region" @@ -1010,7 +1061,7 @@ dependencies = [ "bitvec", "bytecheck", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", @@ -1027,14 +1078,14 @@ checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "rmp" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", "num-traits", @@ -1054,21 +1105,21 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -1081,9 +1132,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "seahash" @@ -1091,6 +1142,12 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "self_cell" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c309e515543e67811222dbc9e3dd7e1056279b782e1dacffe4242b718734fb6" + [[package]] name = "semver" version = "0.11.0" @@ -1102,9 +1159,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -1120,9 +1177,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -1149,31 +1206,31 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.8" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "indexmap", + "indexmap 2.0.2", "itoa", "ryu", "serde", @@ -1190,6 +1247,16 @@ dependencies = [ "digest", ] +[[package]] +name = "shared-buffer" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf61602ee61e2f83dd016b3e6387245291cf728ea071c378b35088125b4d995" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "simdutf8" version = "0.1.4" @@ -1204,9 +1271,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "stable_deref_trait" @@ -1230,7 +1297,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -1245,9 +1312,20 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -1262,9 +1340,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.5" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "test-fuzz" @@ -1297,13 +1375,13 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "856bbca0314c328004691b9c0639fb198ca764d1ce0e20d4dd8b78f2697c2a6f" dependencies = [ - "darling", + "darling 0.14.4", "if_chain", "lazy_static", "proc-macro2", "quote", "subprocess", - "syn", + "syn 1.0.109", "test-fuzz-internal", "toolchain_find", "unzip-n", @@ -1332,22 +1410,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -1392,35 +1470,35 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicode-bidi" @@ -1430,9 +1508,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1445,9 +1523,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unzip-n" @@ -1457,7 +1535,7 @@ checksum = "c2e7e85a0596447f0f2ac090e16bc4c516c6fe91771fb0c0ccf7fa3dae896b9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1485,12 +1563,11 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1502,9 +1579,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1512,16 +1589,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -1545,14 +1622,14 @@ checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1560,47 +1637,48 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-encoder" -version = "0.20.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05632e0a66a6ed8cca593c24223aabd6262f256c3693ad9822c315285f010614" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasmer" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" +checksum = "0e626f958755a90a6552b9528f59b58a62ae288e6c17fcf40e99495bc33c60f0" dependencies = [ "bytes", "cfg-if", "derivative", - "indexmap", + "indexmap 1.9.3", "js-sys", "more-asserts", "rustc-demangle", "serde", "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", "wasm-bindgen", @@ -1616,19 +1694,23 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" +checksum = "848e1922694cf97f4df680a0534c9d72c836378b5eb2313c1708fe1a75b40044" dependencies = [ "backtrace", + "bytes", "cfg-if", "enum-iterator", "enumset", "lazy_static", "leb128", - "memmap2", + "memmap2 0.5.10", "more-asserts", "region", + "rkyv", + "self_cell", + "shared-buffer", "smallvec", "thiserror", "wasmer-types", @@ -1639,9 +1721,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" +checksum = "3d96bce6fad15a954edcfc2749b59e47ea7de524b6ef3df392035636491a40b4" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1658,26 +1740,26 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" +checksum = "7f08f80d166a9279671b7af7a09409c28ede2e0b4e3acabbf0e3cb22c8038ba7" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "wasmer-types" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" +checksum = "ae2c892882f0b416783fb4310e5697f5c30587f6f9555f9d4f2be85ab39d5d3d" dependencies = [ "bytecheck", "enum-iterator", "enumset", - "indexmap", + "indexmap 1.9.3", "more-asserts", "rkyv", "target-lexicon", @@ -1686,19 +1768,20 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" +checksum = "7c0a9a57b627fb39e5a491058d4365f099bc9b140031c000fded24a3306d9480" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "crossbeam-queue", "dashmap", "derivative", "enum-iterator", "fnv", - "indexmap", + "indexmap 1.9.3", "lazy_static", "libc", "mach", @@ -1717,15 +1800,15 @@ version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] [[package]] name = "wast" -version = "50.0.0" +version = "66.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2cbb59d4ac799842791fe7e806fa5dbbf6b5554d538e51cc8e176db6ff0ae34" +checksum = "0da7529bb848d58ab8bf32230fc065b363baee2bd338d5e58c589a1e7d83ad07" dependencies = [ "leb128", "memchr", @@ -1735,9 +1818,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.52" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "584aaf7a1ecf4d383bbe1a25eeab0cbb8ff96acc6796707ff65cde48f4632f15" +checksum = "4780374047c65b6b6e86019093fe80c18b66825eb684df778a4e068282a780e7" dependencies = [ "wast", ] @@ -1760,9 +1843,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1786,6 +1869,15 @@ dependencies = [ "windows_x86_64_msvc 0.33.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.48.5" From aedde053c5065b1d7dacb3d7f3f810623c7b5eea Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 04:04:24 +0400 Subject: [PATCH 14/24] lint --- crates/host/src/env.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index a4565203..0004796f 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -2,15 +2,9 @@ use std::num::TryFromIntError; use crate::guest::read_bytes; use crate::prelude::*; -// use wasmer::Function; -// use wasmer::LazyInit; use wasmer::Memory; use wasmer::TypedFunction; -// use wasmer::WasmerEnv; -// use wasmer::AsStoreMut; -// use wasmer::AsStoreRef; use wasmer::StoreMut; -// use wasmer::Value; #[derive(Clone, Default)] pub struct Env { From ac43e67102f0d6e5d6537fdf889c39c4dc4ce806 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 04:14:12 +0400 Subject: [PATCH 15/24] lint --- crates/host/src/guest.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index db72e32a..c5d5807d 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -1,13 +1,10 @@ use crate::prelude::*; use core::num::TryFromIntError; use holochain_serialized_bytes::prelude::*; -// use parking_lot::Mutex; use std::sync::Arc; -// use wasmer::AsStoreMut; use wasmer::Instance; use wasmer::Memory; use wasmer::MemoryView; -// use wasmer::Store; use wasmer::StoreMut; use wasmer::Value; use wasmer::WasmSlice; From 66318e1cedb73e477055de207d4fa00b41140e91 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 04:14:52 +0400 Subject: [PATCH 16/24] lint --- crates/host/src/guest.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index c5d5807d..d41c9b21 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -67,18 +67,6 @@ pub fn write_bytes( WasmSlice::new(&memory.view(store_mut), guest_ptr.into(), len.into())?.write_slice(slice)?; - // WasmSlice::new(&memory.view(store), guest_ptr.into(), len.into())?.write_slice(slice)?; - - // let ptr: WasmPtr = WasmPtr::new(guest_ptr); - // // Write the length prefix immediately before the slice at the guest pointer position. - // for (byte, cell) in slice.iter().zip( - // ptr.deref(memory, 0, len) - // .ok_or(wasm_error!(WasmErrorInner::Memory))? - // .iter(), - // ) { - // cell.set(*byte) - // } - Ok(()) } From 09fba795e24e9ba11bfcb421847c634e35796f99 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 9 Oct 2023 04:27:00 +0400 Subject: [PATCH 17/24] lint --- crates/host/src/guest.rs | 1 - crates/host/src/module.rs | 1 - crates/host/src/prelude.rs | 3 --- crates/host/src/store.rs | 19 ------------------- test/src/import.rs | 12 ------------ test/src/test.rs | 1 - 6 files changed, 37 deletions(-) delete mode 100644 crates/host/src/store.rs diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index d41c9b21..9c6e205b 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -135,7 +135,6 @@ where I: serde::Serialize + std::fmt::Debug, O: serde::de::DeserializeOwned + std::fmt::Debug, { - // let instance = instance.lock(); // The guest will use the same crate for decoding if it uses the wasm common crate. let payload: Vec = holochain_serialized_bytes::encode(&input).map_err(|e| wasm_error!(e))?; diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index f071000f..11ad442a 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -11,7 +11,6 @@ use wasmer::Cranelift; use wasmer::Instance; use wasmer::Module; use wasmer::Store; -// use wasmer::Universal; use bytes::Bytes; /// We expect cache keys to be produced via hashing so 32 bytes is enough for all diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index 0c3bc747..b25ce795 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,10 +1,7 @@ pub use crate::env::Env; pub use crate::guest; pub use crate::module::MODULE_CACHE; -// pub use crate::store::STORE; pub use holochain_serialized_bytes::prelude::*; pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; pub use parking_lot::Mutex; -// pub use wasmer::WasmerEnv; -// pub use wasmer::*; diff --git a/crates/host/src/store.rs b/crates/host/src/store.rs deleted file mode 100644 index 8dec8c9d..00000000 --- a/crates/host/src/store.rs +++ /dev/null @@ -1,19 +0,0 @@ -// use once_cell::sync::Lazy; -// use std::sync::Arc; -// use wasmer::wasmparser::Operator; -// use wasmer::CompilerConfig; -// use wasmer::Cranelift; -// use wasmer::Store; -// use wasmer_middlewares::Metering; - -// const METERING_LIMIT: u64 = 10_000_000_000; - -// pub static STORE: Lazy = Lazy::new(|| { -// let const_function = |_operator: &Operator| -> u64 { 1 }; -// let metering = Metering::new(METERING_LIMIT, const_function); -// let mut cranelift = Cranelift::default(); -// cranelift -// .canonicalize_nans(true) -// .push_middleware(Arc::new(metering)); -// Store::new(cranelift) -// }); diff --git a/test/src/import.rs b/test/src/import.rs index adcabb47..cba757cd 100644 --- a/test/src/import.rs +++ b/test/src/import.rs @@ -11,18 +11,6 @@ use wasmer::FunctionEnv; use wasmer::Imports; use wasmer::StoreMut; -/// ``` -/// # use wasmer::{Store, Function, FunctionEnv, FunctionEnvMut}; -/// # let mut store = Store::default(); -/// # let env = FunctionEnv::new(&mut store, ()); -/// # -/// fn sum(_env: FunctionEnvMut<()>, a: i32, b: i32) -> i32 { -/// a + b -/// } -/// -/// let f = Function::new_typed_with_env(&mut store, &env, sum); -/// ``` - pub fn imports(store: &mut StoreMut, function_env: &FunctionEnv) -> Imports { imports! { "env" => { diff --git a/test/src/test.rs b/test/src/test.rs index b5d0ca5f..52bf57a6 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -3,7 +3,6 @@ pub mod wasms; use holochain_wasmer_host::prelude::*; use test_common::SomeStruct; -// use wasmer::FunctionEnv; use wasmer::FunctionEnvMut; pub fn short_circuit( From fcd20e363f0e157d4181b6fcff7cf9f9ef7f7312 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 11 Oct 2023 12:58:22 +0400 Subject: [PATCH 18/24] fix/ignore tests --- crates/host/src/env.rs | 2 +- crates/host/src/host.rs | 1 - crates/host/src/module.rs | 2 +- test/src/test.rs | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/host/src/env.rs b/crates/host/src/env.rs index 0004796f..27d233a2 100644 --- a/crates/host/src/env.rs +++ b/crates/host/src/env.rs @@ -3,8 +3,8 @@ use std::num::TryFromIntError; use crate::guest::read_bytes; use crate::prelude::*; use wasmer::Memory; -use wasmer::TypedFunction; use wasmer::StoreMut; +use wasmer::TypedFunction; #[derive(Clone, Default)] pub struct Env { diff --git a/crates/host/src/host.rs b/crates/host/src/host.rs index 58b76243..0a6610ba 100644 --- a/crates/host/src/host.rs +++ b/crates/host/src/host.rs @@ -5,4 +5,3 @@ pub mod module; /// Updated for latest stable rust. pub mod plru; pub mod prelude; -pub mod store; diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index 11ad442a..8060f094 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -1,6 +1,7 @@ use crate::plru::MicroCache; use crate::prelude::*; use bimap::BiMap; +use bytes::Bytes; use holochain_wasmer_common::WasmError; use once_cell::sync::{Lazy, OnceCell}; use parking_lot::Mutex; @@ -11,7 +12,6 @@ use wasmer::Cranelift; use wasmer::Instance; use wasmer::Module; use wasmer::Store; -use bytes::Bytes; /// We expect cache keys to be produced via hashing so 32 bytes is enough for all /// purposes. diff --git a/test/src/test.rs b/test/src/test.rs index 52bf57a6..f87bd734 100644 --- a/test/src/test.rs +++ b/test/src/test.rs @@ -100,7 +100,9 @@ pub mod tests { ); } + // Reinstate this test when metering is working. #[test] + #[ignore] fn infinite_loop() { // Instead of looping forever we want the metering to kick in and trap // the execution into an unreachable error. From a31f6f16ade8c24a398c8140d9e8d3888ca5eaa2 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 11 Oct 2023 16:27:49 +0400 Subject: [PATCH 19/24] wip on fixing benchmarks --- crates/host/src/guest.rs | 3 ++ test/Cargo.toml | 2 +- test/benches/bench.rs | 92 +++++++++++++++++-------------------- test/src/wasms.rs | 11 ++++- test/wasm_empty/src/wasm.rs | 2 + 5 files changed, 57 insertions(+), 53 deletions(-) diff --git a/crates/host/src/guest.rs b/crates/host/src/guest.rs index 9c6e205b..a31ffa71 100644 --- a/crates/host/src/guest.rs +++ b/crates/host/src/guest.rs @@ -125,6 +125,9 @@ where /// Host calling guest for the function named `call` with the given `payload` in a vector of bytes /// result is either a vector of bytes from the guest found at the location of the returned guest /// allocation pointer or a `RuntimeError` built from a `WasmError`. +/// The reason that this takes a separate store and instance is that the host does not neccessarily +/// have access to an InstanceWithStore, such as the case when the guest is called from within a +/// host function call. pub fn call( store_mut: &mut StoreMut, instance: Arc, diff --git a/test/Cargo.toml b/test/Cargo.toml index 03e34b0a..6dc8aaf5 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -10,7 +10,7 @@ holochain_wasmer_host = { path = "../crates/host" } holochain_serialized_bytes = "=0.0.53" serde = "1" test_common = { path = "./common" } -criterion = "0.3" +criterion = { version = "0.3", features = ["html_reports"] } rand = "0.8" serde_bytes = "0.11" parking_lot = "0.12" diff --git a/test/benches/bench.rs b/test/benches/bench.rs index 224836b5..448bc374 100644 --- a/test/benches/bench.rs +++ b/test/benches/bench.rs @@ -3,8 +3,8 @@ use criterion::Throughput; use criterion::{criterion_group, criterion_main, Criterion}; use holochain_wasmer_host::prelude::*; use rand::prelude::*; -use std::sync::Arc; use test::wasms::TestWasm; +use wasmer::AsStoreMut; /// create a module pub fn wasm_module(c: &mut Criterion) { @@ -38,38 +38,7 @@ pub fn wasm_instance(c: &mut Criterion) { ] { group.bench_function(BenchmarkId::new("wasm_instance", wasm.name()), |b| { b.iter(|| { - let module = wasm.module(false); - let env = Env::default(); - let import_object: wasmer::ImportObject = imports! { - "env" => { - "__hc__short_circuit_5" => Function::new_native_with_env( - module.store(), - env.clone(), - test::short_circuit - ), - "__hc__test_process_string_2" => Function::new_native_with_env( - module.store(), - env.clone(), - test::test_process_string - ), - "__hc__test_process_struct_2" => Function::new_native_with_env( - module.store(), - env.clone(), - test::test_process_struct - ), - "__hc__debug_1" => Function::new_native_with_env( - module.store(), - env.clone(), - test::debug - ), - "__hc__pages_1" => Function::new_native_with_env( - module.store(), - env.clone(), - test::pages - ), - }, - }; - let _ = wasmer::Instance::new(&module, &import_object).unwrap(); + wasm.unmetered_instance(); }); }); } @@ -81,7 +50,7 @@ pub fn wasm_instance(c: &mut Criterion) { pub fn wasm_call(c: &mut Criterion) { let mut group = c.benchmark_group("wasm_call"); - let instance = TestWasm::Io.unmetered_instance(); + let instance_with_store = TestWasm::Io.unmetered_instance(); macro_rules! bench_call { ( $fs:expr; $t:tt; $n:ident; $build:expr; ) => { @@ -100,8 +69,12 @@ pub fn wasm_call(c: &mut Criterion) { &$n, |b, _| { b.iter(|| { + let instance = instance_with_store.instance.clone(); + let mut store_lock = instance_with_store.store.lock(); + let mut store_mut = store_lock.as_store_mut(); let _drop: test_common::$t = holochain_wasmer_host::guest::call( - Arc::clone(&instance), + &mut store_mut, + instance, f, &input, ) @@ -143,7 +116,7 @@ pub fn wasm_call(c: &mut Criterion) { pub fn wasm_call_n(c: &mut Criterion) { let mut group = c.benchmark_group("wasm_call_n"); - let instance = TestWasm::Io.instance(); + let instance_with_store = TestWasm::Io.instance(); macro_rules! bench_n { ( $fs:expr; $t:ty; ) => { @@ -161,12 +134,19 @@ pub fn wasm_call_n(c: &mut Criterion) { &n, |b, _| { b.iter(|| { - let _: $t = holochain_wasmer_host::guest::call( - Arc::clone(&instance), - f, - test_common::IntegerType::from(n), - ) - .expect("failed deserialize"); + let instance = instance_with_store.instance.clone(); + let store = instance_with_store.store.clone(); + { + let mut store_lock = store.lock(); + let mut store_mut = store_lock.as_store_mut(); + let _: $t = holochain_wasmer_host::guest::call( + &mut store_mut, + instance, + f, + test_common::IntegerType::from(n), + ) + .expect("failed deserialize"); + } }); }, ); @@ -185,7 +165,7 @@ pub fn wasm_call_n(c: &mut Criterion) { pub fn test_process_string(c: &mut Criterion) { let mut group = c.benchmark_group("test_process_string"); - let instance = TestWasm::Test.instance(); + let instance_with_store = TestWasm::Test.instance(); for n in vec![0, 1, 1_000, 1_000_000] { group.throughput(Throughput::Bytes(n)); @@ -193,12 +173,19 @@ pub fn test_process_string(c: &mut Criterion) { let input = test_common::StringType::from(".".repeat(n.try_into().unwrap())); group.bench_with_input(BenchmarkId::new("test_process_string", n), &n, |b, _| { b.iter(|| { - let _: test_common::StringType = holochain_wasmer_host::guest::call( - Arc::clone(&instance), - "process_string", - &input, - ) - .unwrap(); + let instance = instance_with_store.instance.clone(); + let store = instance_with_store.store.clone(); + { + let mut store_lock = store.lock(); + let mut store_mut = store_lock.as_store_mut(); + let _drop: test_common::StringType = holochain_wasmer_host::guest::call( + &mut store_mut, + instance, + "process_string", + &input, + ) + .unwrap(); + } }); }); } @@ -216,10 +203,13 @@ pub fn test_instances(c: &mut Criterion) { let mut jhs = Vec::new(); for _ in 0..25 { let input = input.clone(); - let instance = TestWasm::Test.instance(); + let instance_with_store = TestWasm::Test.instance(); + let instance = instance_with_store.instance.clone(); + let store = instance_with_store.store.clone(); let jh = std::thread::spawn(move || { let _: test_common::StringType = holochain_wasmer_host::guest::call( - Arc::clone(&instance), + &mut store.lock().as_store_mut(), + instance, "process_string", &input, ) diff --git a/test/src/wasms.rs b/test/src/wasms.rs index f38c55cd..97e5a975 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -14,6 +14,10 @@ use wasmer::Imports; use wasmer::Instance; use wasmer_middlewares::Metering; + +use std::sync::atomic::{AtomicUsize, Ordering}; +static INSTANCE_COUNTER: AtomicUsize = AtomicUsize::new(0); + pub enum TestWasm { Empty, Io, @@ -67,7 +71,10 @@ impl TestWasm { pub fn module(&self, metered: bool) -> Arc { match MODULE_CACHE.write().get(self.key(metered), self.bytes()) { - Ok(v) => v, + Ok(v) => { + // println!("using cached module for {}", self.name()); + v + }, Err(runtime_error) => match runtime_error.downcast::() { Ok(WasmError { error: WasmErrorInner::UninitializedSerializedModuleCache, @@ -112,6 +119,8 @@ impl TestWasm { } pub fn _instance(&self, metered: bool) -> InstanceWithStore { + let instance_count = INSTANCE_COUNTER.fetch_add(1, Ordering::SeqCst); + println!("creating instance for {} {}", self.name(), instance_count); let module_with_store = self.module(metered); let function_env; let instance; diff --git a/test/wasm_empty/src/wasm.rs b/test/wasm_empty/src/wasm.rs index e69de29b..b60bbdb9 100644 --- a/test/wasm_empty/src/wasm.rs +++ b/test/wasm_empty/src/wasm.rs @@ -0,0 +1,2 @@ +use holochain_wasmer_guest::allocation::__hc__allocate_1; +use holochain_wasmer_guest::allocation::__hc__deallocate_1; \ No newline at end of file From 2fdce5db1f6f8aab9eacfd701ebc6975fa0f810b Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 16 Oct 2023 00:00:57 +0400 Subject: [PATCH 20/24] fix instances --- test/benches/bench.rs | 2 +- test/src/wasms.rs | 56 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/test/benches/bench.rs b/test/benches/bench.rs index 448bc374..86dc992e 100644 --- a/test/benches/bench.rs +++ b/test/benches/bench.rs @@ -38,7 +38,7 @@ pub fn wasm_instance(c: &mut Criterion) { ] { group.bench_function(BenchmarkId::new("wasm_instance", wasm.name()), |b| { b.iter(|| { - wasm.unmetered_instance(); + let _drop = wasm.unmetered_instance(); }); }); } diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 97e5a975..d355799d 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -13,6 +13,8 @@ use wasmer::FunctionEnv; use wasmer::Imports; use wasmer::Instance; use wasmer_middlewares::Metering; +use wasmer::Store; +use wasmer::Module; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -69,6 +71,54 @@ impl TestWasm { } } + pub fn uncached_module(&self) -> Arc { + let store = Store::new(Cranelift::default()); + let module = Module::from_binary(&store, self.bytes()).unwrap(); + Arc::new(ModuleWithStore { + module: Arc::new(module), + store: Arc::new(parking_lot::Mutex::new(store)), + }) + } + + pub fn serial_cache_module(&self, metered: bool) -> Arc { + match SERIALIZED_MODULE_CACHE.get() { + Some(cache) => { + cache.write().get(self.key(metered), self.bytes()).unwrap() + }, + None => { + let cranelift_fn = || { + let cost_function = |_operator: &Operator| -> u64 { 1 }; + let metering = Arc::new(Metering::new(10000000000, cost_function)); + let mut cranelift = Cranelift::default(); + cranelift.canonicalize_nans(true).push_middleware(metering); + cranelift + }; + + let cranelift_fn_unmetered = || { + let mut cranelift = Cranelift::default(); + cranelift.canonicalize_nans(true); + cranelift + }; + + assert!(SERIALIZED_MODULE_CACHE + .set(parking_lot::RwLock::new( + SerializedModuleCache::default_with_cranelift(if metered { + cranelift_fn + } else { + cranelift_fn_unmetered + }) + )) + .is_ok()); + SERIALIZED_MODULE_CACHE + .get() + .unwrap() + .write() + .get(self.key(metered), self.bytes()) + .unwrap() + } + } + } + pub fn module(&self, metered: bool) -> Arc { match MODULE_CACHE.write().get(self.key(metered), self.bytes()) { Ok(v) => { @@ -120,8 +170,10 @@ impl TestWasm { pub fn _instance(&self, metered: bool) -> InstanceWithStore { let instance_count = INSTANCE_COUNTER.fetch_add(1, Ordering::SeqCst); - println!("creating instance for {} {}", self.name(), instance_count); - let module_with_store = self.module(metered); + // println!("creating instance for {} {}", self.name(), instance_count); + // let module_with_store = self.module(metered); + // let module_with_store = self.uncached_module(); + let module_with_store = self.serial_cache_module(metered); let function_env; let instance; { From c47fcde35d318e079908ba4ebe73ec7dba18c2c4 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 16 Oct 2023 21:55:19 +0400 Subject: [PATCH 21/24] remove module store --- crates/host/src/module.rs | 70 -------------------------------------- crates/host/src/prelude.rs | 1 - test/src/wasms.rs | 65 +++-------------------------------- 3 files changed, 5 insertions(+), 131 deletions(-) diff --git a/crates/host/src/module.rs b/crates/host/src/module.rs index 8060f094..b14cc17a 100644 --- a/crates/host/src/module.rs +++ b/crates/host/src/module.rs @@ -204,76 +204,6 @@ impl SerializedModuleCache { } } -/// Caches wasmer modules that can be used to build wasmer instances. This is the -/// output of building from wasm or deserializing the items in the serialized module cache. -#[derive(Default)] -pub struct ModuleCache { - plru: MicroCache, - key_map: PlruKeyMap, - cache: BTreeMap>, -} - -pub static MODULE_CACHE: Lazy> = - Lazy::new(|| RwLock::new(ModuleCache::default())); - -impl ModuleCache { - /// Wraps the serialized module cache to build modules as needed and also cache - /// the module itself in the module cache. - fn get_with_build_cache( - &mut self, - key: CacheKey, - wasm: &[u8], - ) -> Result, wasmer::RuntimeError> { - let module_with_store = match SERIALIZED_MODULE_CACHE.get() { - Some(serialized_module_cache) => serialized_module_cache.write().get(key, wasm)?, - None => { - return Err(wasmer::RuntimeError::user(Box::new(wasm_error!( - WasmErrorInner::UninitializedSerializedModuleCache - )))) - } - }; - Ok(self.put_item(key, module_with_store)) - } - - /// Attempts to retrieve a module ready to build instances from. Builds a new - /// module from the provided wasm and caches both the module and a serialized - /// copy of the module if there is a miss. - pub fn get( - &mut self, - key: CacheKey, - wasm: &[u8], - ) -> Result, wasmer::RuntimeError> { - match self.get_item(&key) { - Some(item) => Ok(item), - None => self.get_with_build_cache(key, wasm), - } - } -} - -impl PlruCache for ModuleCache { - type Item = ModuleWithStore; - - fn plru_mut(&mut self) -> &mut MicroCache { - &mut self.plru - } - - fn key_map_mut(&mut self) -> &mut PlruKeyMap { - &mut self.key_map - } - - fn key_map(&self) -> &PlruKeyMap { - &self.key_map - } - - fn cache(&self) -> &BTreeMap> { - &self.cache - } - - fn cache_mut(&mut self) -> &mut BTreeMap> { - &mut self.cache - } -} - /// Caches wasm instances. Reusing wasm instances allows maximum speed in function /// calls but also introduces the possibility of memory corruption or other bad /// state that is inappropriate to persist/reuse/access across calls. It is the diff --git a/crates/host/src/prelude.rs b/crates/host/src/prelude.rs index b25ce795..82a23f0d 100644 --- a/crates/host/src/prelude.rs +++ b/crates/host/src/prelude.rs @@ -1,6 +1,5 @@ pub use crate::env::Env; pub use crate::guest; -pub use crate::module::MODULE_CACHE; pub use holochain_serialized_bytes::prelude::*; pub use holochain_wasmer_common::result::WasmError; pub use holochain_wasmer_common::*; diff --git a/test/src/wasms.rs b/test/src/wasms.rs index d355799d..8a3a7441 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -12,10 +12,9 @@ use wasmer::Cranelift; use wasmer::FunctionEnv; use wasmer::Imports; use wasmer::Instance; -use wasmer_middlewares::Metering; -use wasmer::Store; use wasmer::Module; - +use wasmer::Store; +use wasmer_middlewares::Metering; use std::sync::atomic::{AtomicUsize, Ordering}; static INSTANCE_COUNTER: AtomicUsize = AtomicUsize::new(0); @@ -80,11 +79,9 @@ impl TestWasm { }) } - pub fn serial_cache_module(&self, metered: bool) -> Arc { + pub fn module(&self, metered: bool) -> Arc { match SERIALIZED_MODULE_CACHE.get() { - Some(cache) => { - cache.write().get(self.key(metered), self.bytes()).unwrap() - }, + Some(cache) => cache.write().get(self.key(metered), self.bytes()).unwrap(), None => { let cranelift_fn = || { let cost_function = |_operator: &Operator| -> u64 { 1 }; @@ -119,61 +116,9 @@ impl TestWasm { } } - pub fn module(&self, metered: bool) -> Arc { - match MODULE_CACHE.write().get(self.key(metered), self.bytes()) { - Ok(v) => { - // println!("using cached module for {}", self.name()); - v - }, - Err(runtime_error) => match runtime_error.downcast::() { - Ok(WasmError { - error: WasmErrorInner::UninitializedSerializedModuleCache, - .. - }) => { - { - let cranelift_fn = || { - let cost_function = |_operator: &Operator| -> u64 { 1 }; - let metering = Arc::new(Metering::new(10000000000, cost_function)); - let mut cranelift = Cranelift::default(); - cranelift.canonicalize_nans(true).push_middleware(metering); - cranelift - }; - - let cranelift_fn_unmetered = || { - let mut cranelift = Cranelift::default(); - cranelift.canonicalize_nans(true); - cranelift - }; - - assert!(SERIALIZED_MODULE_CACHE - .set(parking_lot::RwLock::new( - SerializedModuleCache::default_with_cranelift(if metered { - cranelift_fn - } else { - cranelift_fn_unmetered - }) - )) - .is_ok()); - } - SERIALIZED_MODULE_CACHE - .get() - .unwrap() - .write() - .get(self.key(metered), self.bytes()) - .unwrap() - } - - _ => unreachable!(), - }, - } - } - pub fn _instance(&self, metered: bool) -> InstanceWithStore { let instance_count = INSTANCE_COUNTER.fetch_add(1, Ordering::SeqCst); - // println!("creating instance for {} {}", self.name(), instance_count); - // let module_with_store = self.module(metered); - // let module_with_store = self.uncached_module(); - let module_with_store = self.serial_cache_module(metered); + let module_with_store = self.module(metered); let function_env; let instance; { From a1affccc4a8f785b66339f6dc4b1b8be29779c46 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 16 Oct 2023 22:22:42 +0400 Subject: [PATCH 22/24] lint --- test/src/wasms.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 8a3a7441..94f8f370 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -12,13 +12,8 @@ use wasmer::Cranelift; use wasmer::FunctionEnv; use wasmer::Imports; use wasmer::Instance; -use wasmer::Module; -use wasmer::Store; use wasmer_middlewares::Metering; -use std::sync::atomic::{AtomicUsize, Ordering}; -static INSTANCE_COUNTER: AtomicUsize = AtomicUsize::new(0); - pub enum TestWasm { Empty, Io, @@ -70,15 +65,6 @@ impl TestWasm { } } - pub fn uncached_module(&self) -> Arc { - let store = Store::new(Cranelift::default()); - let module = Module::from_binary(&store, self.bytes()).unwrap(); - Arc::new(ModuleWithStore { - module: Arc::new(module), - store: Arc::new(parking_lot::Mutex::new(store)), - }) - } - pub fn module(&self, metered: bool) -> Arc { match SERIALIZED_MODULE_CACHE.get() { Some(cache) => cache.write().get(self.key(metered), self.bytes()).unwrap(), @@ -117,7 +103,6 @@ impl TestWasm { } pub fn _instance(&self, metered: bool) -> InstanceWithStore { - let instance_count = INSTANCE_COUNTER.fetch_add(1, Ordering::SeqCst); let module_with_store = self.module(metered); let function_env; let instance; From d00d882f8ca590a31933a4f73f6ac47e716749e1 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 16 Oct 2023 22:44:39 +0400 Subject: [PATCH 23/24] fix concurrency bug --- test/src/wasms.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/test/src/wasms.rs b/test/src/wasms.rs index 94f8f370..be483a23 100644 --- a/test/src/wasms.rs +++ b/test/src/wasms.rs @@ -83,21 +83,19 @@ impl TestWasm { cranelift }; - assert!(SERIALIZED_MODULE_CACHE - .set(parking_lot::RwLock::new( - SerializedModuleCache::default_with_cranelift(if metered { - cranelift_fn - } else { - cranelift_fn_unmetered - }) - )) - .is_ok()); - SERIALIZED_MODULE_CACHE - .get() - .unwrap() - .write() - .get(self.key(metered), self.bytes()) - .unwrap() + // This will error if the cache is already initialized + // which could happen if two tests are running in parallel. + // It doesn't matter which one wins, so we just ignore the error. + let _did_init_ok = SERIALIZED_MODULE_CACHE.set(parking_lot::RwLock::new( + SerializedModuleCache::default_with_cranelift(if metered { + cranelift_fn + } else { + cranelift_fn_unmetered + }), + )); + + // Just recurse now that the cache is initialized. + self.module(metered) } } } From 4cb068de2bda00eb80b4b7dec85d1f783b100318 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 19 Oct 2023 17:29:47 +0400 Subject: [PATCH 24/24] 0.0.86 --- CHANGELOG.md | 14 ++------------ crates/common/Cargo.toml | 2 +- crates/guest/Cargo.toml | 4 ++-- crates/host/Cargo.toml | 4 ++-- test/Cargo.lock | 8 ++++---- test/Cargo.toml | 2 +- test/common/Cargo.toml | 2 +- test/test_wasm/Cargo.toml | 2 +- test/wasm_empty/Cargo.lock | 6 +++--- test/wasm_empty/Cargo.toml | 2 +- test/wasm_io/Cargo.toml | 2 +- 11 files changed, 19 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cc8d6c8..f5703ee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,19 +2,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.0.86] -### Added - -### Changed - -### Deprecated - -### Removed - -### Fixed - -### Security +- Support wasmer 4.x ## [0.0.73] - 2021-07-20 diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 0c8b3da4..0783e0f2 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -2,7 +2,7 @@ name = "holochain_wasmer_common" description = "commons for both host and guest" license = "Apache-2.0" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/crates/guest/Cargo.toml b/crates/guest/Cargo.toml index 4998a852..e7f37488 100644 --- a/crates/guest/Cargo.toml +++ b/crates/guest/Cargo.toml @@ -2,7 +2,7 @@ name = "holochain_wasmer_guest" description = "wasm guest code" license = "Apache-2.0" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" @@ -15,7 +15,7 @@ path = "src/guest.rs" [dependencies] holochain_serialized_bytes = { version = "=0.0.53", features = [] } -holochain_wasmer_common = { version = "=0.0.85", path = "../common" } +holochain_wasmer_common = { version = "=0.0.86", path = "../common" } serde = "1" tracing = "0.1" parking_lot = "0.12" diff --git a/crates/host/Cargo.toml b/crates/host/Cargo.toml index bfdbbcc8..bb851262 100644 --- a/crates/host/Cargo.toml +++ b/crates/host/Cargo.toml @@ -2,14 +2,14 @@ name = "holochain_wasmer_host" description = "wasm host code" license = "Apache-2.0" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" [dependencies] wasmer = "=4.2.2" wasmer-middlewares = "=4.2.2" -holochain_wasmer_common = { version = "=0.0.85", path = "../common" } +holochain_wasmer_common = { version = "=0.0.86", path = "../common" } holochain_serialized_bytes = "=0.0.53" serde = "1" tracing = "0.1" diff --git a/test/Cargo.lock b/test/Cargo.lock index 307ce343..7498ed2e 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -758,7 +758,7 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.85" +version = "0.0.86" dependencies = [ "holochain_serialized_bytes", "serde", @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "holochain_wasmer_host" -version = "0.0.85" +version = "0.0.86" dependencies = [ "bimap", "bytes", @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "test" -version = "0.0.85" +version = "0.0.86" dependencies = [ "criterion", "ctor", @@ -1661,7 +1661,7 @@ dependencies = [ [[package]] name = "test_common" -version = "0.0.85" +version = "0.0.86" dependencies = [ "holochain_wasmer_common", "serde", diff --git a/test/Cargo.toml b/test/Cargo.toml index 6dc8aaf5..30e10c21 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/common/Cargo.toml b/test/common/Cargo.toml index 57a09bb5..e41c928c 100644 --- a/test/common/Cargo.toml +++ b/test/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_common" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/test_wasm/Cargo.toml b/test/test_wasm/Cargo.toml index 72af9985..90cd3278 100644 --- a/test/test_wasm/Cargo.toml +++ b/test/test_wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/wasm_empty/Cargo.lock b/test/wasm_empty/Cargo.lock index 5a18158b..b378eb23 100644 --- a/test/wasm_empty/Cargo.lock +++ b/test/wasm_empty/Cargo.lock @@ -629,7 +629,7 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.85" +version = "0.0.86" dependencies = [ "holochain_serialized_bytes", "serde", @@ -641,7 +641,7 @@ dependencies = [ [[package]] name = "holochain_wasmer_guest" -version = "0.0.85" +version = "0.0.86" dependencies = [ "holochain_serialized_bytes", "holochain_wasmer_common", @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "test_wasm_empty" -version = "0.0.85" +version = "0.0.86" dependencies = [ "holochain_wasmer_guest", ] diff --git a/test/wasm_empty/Cargo.toml b/test/wasm_empty/Cargo.toml index 144a2f2f..7444a313 100644 --- a/test/wasm_empty/Cargo.toml +++ b/test/wasm_empty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm_empty" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021" diff --git a/test/wasm_io/Cargo.toml b/test/wasm_io/Cargo.toml index 5d713216..f8c46f10 100644 --- a/test/wasm_io/Cargo.toml +++ b/test/wasm_io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_wasm_io" -version = "0.0.85" +version = "0.0.86" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] edition = "2021"