Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

"Unsupported ELF header" when running Go-compiled WASM

未关闭
#200 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go, rust, wasm

调研方向

从 examples/helloworld/main.rs 开始,使用 GOOS=wasip1 GOARCH=wasm 构建 testhyperlight-go.wasm,然后运行示例以复现失败。将 Go 生成的模块与现有的 HelloWorld.aot 和 RunWasm.aot 用例进行比较,并检查 issue 中提到的 wasm-clang-builder 上下文。完成的标准是已确定是否支持或存在兼容性限制,已识别所需的任何更改,并且示例不再产生 ELF-header 错误。

由索引模型根据 Issue 内容生成。

描述

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?

主要语言
Rust
星标
728
派生
39
平均合并
1 天 4 小时
30 天内合并 PR
11

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hyperlight-dev/hyperlight-wasm 的其他 Issue

查看 hyperlight-dev/hyperlight-wasm 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。