Skip to content

Commit 8ab67bb

Browse files
committed
CI: fix QEMU binary signature
Workaround for: - lima-vm/lima issue 1742 - Homebrew/homebrew-core issue 140244 Signed-off-by: Akihiro Suda <[email protected]>
1 parent da1260d commit 8ab67bb

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
# Github runners seem to have lima installed by brew already; we don't want/need it
119119
time brew uninstall --ignore-dependencies lima colima
120120
time brew install qemu bash coreutils curl jq
121+
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
122+
run: ./hack/fix-qemu-signature.sh
121123
- name: "Show cache"
122124
run: ./hack/debug-cache.sh
123125
- name: "Test default.yaml"
@@ -272,6 +274,8 @@ jobs:
272274
run: make install
273275
- name: Install test dependencies
274276
run: brew install qemu bash coreutils iperf3
277+
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
278+
run: ./hack/fix-qemu-signature.sh
275279
- name: Install vde_switch and vde_vmnet (Deprecated)
276280
env:
277281
VDE_VMNET_VERSION: v0.6.0
@@ -341,6 +345,8 @@ jobs:
341345
key: ${{ runner.os }}-upgrade-${{ matrix.oldver }}
342346
- name: Install test dependencies
343347
run: brew install qemu bash coreutils
348+
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
349+
run: ./hack/fix-qemu-signature.sh
344350
- name: Test
345351
uses: nick-invision/retry@v2
346352
with:

hack/fix-qemu-signature.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
# This script fixes the signature of QEMU binary with the "com.apple.security.hypervisor" entitlement.
3+
#
4+
# A workaround for "QEMU (homebrew) is broken on Intel: `[hostagent] Driver stopped due to error: "signal: abort trap"` ..."
5+
#
6+
# https://github.com/lima-vm/lima/issues/1742
7+
# https://github.com/Homebrew/homebrew-core/issues/140244
8+
9+
set -eux
10+
11+
cat >entitlements.xml <<EOF
12+
<?xml version="1.0" encoding="UTF-8"?>
13+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
14+
<plist version="1.0">
15+
<dict>
16+
<key>com.apple.security.hypervisor</key>
17+
<true/>
18+
</dict>
19+
</plist>
20+
EOF
21+
22+
codesign --sign - --entitlements entitlements.xml --force "$(which qemu-system-"$(uname -m | sed -e s/arm64/aarch64/)")"
23+
24+
rm -f entitlements.xml

0 commit comments

Comments
 (0)