Issue Description
I am trying to run a Go-compiled WASM module (testhyperlight-go.wasm) with hyperlight-wasm, but encounter the following error:
Error: GuestError(GuestError, "Error: failed to parse precompiled artifact as an ELF\n\nCaused by:\n Unsupported ELF header")
This occurs when attempting to load the WASM file in the modified examples/helloworld/main.rs test case (see Reproduction Steps below).
Reproduction Steps
-
Compile the Go WASM module:
bash
GOOS=wasip1 GOARCH=wasm go build -o "testhyperlight-go.wasm"
package main
//go:wasmexport noReturnCal
func noReturnCal() {
result := 0
for i := 0; i < 100; i++ {
result += i
}
}
func main() {}
-
Modify examples/helloworld/main.rs to include the new test case:
fn main() -> Result<()> {
let tests = [
(
"HelloWorld.aot",
"HelloWorld",
"Message from Rust Example to Wasm Function".to_string(),
),
(
"RunWasm.aot",
"Echo",
"Message from Rust Example to Wasm Function".to_string(),
),
// New test case (Go WASM)
(
"testhyperlight-go.wasm",
"noReturnCal",
"Message from Rust Example to Wasm Function".to_string(),
),
];
// ... (rest of the test logic)
}
-
Run the example and observe the error:
Result from calling HelloWorld Function in Wasm Module test case 0) is: 0
Result from calling Echo Function in Wasm Module test case 1) is: Message from Rust Example to Wasm Function
Error: GuestError(GuestError, "Error: failed to parse precompiled artifact as an ELF\n\nCaused by:\n Unsupported ELF header")
Questions
- Does hyperlight-wasm currently support WASM files compiled with another compiler?
- Hyperlight provide
wasm-clang-builder to compile C file , but does hyperlight compatible with Go-compiled WASM (with WASI support, such as GOOS=wasip1 GOARCH=wasm go build).
- If not, are there any possible modifications that can make hyperlight-wasm work with Go-compiled WASM?
Issue Description
I am trying to run a Go-compiled WASM module (
testhyperlight-go.wasm) with hyperlight-wasm, but encounter the following error:This occurs when attempting to load the WASM file in the modified
examples/helloworld/main.rstest case (see Reproduction Steps below).Reproduction Steps
Compile the Go WASM module:
bash GOOS=wasip1 GOARCH=wasm go build -o "testhyperlight-go.wasm"Modify
examples/helloworld/main.rsto include the new test case:Run the example and observe the error:
Questions
wasm-clang-builderto compile C file , but does hyperlight compatible with Go-compiled WASM (with WASI support, such as GOOS=wasip1 GOARCH=wasm go build).