diff --git a/.github/workflows/probe-macos-runner.yml b/.github/workflows/probe-macos-runner.yml new file mode 100644 index 0000000..8270fd1 --- /dev/null +++ b/.github/workflows/probe-macos-runner.yml @@ -0,0 +1,133 @@ +# Throwaway diagnostic: answers the open questions about the arm64 macOS runner before we +# commit to a macOS CI leg. Delete once it has told us what we need. +# +# 1. Is HVF usable, or is the runner itself a VM without nested virt? +# 2. Does the virgl QEMU install from a bottle (fast) or build from source (30-60 min)? +# 3. Does `-display cocoa,gl=es` work, i.e. is there a usable window server session? +# 4. Can we record the screen at all, or does TCC block it? +# +# macos-15 is arm64 AND matches the tap's only bottle tag (arm64_sequoia). +# macos-26/macos-latest is also arm64 but has no bottle, so it would build from source. +name: Probe macOS runner + +on: + workflow_dispatch: + +jobs: + probe: + name: Probe ${{ matrix.runner }} + runs-on: ${{ matrix.runner }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + runner: [macos-15] + + steps: + - name: Runner facts + run: | + echo "arch: $(uname -m)" + sw_vers + echo "hv_support: $(sysctl -n kern.hv_support 2>&1)" + echo "GUI session: $(launchctl managername 2>&1)" + echo "console user:"; stat -f%Su /dev/console 2>&1 + + - name: Install virgl QEMU + id: install + run: | + start=$(date +%s) + brew tap startergo/qemu-virgl-kosmickrisp + # Fails loudly if it decides to build from source; we want to know. + brew install startergo/qemu-virgl-kosmickrisp/qemu + echo "elapsed=$(( $(date +%s) - start ))s" + + - name: QEMU capabilities + run: | + qemu-system-aarch64 --version | head -1 + echo "--- display backends:" + qemu-system-aarch64 -display help + echo "--- virtio-gpu devices:" + qemu-system-aarch64 -device help 2>&1 | grep -i virtio-gpu || echo "(none)" + + - name: Is HVF usable? + run: | + set +e + out=$(timeout 10 qemu-system-aarch64 -machine virt -accel hvf -cpu host \ + -m 256 -display none -S 2>&1); rc=$? + echo "$out" + # timeout kills a healthy QEMU with 124/143; anything else means it refused to start + case $rc in + 124 | 143) echo "RESULT: HVF works" ;; + *) echo "RESULT: HVF unavailable (rc=$rc) -- an arm64 guest would fall back to TCG" ;; + esac + + - name: Does cocoa + GL work? + run: | + set +e + out=$(timeout 10 qemu-system-aarch64 -machine virt -accel hvf -cpu host -m 256 \ + -device virtio-gpu-gl-pci -display cocoa,gl=es -S 2>&1); rc=$? + echo "$out" + case $rc in + 124 | 143) echo "RESULT: cocoa+gl=es works" ;; + *) echo "RESULT: cocoa+gl=es failed (rc=$rc)" ;; + esac + + # UTM is the alternative to the virgl tap: it bundles a GL-capable QEMU, needs no source + # build and no third-party tap trust, and exposes QEMU flags via + # QEMU.AdditionalArguments plus a utmctl CLI. Its one unknown is whether a GUI .app can + # run on a runner at all -- which is exactly what this step answers. + - name: Does UTM run here? + run: | + set +e + start=$(date +%s) + brew install --cask utm 2>&1 | tail -5 + echo "cask install: $(( $(date +%s) - start ))s" + + utmctl=/Applications/UTM.app/Contents/MacOS/utmctl + test -x "$utmctl" || { echo "RESULT: UTM did not install"; exit 0; } + + open -a UTM + sleep 20 + pgrep -fl UTM.app | head -3 + + echo "--- utmctl list:" + "$utmctl" list 2>&1 | head -10 + rc=$? + if [ $rc -eq 0 ]; then + echo "RESULT: UTM runs and utmctl responds" + else + echo "RESULT: UTM installed but utmctl failed (rc=$rc) -- likely no window server" + fi + + - name: Can we record the screen? + run: | + brew install ffmpeg + set +e + + echo "=== screencapture ===" + timeout 20 screencapture -v -V 5 /tmp/screencapture.mov 2>&1 + echo "rc=$?"; ls -l /tmp/screencapture.mov 2>&1 + + echo "=== ffmpeg avfoundation: device list ===" + ffmpeg -hide_banner -f avfoundation -list_devices true -i "" 2>&1 | head -20 + + echo "=== ffmpeg avfoundation: 5s capture ===" + timeout 30 ffmpeg -hide_banner -y -f avfoundation -framerate 10 -i "1:none" \ + -t 5 /tmp/ffmpeg.mov 2>&1 | tail -15 + echo "rc=$?"; ls -l /tmp/ffmpeg.mov 2>&1 + + echo "=== verdict ===" + for f in /tmp/screencapture.mov /tmp/ffmpeg.mov; do + if [ -s "$f" ]; then echo "$f: $(stat -f%z "$f") bytes -- CAPTURED" + else echo "$f: empty or missing -- BLOCKED"; fi + done + + - name: Upload whatever was captured + if: always() + uses: actions/upload-artifact@v4 + with: + name: macos-probe-${{ matrix.runner }} + path: | + /tmp/screencapture.mov + /tmp/ffmpeg.mov + if-no-files-found: warn