Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

"Unsupported ELF header" when running Go-compiled WASM

Aperta
#200 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go, rust, wasm

Direzione di ricerca

Inizia da examples/helloworld/main.rs e riproduci il problema compilando testhyperlight-go.wasm con GOOS=wasip1 GOARCH=wasm, quindi eseguendo l’esempio. Confronta il modulo generato da Go con i casi esistenti HelloWorld.aot e RunWasm.aot, e analizza il contesto wasm-clang-builder menzionato nell’issue. Il lavoro è completato quando è stato stabilito il supporto o il limite di compatibilità, sono state identificate tutte le modifiche necessarie e l’esempio non produce più l’errore ELF-header.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

lifecycle/needs info
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
  1. 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() {}
    
  2. 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)
    }
    
  3. 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
  1. 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).
  2. If not, are there any possible modifications that can make hyperlight-wasm work with Go-compiled WASM?

Lingua principale
Rust
Stelle
728
Fork
39
Merge medio
2g 3h
PR unite (30g)
25

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperlight-dev/hyperlight-wasm

Tutte le issue di hyperlight-dev/hyperlight-wasm

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.