diff --git a/src/main.rs b/src/main.rs index a7cac65f..cf175779 100644 --- a/src/main.rs +++ b/src/main.rs @@ -257,6 +257,10 @@ pub fn start(mut os_input: Box, opts: Opt) { .unwrap(), ); + // Here be dragons! This is very much a work in progress, and isn't quite functional + // yet. It's being left out of the tests because is slows them down massively (by + // recompiling a WASM module for every single test). Stay tuned for more updates! + #[cfg(not(test))] active_threads.push( thread::Builder::new() .name("wasm".to_string()) @@ -268,7 +272,11 @@ pub fn start(mut os_input: Box, opts: Opt) { println!("Compiling module..."); // FIXME: Switch to a higher performance compiler (`Store::default()`) and cache this on disk // I could use `(de)serialize_to_file()` for that - let module = Module::from_file(&store, "target/wasm32-wasi/debug/module.wasm")?; + let module = if let Ok(m) = Module::from_file(&store, "strider.wasm") { + m + } else { + return Ok(()) // Just abort this thread quietly if the WASM isn't found + }; // FIXME: Upstream the `Pipe` struct //let output = fluff::Pipe::new(); @@ -343,6 +351,7 @@ pub fn start(mut os_input: Box, opts: Opt) { _ => (), } */ } + debug_log_to_file("WASM module loaded and exited cleanly :)".to_string())?; Ok(()) }().unwrap() }) diff --git a/strider.wasm b/strider.wasm new file mode 100755 index 00000000..69d8617e Binary files /dev/null and b/strider.wasm differ