mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
enable linking when running wasm tests
This commit is contained in:
parent
e2b95662a8
commit
656832b272
1 changed files with 7 additions and 16 deletions
|
@ -148,21 +148,16 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
|
||||||
|
|
||||||
let store = Store::default();
|
let store = Store::default();
|
||||||
|
|
||||||
// let wasmer_module = Module::from_binary(&store, &module_bytes).unwrap();
|
let wasmer_module = {
|
||||||
|
|
||||||
let wasmer_module = if false {
|
|
||||||
let dir = tempdir().unwrap();
|
let dir = tempdir().unwrap();
|
||||||
// let dirpath = dir.path();
|
let dirpath = dir.path();
|
||||||
let dirpath = PathBuf::from("/home/folkertdev/roc/wasm");
|
|
||||||
let app_o_file = dirpath.join("app.wasm");
|
|
||||||
let final_wasm_file = dirpath.join("final.wasm");
|
let final_wasm_file = dirpath.join("final.wasm");
|
||||||
|
let app_o_file = dirpath.join("app.o");
|
||||||
|
|
||||||
|
// write the module to a file so the linker can access it
|
||||||
std::fs::write(&app_o_file, &module_bytes).unwrap();
|
std::fs::write(&app_o_file, &module_bytes).unwrap();
|
||||||
|
|
||||||
dbg!(bitcode::BUILTINS_WASM32_OBJ_PATH);
|
std::process::Command::new("zig")
|
||||||
dbg!(&final_wasm_file);
|
|
||||||
|
|
||||||
dbg!(std::process::Command::new("zig")
|
|
||||||
.args(&[
|
.args(&[
|
||||||
"wasm-ld",
|
"wasm-ld",
|
||||||
// input files
|
// input files
|
||||||
|
@ -183,15 +178,11 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
|
||||||
"test_wrapper",
|
"test_wrapper",
|
||||||
"--export",
|
"--export",
|
||||||
"#UserApp_main_1",
|
"#UserApp_main_1",
|
||||||
// "--export",
|
|
||||||
// "__linear_memory",
|
|
||||||
])
|
])
|
||||||
.output())
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Module::from_file(&store, &final_wasm_file).unwrap()
|
Module::from_file(&store, &final_wasm_file).unwrap()
|
||||||
} else {
|
|
||||||
Module::from_binary(&store, &module_bytes).unwrap()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// First, we create the `WasiEnv`
|
// First, we create the `WasiEnv`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue