diff --git a/Cargo.lock b/Cargo.lock index 0b15468..4797c2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -280,7 +280,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1af5a01adeeade54c9f5060300227a8ee64c05b6376f28e9b8ee3b72dd2056f" dependencies = [ - "spin", + "spin 0.10.0", ] [[package]] @@ -1466,7 +1466,7 @@ dependencies = [ "anyhow", "flatbuffers", "log", - "spin", + "spin 0.10.0", "thiserror", "tracing", "tracing-core", @@ -1501,7 +1501,7 @@ dependencies = [ "hyperlight-libc", "linkme", "log", - "spin", + "spin 0.10.0", "tracing", ] @@ -1524,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca03b1ccd29c0c277555d8bd737257d0598554004f9667bb196227d5ed8b5b7e" dependencies = [ "hyperlight-common", - "spin", + "spin 0.10.0", "tracing", "tracing-core", ] @@ -1637,7 +1637,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "spin", + "spin 0.11.0", "tempfile", "tracing", ] @@ -3455,6 +3455,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "783f3f6f6b01e295a669edfc402133a5f2553d1f0e81284b3ba4594e80bdd4a2" +dependencies = [ + "lock_api", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" diff --git a/src/hyperlight-js-runtime/Cargo.toml b/src/hyperlight-js-runtime/Cargo.toml index 7c4f112..40fe7c3 100644 --- a/src/hyperlight-js-runtime/Cargo.toml +++ b/src/hyperlight-js-runtime/Cargo.toml @@ -26,7 +26,7 @@ rquickjs = { version = "0.11", default-features = false, features = ["bindgen", serde = { version = "1.0.228", default-features = false, features = ["derive", "alloc"] } serde_json = { version = "1.0.149", default-features = false, features = ["alloc"] } sha2 = { version = "0.10" , default-features = false, features = ["force-soft"]} -spin = "0.10" +spin = "0.11" tracing = { version = "0.1.44", default-features = false, features = ["log","attributes","max_level_trace"] } [target.'cfg(hyperlight)'.dependencies] diff --git a/src/hyperlight-js-runtime/src/main/hyperlight.rs b/src/hyperlight-js-runtime/src/main/hyperlight.rs index 148d849..0379468 100644 --- a/src/hyperlight-js-runtime/src/main/hyperlight.rs +++ b/src/hyperlight-js-runtime/src/main/hyperlight.rs @@ -62,7 +62,7 @@ impl hyperlight_js_runtime::host::Host for Host { } } -static RUNTIME: spin::Lazy> = spin::Lazy::new(|| { +static RUNTIME: spin::LazyLock> = spin::LazyLock::new(|| { Mutex::new(JsRuntime::new(Host).unwrap_or_else(|e| { panic!("Failed to initialize JS runtime: {e:#?}"); })) @@ -72,7 +72,7 @@ static RUNTIME: spin::Lazy> = spin::Lazy::new(|| { #[instrument(skip_all, level = "info")] fn main() { // dereference RUNTIME to force its initialization - // of the Lazy static + // of the LazyLock static let _ = &*RUNTIME; } diff --git a/src/hyperlight-js-runtime/src/modules/mod.rs b/src/hyperlight-js-runtime/src/modules/mod.rs index c0ca64f..a191989 100644 --- a/src/hyperlight-js-runtime/src/modules/mod.rs +++ b/src/hyperlight-js-runtime/src/modules/mod.rs @@ -19,7 +19,7 @@ use hashbrown::HashMap; use rquickjs::loader::{Loader, Resolver}; use rquickjs::module::ModuleDef; use rquickjs::{Ctx, Module, Result}; -use spin::Lazy; +use spin::LazyLock; pub mod console; pub mod crypto; @@ -47,7 +47,7 @@ fn declaration() -> ModuleDeclarationFn { declare:: } -static NATIVE_MODULES: Lazy> = Lazy::new(|| { +static NATIVE_MODULES: LazyLock> = LazyLock::new(|| { HashMap::from([ ("io", declaration::()), ("crypto", declaration::()),