cargo hyperlight new generates an unusable project on Windows ARM64

Đang mở
#70 0 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
build-system, cli

Hướng nghiên cứu

Bắt đầu tại src/new/mod.rs và so sánh phiên bản dependency được tạo cùng guest path với lựa chọn kiến trúc đã được cargo hyperlight build sử dụng. Tái hiện vấn đề bằng cargo hyperlight new trên Windows ARM64 native, sau đó xác minh rằng project được tạo có thể build và chạy cho kiến trúc đã chọn.

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

Mô tả

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.

Ngôn ngữ chính
Rust
Star
4
Fork
6
Merge trung bình
4 phút
Pull request đã merge (30 ngày)
2

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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/cargo-hyperlight

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

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.