ci: test macOS HVF runtime#91
Open
Max042004 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GitHub-hosted macOS runners do not expose Apple's Hypervisor.framework (HVF):
the hosted runner OS itself runs inside a virtualization layer that withholds
HVF, so
hv_vm_create()returnsHV_UNSUPPORTED. Because of this, the existingbuild-macosjob can only compile elfuse and verify the HVF entitlement — itcan never actually boot a guest.
This PR adds a
runtime-macosjob that runs on a self-hosted Apple Siliconrunner (an M4 machine) where HVF is available, so the real runtime path —
booting a Linux guest under HVF + Rosetta — is exercised in CI for the first
time. The hosted
build-macosjob is unchanged and keeps gating builds asbefore; this job runs after it (
needs: build-macos).What the
runtime-macosjob doesruns-on: [self-hosted, macOS, arm64, hvf],needs: build-macos,60-minute timeout.
mainruns finish.if:): runs onpush, or on apull_requestonly whenthe PR is from the same repository (
head.repo.full_name == github.repository)and carries the
ci-hvflabel.the physical machine.
ci-hvflabel gates it further, so the single physical runner isn'ttied up by every same-repo PR — you opt a PR in by adding the label.
Steps, in order:
sw_vers,uname -a,sysctl kern.hv_support, assert thehost is
arm64.binutils,qemu) — only installswhat is missing.
objcopy/qemu-aarch64/python3./Library/Apple/usr/libexec/oah/RosettaLinux/rosettaexists; if not, itemits a
::error::with the exact install command and dumps theoahdirectory to aid debugging.
make elfuse).codesign.make test-hello,make test-multi-vcpu,make check, then the fullbash tests/test-matrix.sh allmatrix.Self-hosted runner setup — must be done by @jserv
This job targets a physical Apple Silicon (M4) machine. Registering and
configuring that runner requires admin rights on
sysprog21/elfuseplusphysical/admin access to the machine, so it can only be done by @jserv — I
(the fork author) cannot set this up from my side. The following one-time setup
is needed on the runner host before the job can go green:
sysprog21/elfuse(Settings → Actions → Runners → New self-hosted runner). Requires repo/org
admin permission — only @jserv has this.
self-hosted,macOS,arm64,hvf.The job's
runs-onmatches on all four.binutilsandqemu(the job auto-installs anythat are missing, but Homebrew itself must be present).
ci-hvflabel in the repo so same-repo PRs can opt in.Until @jserv registers and labels the runner, the
runtime-macosjob staysqueued/pending; nothing else in CI is affected.
Summary by cubic
Add a self-hosted macOS (Apple Silicon, HVF) CI job to run runtime tests on M4 hardware. It builds
elfuseand executes the test matrix under HVF.New Features
runtime-macosjob with labels[self-hosted, macOS, arm64, hvf]; depends onbuild-macosand uses per-ref concurrency.ci-hvf.actions/checkout@v6and caches Homebrew downloads viaactions/cache@v5.binutilsandqemu; setsGNU_OBJCOPYand toolchain env.make check, and the full test matrix.Migration
self-hosted, macOS, arm64, hvf.binutilsandqemuinstalled.Written for commit a6261c8. Summary will update on new commits.