cli: remove wasmer dependency and rename run_with_wasmer->run_wasm

This commit is contained in:
Brian Carroll 2022-12-15 23:52:11 +00:00
parent 8798fa38d4
commit fec64f0766
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
4 changed files with 19 additions and 901 deletions

View file

@ -853,7 +853,7 @@ fn roc_run<'a, I: IntoIterator<Item = &'a OsStr>>(
{
use std::os::unix::ffi::OsStrExt;
run_with_wasmer(
run_wasm(
generated_filename,
args.into_iter().map(|os_str| os_str.as_bytes()),
);
@ -861,7 +861,7 @@ fn roc_run<'a, I: IntoIterator<Item = &'a OsStr>>(
#[cfg(not(target_family = "unix"))]
{
run_with_wasmer(
run_wasm(
generated_filename,
args.into_iter().map(|os_str| {
os_str.to_str().expect(
@ -1239,7 +1239,7 @@ fn roc_run_native<I: IntoIterator<Item = S>, S: AsRef<OsStr>>(
}
#[cfg(feature = "run-wasm32")]
fn run_with_wasmer<I: Iterator<Item = S>, S: AsRef<[u8]>>(wasm_path: &std::path::Path, args: I) {
fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(wasm_path: &std::path::Path, args: I) {
use wasmer::{Instance, Module, Store};
let store = Store::default();
@ -1270,7 +1270,7 @@ fn run_with_wasmer<I: Iterator<Item = S>, S: AsRef<[u8]>>(wasm_path: &std::path:
}
#[cfg(not(feature = "run-wasm32"))]
fn run_with_wasmer<I: Iterator<Item = S>, S: AsRef<[u8]>>(_wasm_path: &std::path::Path, _args: I) {
fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(_wasm_path: &std::path::Path, _args: I) {
println!("Running wasm files is not supported on this target.");
}