cargo hyperlight new generates an unusable project on Windows ARM64

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
rust
领域
build-system, cli

调研方向

从 src/new/mod.rs 开始,将生成的依赖版本和 guest 路径与 cargo hyperlight build 已使用的架构选择进行比较。在原生 Windows ARM64 上使用 cargo hyperlight new 重现该问题,然后验证生成的项目是否能针对所选架构进行构建和运行。

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

描述

Problem

cargo hyperlight new generates projects that cannot build on a native Windows ARM64 host.

The current template has two x64-era assumptions in src/new/mod.rs:

  • HYPERLIGHT_VERSION is 0.15. Its hyperlight-libc rejects the automatically selected aarch64 target with Unsupported target architecture: aarch64.
  • GUEST_ARCH is always x86_64, so the generated host loads target/x86_64-hyperlight-none/... even when cargo hyperlight build selects aarch64-hyperlight-none from the native host architecture.

This is still present on main at cargo-hyperlight 0.1.13.

Reproduction

On native Windows ARM64:

cargo hyperlight new chw
cd chw/guest
cargo hyperlight build

The build selects AArch64 automatically, then fails in Hyperlight 0.15:

Unsupported target architecture: aarch64

Hardware validation

I changed the generated guest and host dependencies to the Hyperlight 0.16 ARM64 WHP PR and changed the guest path to aarch64-hyperlight-none.

The generated sample then passed end to end on a Surface Laptop 7 with WHP:

  • Debug guest build and execution.
  • Release guest build and execution.
  • Host callback and typed guest calls.
  • Persistent guest state.
  • Snapshot and restore.
  • 10 release runs with surrogate mappings.
  • 10 release runs with HYPERLIGHT_MAX_SURROGATES=0.

Expected output was produced on every run.

Suggested direction

Generate the dependency version and guest architecture from supported/current values instead of fixed 0.15 and x86_64. The build command already defaults its target from std::env::consts::ARCH, so the scaffold should use the same architecture decision.

主要语言
Rust
星标
4
派生
6
平均合并
4 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

hyperlight-dev/cargo-hyperlight 的其他 Issue

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

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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