Skip to content

Commit

Permalink
rollback(wasm): llvm compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrzn committed Aug 29, 2023
1 parent e5f04aa commit 6c0d57f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 8 additions & 3 deletions packages/wasm/src/runtime/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -64,8 +64,13 @@ impl WasmInstance {
memory_initial_limits: u8,
state: Arc<Mutex<State>>,
) -> Result<Self, WrapperError> {
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());
Expand Down

0 comments on commit 6c0d57f

Please sign in to comment.