Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/appcipe-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[dependencies]
anyhow = "1.0.98"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
serde = { version = "1.0.219", features = ["derive"] }
serde_yaml = "0.9.34"

Expand Down
4 changes: 2 additions & 2 deletions crates/chefer-assembler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "chefer-assembler"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
anyhow = "1.0.102"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
clap = { version = "4.6.1", features = ["derive"] }
fs-err = "3.3.0"
sha2 = "0.11.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/chefer-bundle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chefer-bundle"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions crates/chefer-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "chefer-cli"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
anyhow = "1.0.98"
appcipe-normalize = { version = "0.1.0", path = "../appcipe-normalize" }
appcipe-spec = { path = "../appcipe-spec" }
chefer-assembler = { version = "0.4.0", path = "../chefer-assembler" }
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
chefer-assembler = { version = "0.5.0", path = "../chefer-assembler" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
chefer-pack = { path = "../chefer-pack" }
clap = { version = "4.5.43", features = ["derive"] }
comfy-table = "7.1.4"
Expand All @@ -23,7 +23,7 @@ serde_yaml = "0.9.34"
sha2 = "0.11.0"
tar = "0.4.46"
tempfile = "3.27.0"
vmm-backend = { version = "0.4.0", path = "../vmm-backend" }
vmm-backend = { version = "0.5.0", path = "../vmm-backend" }
zip = { version = "8.6.0", default-features = false, features = ["deflate-flate2"] }
zstd = "0.13.3"

Expand Down
4 changes: 2 additions & 2 deletions crates/chefer-pack/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "chefer-pack"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
anyhow = "1.0.102"
appcipe-spec = { version = "0.1.0", path = "../appcipe-spec" }
# 解 docker config.json 的 auths.auth(base64 "user:pass");本就在依賴樹(oci-client 傳遞依賴)。
base64 = "0.22"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
flate2 = "1.1.9"
fs-err = "3.3.0"
# registry pull(source: image)。rustls 對齊 workspace(chefer-cli 也用 rustls)。
Expand Down
6 changes: 3 additions & 3 deletions crates/chefer-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chefer-runtime"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
Expand All @@ -15,8 +15,8 @@ clap = { version = "4.0", features = ["derive"] }
fs-err = "3.3.0"
sha2 = "0.11.0"
ctrlc = "3.5.2"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
vmm-backend = { version = "0.4.0", path = "../vmm-backend" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
vmm-backend = { version = "0.5.0", path = "../vmm-backend" }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "guest-agent"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
anyhow = "1.0.102"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
clap = { version = "4.6.1", features = ["derive"] }
hex = "0.4.3"
ruzstd = "0.8.3"
Expand Down
6 changes: 3 additions & 3 deletions crates/vmm-backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "vmm-backend"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[dependencies]
anyhow = "1.0.102"
chefer-bundle = { version = "0.4.0", path = "../chefer-bundle" }
guest-agent = { version = "0.4.0", path = "../guest-agent" }
chefer-bundle = { version = "0.5.0", path = "../chefer-bundle" }
guest-agent = { version = "0.5.0", path = "../guest-agent" }
sha2 = "0.11.0"
tar = "0.4.46"

Expand Down
4 changes: 2 additions & 2 deletions crates/vmm-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//! 對應 docs/DESIGN.md §6「vmm-backend」節:
//! - Linux:`namespaces` 後端(in-process 呼叫 guest-agent lib)。
//! - Windows:`wsl2` 後端(chefer 專用 distro 內跑 bundle 內嵌的 musl guest-agent)。
//! - macOS:`vz` 後端(內附 Swift helper 驅動 Virtualization.framework;實機驗證前
//! 預設 `Unavailable`,需 `CHEFER_VZ_EXPERIMENTAL=1` 啟用)。
//! - macOS:`vz` 後端(內附 Swift helper 驅動 Virtualization.framework;已於 Apple Silicon
//! 實機驗證,`availability()` 依真實前提決定可用性,無實驗性 env 鎖)。
//!
//! 公開 API:[`Availability`]、[`RunOptions`]、[`AppRunContext`]、[`ExecBackend`]、
//! [`backends`]、[`run_app`];另提供 [`cleanup_distros`] 供清理舊版殘留 WSL distro。
Expand Down
23 changes: 9 additions & 14 deletions crates/vmm-backend/src/vz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
//! 開機由內附的 **Swift helper**(`agents/chefer-vz-helper-<arch>`)驅動:本後端只負責
//! spawn helper、把它的 stdout(接著 guest 序列 console)串接解析 `CHEFER_GUEST_IP` /
//! `CHEFER_GUEST_EXIT` 標記,並依 guest IP 起 host→guest 埠轉發。實際的
//! Virtualization.framework 呼叫全在 helper(Swift)內,僅能在實體 Mac 驗證 VM 真的開得起來
//! Virtualization.framework 呼叫全在 helper(Swift)內。
//!
//! **誠實回報**:在實機驗證通過前 `availability()` 預設 `Unavailable`,需
//! `CHEFER_VZ_EXPERIMENTAL=1` 才啟用。
//! macOS 上 vz 是**唯一**的執行後端,且已於實體 Apple Silicon(macOS 26)完整驗證通過
//! (2026-07),故不再上實驗性 env 鎖——`availability()` 依真實前提(host arch、bundle
//! 內嵌 appliance、bundle 內嵌 helper、macOS 13+)決定可用性,缺任一即誠實回報
//! `Unavailable`。Intel(x86_64)走完全相同的程式路徑(appliance 換 arch),但實機 VZ 開機
//! 目前僅在 Apple Silicon 驗過(GHA runner 開不了 VZ guest,Intel 亦然)。

use std::io::{BufRead, BufReader};
use std::net::{Ipv4Addr, SocketAddr, UdpSocket};
Expand All @@ -32,17 +35,9 @@ impl ExecBackend for VzBackend {
}

fn availability(&self, ctx: &AppRunContext) -> Availability {
// 實機驗證前預設不可用;需 CHEFER_VZ_EXPERIMENTAL=1 才啟用(誠實不偽稱可執行)。
if std::env::var("CHEFER_VZ_EXPERIMENTAL").ok().as_deref() != Some("1") {
return Availability::Unavailable(
"The macOS (vz) backend is experimental and not yet validated on real hardware. \
To try it on a Mac, set CHEFER_VZ_EXPERIMENTAL=1 (the app must embed a \
chefer-vz-helper signed with the com.apple.security.virtualization entitlement, \
or you can point CHEFER_VZ_HELPER at a locally built one)."
.to_string(),
);
}

// 依真實前提決定可用性(host arch、內嵌 appliance、內嵌 helper、macOS 版本)——
// 已於 Apple Silicon 實機驗證,不再上實驗性 env 鎖(macOS 上 vz 是唯一後端,
// 鎖著等於預設不能跑)。缺任一前提即誠實回報 Unavailable。
let host_arch = std::env::consts::ARCH;
let Some(arch) = vz_util::host_guest_arch(host_arch) else {
return Availability::Unavailable(format!(
Expand Down
2 changes: 1 addition & 1 deletion crates/whp-helper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "whp-helper"
version = "0.4.0"
version = "0.5.0"
edition = "2024"

[[bin]]
Expand Down
Loading