You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per docs/vz-backend/PLAN.md Phase 1. Adds a new compute-provider
substrate for macOS that mirrors elastos-crosvm's public surface and
fails closed at every entry point. Phase 2 wires the actual
Apple Virtualization.framework calls.
New crate: elastos/crates/elastos-vz
- VzProvider implements ComputeProvider; every method returns
PHASE_1_STUB_MESSAGE ("vz backend not yet implemented (Phase 2)").
- VzConfig + VmConfig mirror crosvm shapes minus pivot_root_dir.
Boot-args helper rewrites `console=ttyS0` → `console=hvc0` per
Phase 0 finding (Vz exposes the kernel console only as
virtio-console).
- NetworkConfig (macOS) + network_stub.rs (non-macOS) mirror the
crosvm pattern; setup() fails closed in Phase 1.
- RunningVm placeholder; start() fails closed, stop() is an
idempotent no-op (matches crosvm semantics on already-stopped VMs).
- src/ffi/ placeholder documents the Phase 2 fill-in (per-class
wrappers for VZLinuxBootLoader, VZVirtioBlockDeviceConfiguration,
VZVirtioSocketDeviceConfiguration, etc.).
- objc2-virtualization 0.3.2 declared as a target-conditional dep
(cfg(target_os = "macos") only). Not yet `use`d in any function
body.
- 27 unit tests + 10 smoke tests; cargo clippy clean.
Wired into elastos-server:
- elastos-vz added as a platform-conditional dep
(cfg(target_os = "macos") only). Linux build is byte-equivalent.
- main.rs::create_runtime gets a SIBLING #[cfg(target_os = "macos")]
registration block after the crosvm block. The crosvm block at
L1862–L1876 is not touched.
- supervisor.rs::launch_capsule cfg-gates the bail at L931:
• Linux: identical behavior to pre-Vz commit.
• macOS: fails closed with PHASE_1_STUB_MESSAGE so capsule
launches surface the Phase status with a clear "Phase 2"
marker rather than the (misleading) /dev/kvm message.
• Other OS: bails with "no microVM substrate available".
Linux-untouched gate:
- scripts/check-linux-untouched.sh diffs the four protected
crates (elastos-crosvm, elastos-runtime, elastos-common,
elastos-compute) against a base ref and fails non-zero on any
modification. Verified clean against Phase 0 baseline (a65dad3).
Phase 1 prelude tool:
- scripts/dev/mac-vz-feature-check/ — placeholder for the
desk-research-confirming feature probe described in
docs/vz-backend/PHASE_0_SCOPE.md appendix A. To be filled in
Phase 1 Day 2 before Phase 2 begins.
Verification gates passed:
- cargo build -p elastos-vz (macOS) ✅
- cargo build --workspace (macOS) ✅
- cargo test -p elastos-vz (37 tests) ✅
- cargo clippy -p elastos-vz --all-targets (-D warnings) ✅
- cargo clippy -p elastos-server ✅
- runtime start logs:
"vz provider enabled (Apple Virtualization.framework
available; Phase 1 stub — microVM launch fails closed)"
- protected crates touched: 0
Three pre-existing setup.rs test failures (darwin-arm64 component
lookup) are inherited from Pre-Work commit 9fc4a7e and are not
introduced or worsened by this commit.
Linux behavior: byte-equivalent. Mac behavior: registration scaffolded,
launch path fail-closed with Phase 2 marker. No Vz API calls.
Co-authored-by: Cursor <cursoragent@cursor.com>
description = "ElastOS Apple Virtualization.framework Compute Provider — Run capsules in real microVMs on macOS (Phase 1: scaffold; no Vz API calls yet)"
7
+
8
+
[dependencies]
9
+
elastos-common = { path = "../elastos-common" }
10
+
elastos-compute = { path = "../elastos-compute" }
11
+
12
+
tokio = { version = "1.0", features = ["full", "process"] }
13
+
serde = { version = "1.0", features = ["derive"] }
14
+
serde_json = "1.0"
15
+
uuid = { version = "1.0", features = ["v4"] }
16
+
async-trait = "0.1"
17
+
tracing = "0.1"
18
+
thiserror = "1.0"
19
+
libc = "0.2"
20
+
21
+
# Apple Virtualization.framework bindings — fetched and linked ONLY on macOS.
22
+
# On Linux the crate compiles as a stub (`is_supported()` returns false,
23
+
# every entry point fails closed) so the workspace build stays green and
24
+
# nothing is silently downgraded. The choice is anchored in
25
+
# docs/vz-backend/PHASE_0_SCOPE.md §A. Phase 1 declares the dependency but
26
+
# does not `use` it in any function body — actual Vz calls land in Phase 2.
27
+
[target.'cfg(target_os="macos")'.dependencies]
28
+
objc2 = "0.6"
29
+
objc2-virtualization = "0.3"
30
+
objc2-foundation = "0.3"
31
+
block2 = "0.6"
32
+
dispatch2 = "0.3"
33
+
34
+
[dev-dependencies]
35
+
tokio = { version = "1.0", features = ["full", "test-util"] }
0 commit comments