Skip to content

feat(desktop): package the signed codev-vmm helper on macOS - #204

Merged
quickbeard merged 1 commit into
mainfrom
vmm-packaging
Aug 12, 2026
Merged

quickbeard merged 1 commit into
mainfrom
vmm-packaging

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Ships the Virtualization.framework helper in packaged macOS builds — the last piece keeping the vz sandbox backend dev-only. vmmHelperPath() has expected process.resourcesPath/codev-vmm since the wiring PR; this makes it exist.

Changes

  • scripts/prebuild.ts: on macOS, builds the helper universal before packaging.
  • script/build-vzhelper.ts (fork-only): --universal now builds each slice with --triple and merges with lipo. Passing swift build multiple --arch flags delegates to xcbuild, which only full Xcode ships — Command Line Tools setups (like the build Mac) fail with "xcbuild executable does not exist". Universal also matters for packaging: @electron/universal copies an already-fat Mach-O through, where an identical thin binary in both halves would trip its identical-file check (the same one x64ArchFiles works around for node_modules).
  • electron-builder.config.ts: mac.extraResources ships the helper as Resources/codev-vmm, and an afterSign hook re-signs it with vzhelper.entitlements (com.apple.security.virtualization — an entitlement the Electron app itself neither has nor needs, so the app signing pass can't cover it). The hook reuses whatever identity signed the app — read from codesign --display — with hardened runtime, adding a timestamp only for non-ad-hoc identities, and runs before electron-builder's built-in notarization.

Verification

Real package:mac run on this branch, then inspected the produced .app:

  • Contents/Resources/codev-vmm present, lipo -info → x86_64 arm64
  • codesign --display → flags=0x10002(adhoc,runtime) (this machine has no Developer ID; a release machine's identity flows through the same path with --timestamp)
  • embedded entitlements → com.apple.security.virtualization = true
  • server-bundle also confirmed present beside it

Config test added (mac extraResource + afterSign wired); desktop config tests 10 pass, sandbox package 71 pass; DIVERGENCES rows updated (electron-builder row extended, new prebuild row).

Notarization with a real identity has not been exercised — worth watching on the first release build.

🤖 Generated with Claude Code

prebuild builds the vz helper universal (per-slice --triple builds
merged with lipo, since multi-arch swift build needs full Xcode's
xcbuild), mac.extraResources ships it as Resources/codev-vmm, and an
afterSign hook re-signs it with the virtualization entitlement — which
the app itself must not carry — under whatever identity signed the app,
hardened runtime on, before built-in notarization.

Verified on a real package:mac run: the packaged helper is fat
(x86_64+arm64), flagged adhoc,runtime, and carries
com.apple.security.virtualization.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit a362d75 into main Aug 12, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the vmm-packaging branch August 12, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant