-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
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).
- Hyperlight provide
- If not, are there any possible modifications that can make hyperlight-wasm work with Go-compiled WASM?