Skip to content

Commit 6372a13

Browse files
committed
fix: gate AppleVzHypervisor import behind cfg(target_os) for Linux build
boot.rs imported AppleVzHypervisor unconditionally. Now uses cfg gates to dispatch to KvmHypervisor on Linux.
1 parent 3988b4d commit 6372a13

7 files changed

Lines changed: 24 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Improved
1111
- **Boot timing display** -- formatted table with right-aligned columns and proportional bar chart instead of flat log lines.
12+
- **capsem-bench refactored to package** -- split 897-line single file into `capsem_bench/` Python package with per-category modules (disk, rootfs, startup, http_bench, throughput, snapshot). Shell wrapper at `capsem-bench` preserves the same CLI interface.
1213
- **capsem-bench JSON output** -- saved to `/tmp/capsem-benchmark.json` inside the VM instead of dumped to stdout.
1314

1415
### Docs
1516
- **Site restructuring** -- moved capsem-doctor to new top-level Debugging section (with troubleshooting guide), moved benchmarking methodology to Development, added top-level Benchmarks section with current performance results (boot time, disk I/O, CLI startup, HTTP, throughput, snapshots).
1617

18+
## [0.14.8] - 2026-03-29
19+
20+
### Fixed
21+
- **Linux build: gate all macOS-only APIs** -- `ApfsSnapshot` (`libc::clonefile`) and `AppleVzHypervisor` import in boot.rs were not `cfg`-gated, causing compile failures on Linux app builds. Boot now dispatches to `KvmHypervisor` on Linux.
22+
1723
## [0.14.7] - 2026-03-29
1824

1925
### Fixed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["crates/capsem-proto", "crates/capsem-core", "crates/capsem-app", "crates/capsem-agent", "crates/capsem-logger"]
44

55
[workspace.package]
6-
version = "0.14.7"
6+
version = "0.14.8"
77

88
# Always optimize blake3 -- its SIMD assembly is 100x faster than
99
# unoptimized Rust. Without this, debug-build hashing takes 24s for 2GB.

crates/capsem-app/src/boot.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ use std::sync::Arc;
66

77
use anyhow::{Context, Result};
88
use capsem_core::{
9-
AppleVzHypervisor, GuestToHost, Hypervisor, HostState, HostStateMachine, HostToGuest,
9+
GuestToHost, Hypervisor, HostState, HostStateMachine, HostToGuest,
1010
VirtioFsShare, VmConfig, VmHandle, VsockConnection, decode_guest_msg, encode_host_msg,
1111
MAX_FRAME_SIZE, VSOCK_PORT_CONTROL, VSOCK_PORT_MCP_GATEWAY, VSOCK_PORT_SNI_PROXY,
1212
VSOCK_PORT_TERMINAL,
1313
};
14+
#[cfg(target_os = "macos")]
15+
use capsem_core::AppleVzHypervisor;
16+
#[cfg(target_os = "linux")]
17+
use capsem_core::KvmHypervisor;
1418
use capsem_core::net::cert_authority::CertAuthority;
1519
use capsem_core::net::mitm_proxy;
1620
use capsem_core::net::policy_config;
@@ -137,7 +141,11 @@ pub(crate) fn boot_vm(
137141

138142
let (vm, vsock_rx) = {
139143
let _span = debug_span!("hypervisor_boot").entered();
140-
AppleVzHypervisor.boot(&config, &vsock_ports)
144+
#[cfg(target_os = "macos")]
145+
let result = AppleVzHypervisor.boot(&config, &vsock_ports);
146+
#[cfg(target_os = "linux")]
147+
let result = KvmHypervisor.boot(&config, &vsock_ports);
148+
result
141149
.context("failed to boot VM")?
142150
};
143151

crates/capsem-app/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-utils/schema.json",
33
"productName": "Capsem",
4-
"version": "0.14.7",
4+
"version": "0.14.8",
55
"identifier": "com.capsem.capsem",
66
"build": {
77
"beforeDevCommand": "pnpm dev",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "capsem"
3-
version = "0.14.7"
3+
version = "0.14.8"
44
requires-python = ">=3.11"
55
dependencies = [
66
"pydantic>=2.0",

site/src/content/docs/releases/0-14.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ The settings system is now fully config-driven with Pydantic as the canonical sc
5959

6060
## Patch Releases
6161

62+
### 0.14.8
63+
64+
- **Linux build fix** -- gated all macOS-only APIs (`ApfsSnapshot`, `AppleVzHypervisor`) behind `cfg(target_os)`. Boot dispatches to `KvmHypervisor` on Linux.
65+
6266
### 0.14.7
6367

6468
- **Linux build fix** -- `ApfsSnapshot` used `libc::clonefile` (macOS-only) without a `cfg` gate, breaking Linux app compilation.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)