From 6c0d57fc7ef7dc7f357e1a962e1e0ce2d74d0542 Mon Sep 17 00:00:00 2001 From: Cesar Date: Tue, 29 Aug 2023 16:36:50 +0200 Subject: [PATCH] rollback(wasm): llvm compiler --- packages/wasm/Cargo.toml | 2 +- packages/wasm/src/runtime/instance.rs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/wasm/Cargo.toml b/packages/wasm/Cargo.toml index e8bd9629b..46ceb6521 100644 --- a/packages/wasm/Cargo.toml +++ b/packages/wasm/Cargo.toml @@ -19,7 +19,7 @@ base64.workspace = true serde_bytes.workspace = true wasmer = "4.1.0" -wasmer-compiler-llvm = "4.1.0" +# wasmer-compiler-llvm = "4.1.0" bytes = "1.4.0" [dev-dependencies] diff --git a/packages/wasm/src/runtime/instance.rs b/packages/wasm/src/runtime/instance.rs index e0b295468..807a132a1 100644 --- a/packages/wasm/src/runtime/instance.rs +++ b/packages/wasm/src/runtime/instance.rs @@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex}; use polywrap_core::invoker::Invoker; use wasmer::{Instance, Memory, MemoryType, Module, Store, Value}; -use wasmer_compiler_llvm::LLVM; +// use wasmer_compiler_llvm::LLVM; use crate::error::WrapperError; @@ -64,8 +64,13 @@ impl WasmInstance { memory_initial_limits: u8, state: Arc>, ) -> Result { - let compiler = LLVM::new(); - let mut store = Store::new(compiler); + // This has been commented because it introduces the OS dependency of LLVM + // Research needs to be done on how to easily install this. + // https://github.com/wasmerio/wasmer/tree/master/lib/compiler-llvm + // let compiler = LLVM::new(); + // let mut store = Store::new(compiler); + + let mut store = Store::default(); let memory = WasmInstance::create_memory(&mut store, memory_initial_limits)?; state.lock().unwrap().memory = Some(memory.clone());