From c9a4aa749c0494b39494baaedcde253f035601bb Mon Sep 17 00:00:00 2001 From: cshung <3410332+cshung@users.noreply.github.com> Date: Thu, 20 Aug 2026 18:06:00 +0000 Subject: [PATCH] Generate projects for the host architecture Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com> --- src/new/mod.rs | 5 ++--- tests/new.rs | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/new/mod.rs b/src/new/mod.rs index f46d595..1a60534 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -5,9 +5,8 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result, ensure}; use clap::Parser; -const HYPERLIGHT_VERSION: &str = "0.15"; -// TODO: support aarch64-hyperlight-none when aarch64 guests are supported. -const GUEST_ARCH: &str = "x86_64"; +const HYPERLIGHT_VERSION: &str = "0.16"; +const GUEST_ARCH: &str = std::env::consts::ARCH; const GUEST_CARGO_TOML: &str = include_str!("guest/_Cargo.toml"); const GUEST_MAIN_RS: &str = include_str!("guest/_main.rs"); diff --git a/tests/new.rs b/tests/new.rs index e02870e..043a493 100644 --- a/tests/new.rs +++ b/tests/new.rs @@ -43,8 +43,15 @@ fn new_host_and_guest() { let guest_toml = std::fs::read_to_string(project.join("guest/Cargo.toml")).unwrap(); assert!(guest_toml.contains("name = \"myproject-guest\"")); + assert!(guest_toml.contains("hyperlight-guest-bin = \"0.16\"")); let host_toml = std::fs::read_to_string(project.join("host/Cargo.toml")).unwrap(); assert!(host_toml.contains("name = \"myproject-host\"")); + assert!(host_toml.contains("hyperlight-host = \"0.16\"")); + let host_main = std::fs::read_to_string(project.join("host/src/main.rs")).unwrap(); + assert!(host_main.contains(&format!( + "target/{}-hyperlight-none/debug/myproject-guest", + std::env::consts::ARCH + ))); // Clippy run(cargo()