From 6b64e9a5af2ae6c46c8f4cf167e2ae98a9c53000 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Wed, 30 Oct 2024 14:58:44 +0330 Subject: [PATCH] fix swift build --- Cargo.lock | 1 + lib/swift/Cargo.toml | 1 + lib/swift/src/lib.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 64a1def4cb4..7c6adcb591b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6844,6 +6844,7 @@ dependencies = [ "uniffi", "virtual-fs", "wasmer", + "wasmer-package", "wasmer-wasix", "webc", ] diff --git a/lib/swift/Cargo.toml b/lib/swift/Cargo.toml index c70ec2661d8..09757e28f9e 100644 --- a/lib/swift/Cargo.toml +++ b/lib/swift/Cargo.toml @@ -24,6 +24,7 @@ wasmer = { version = "=5.0.0", path = "../api", default-features = false, featur ] } wasmer-wasix = { version = "=0.30.0", path = "../wasix" } webc.workspace = true +wasmer-package.workspace = true [build-dependencies] diff --git a/lib/swift/src/lib.rs b/lib/swift/src/lib.rs index 2244bf609cf..1415567f1ee 100644 --- a/lib/swift/src/lib.rs +++ b/lib/swift/src/lib.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use tokio::runtime::Runtime; use virtual_fs::{AsyncReadExt, AsyncSeekExt}; +use wasmer_package::utils::from_bytes; use wasmer_wasix::{ bin_factory::BinaryPackage, runners::{wasi::WasiRunner, Runner}, @@ -32,7 +33,7 @@ pub enum WasmerError { pub fn run_package(webc_bytes: Vec, args: Vec) -> Result { let tokio_rt = Runtime::new().unwrap(); let _enter = tokio_rt.enter(); - let container = err!(webc::Container::from_bytes(webc_bytes)); + let container = err!(from_bytes(webc_bytes)); let tasks = TokioTaskManager::new(tokio_rt.handle().clone()); let tasks = Arc::new(tasks); let mut rt = PluggableRuntime::new(Arc::clone(&tasks) as Arc<_>);