Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

"Unsupported ELF header" when running Go-compiled WASM

Đang mở
#200 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, rust, wasm
Lĩnh vực
backend, operating-systems

Hướng nghiên cứu

Bắt đầu với examples/helloworld/main.rs và tái hiện lỗi bằng cách build testhyperlight-go.wasm với GOOS=wasip1 GOARCH=wasm, sau đó chạy example. So sánh module do Go tạo ra với các trường hợp HelloWorld.aot và RunWasm.aot hiện có, đồng thời kiểm tra ngữ cảnh wasm-clang-builder được đề cập trong issue. Được xem là hoàn tất khi đã xác định được việc hỗ trợ hoặc giới hạn tương thích, xác định mọi thay đổi cần thiết và example không còn tạo ra lỗi ELF-header.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Rust
Star
728
Fork
39
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hyperlight-dev/hyperlight-wasm

Tất cả issue của hyperlight-dev/hyperlight-wasm

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.