Skip to content

CI: fix QEMU binary signature #1757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ jobs:
# Github runners seem to have lima installed by brew already; we don't want/need it
time brew uninstall --ignore-dependencies lima colima
time brew install qemu bash coreutils curl jq
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
run: ./hack/fix-qemu-signature.sh
- name: "Show cache"
run: ./hack/debug-cache.sh
- name: "Test default.yaml"
Expand Down Expand Up @@ -272,6 +274,8 @@ jobs:
run: make install
- name: Install test dependencies
run: brew install qemu bash coreutils iperf3
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
run: ./hack/fix-qemu-signature.sh
- name: Install vde_switch and vde_vmnet (Deprecated)
env:
VDE_VMNET_VERSION: v0.6.0
Expand Down Expand Up @@ -341,6 +345,8 @@ jobs:
key: ${{ runner.os }}-upgrade-${{ matrix.oldver }}
- name: Install test dependencies
run: brew install qemu bash coreutils
- name: "Fix QEMU binary signature (Workaround for https://github.com/Homebrew/homebrew-core/issues/140244)"
run: ./hack/fix-qemu-signature.sh
- name: Test
uses: nick-invision/retry@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions hack/fix-qemu-signature.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# This script fixes the signature of QEMU binary with the "com.apple.security.hypervisor" entitlement.
#
# A workaround for "QEMU (homebrew) is broken on Intel: `[hostagent] Driver stopped due to error: "signal: abort trap"` ..."
#
# https://github.com/lima-vm/lima/issues/1742
# https://github.com/Homebrew/homebrew-core/issues/140244

set -eux

cat >entitlements.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
EOF

codesign --sign - --entitlements entitlements.xml --force "$(which qemu-system-"$(uname -m | sed -e s/arm64/aarch64/)")"

rm -f entitlements.xml