ci: add self-hosted macOS HVF runtime job#91
Open
Max042004 wants to merge 1 commit into
Open
Conversation
b18134f to
5186357
Compare
jserv
requested changes
Jun 16, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Improve Git commit messages to properly describe changes related to the self-hosted macOS runner.
Contributor
|
Refine the descriptions of both pull request body and commit message to address the close of #51 . |
2e06673 to
a30de42
Compare
a46bdff to
8502cb8
Compare
Hypervisor.framework needs real Apple Silicon hardware, so the hosted build-macos job can only compile elfuse and check the entitlement, never boot a guest. Add a runtime-macos job on a self-hosted Apple Silicon runner ([self-hosted, macOS, arm64]) that actually exercises the VM under HVF. The job is scoped to the upstream repository with github.repository == 'sysprog21/elfuse', so it runs for pushes to main and for pull_requests targeting main -- including PRs opened from a collaborator's fork -- but never inside a fork's own Actions context, so a branch pushed to a fork without an upstream PR triggers nothing. Untrusted outside fork PRs are held by the repository's "require approval for outside collaborators" setting, so a maintainer still gates every outside run without needing a head-ref guard or a label. The job runs after build-macos, serializes per ref through a concurrency group, and cancels in-progress runs only for pull requests. It asserts the host is arm64, reports kern.hv_support, caches and installs just the missing Homebrew packages (binutils, qemu), and fails early with install guidance when Rosetta for Linux is absent. After make elfuse it confirms the com.apple.security.hypervisor entitlement is codesigned into build/elfuse, then runs test-hello, test-multi-vcpu, make check, and tests/test-matrix.sh all.
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.
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).Closes #51.
What the
runtime-macosjob doesruns-on: [self-hosted, macOS, arm64],needs: build-macos, 60-minutetimeout.
mainruns finish.Where it runs (trigger gating)
The job is fenced by:
github.repositoryis the repository the workflow actually runs in, so thissingle check expresses exactly when the physical runner should be used:
main— runs. Apull_requestfrom any fork is evaluatedin the upstream (
sysprog21/elfuse) Actions context, so a collaborator whopushes a branch to their own fork and opens a PR against upstream gets the
full runtime suite. This is the normal contributor flow and must work.
main— runs. Post-merge validation on the mainline.without opening an upstream PR (or a fork's own
workflow_dispatch) runs inthe fork's context, where
github.repositoryis the fork, so the job isskipped and never queues against a runner the fork doesn't have.
Note this intentionally does not use a
head.repo == base.repoguard(which would reject every collaborator PR, since those come from forks) and does
not require a
ci-hvflabel. The trust boundary for untrusted outsidefork PRs is the repository setting Settings → Actions → General → "Require
approval for all outside collaborators" (or stricter): such PRs cannot start
any workflow run until a maintainer approves them. A maintainer reviewing the
diff before approving — and never approving fork PRs that touch
.github/workflows/— remains the real gate, exactly aspull_request_target/workflow_runare avoided here.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.