Skip to content

Commit 8e9136b

Browse files
authored
fix(vm): codesign macOS driver-vm with hypervisor entitlement in CI (#3507)
The release tarball ships an unsigned binary that fails at runtime when Hypervisor.framework rejects the caller. Sign with the existing entitlements plist during the build, before artifact upload. Closes #3506 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
1 parent a48920a commit 8e9136b

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎.github/actions/build-rust-binary/action.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: Additional flags passed to cargo build
3030
required: false
3131
default: ""
32+
entitlements-file:
33+
description: Path to an entitlements plist for macOS ad-hoc codesigning (skipped when empty or not on macOS)
34+
required: false
35+
default: ""
3236
runs:
3337
using: composite
3438
steps:
@@ -66,6 +70,15 @@ runs:
6670
# Confirm Syft can decode the embedded cargo-auditable metadata.
6771
SYFT_CHECK_FOR_APP_UPDATE=false syft "file:${binary}" -o cyclonedx-json | grep 'pkg:cargo/' > /dev/null
6872
73+
- name: Codesign with entitlements
74+
if: inputs.entitlements-file != '' && runner.os == 'macOS'
75+
shell: bash
76+
env:
77+
INPUTS_ENTITLEMENTS: ${{ inputs.entitlements-file }}
78+
INPUTS_TRIPLE: ${{ inputs.triple }}
79+
INPUTS_BINARY: ${{ inputs.binary }}
80+
run: /usr/bin/codesign --entitlements "${INPUTS_ENTITLEMENTS}" --force -s - "target/${INPUTS_TRIPLE}/release/${INPUTS_BINARY}"
81+
6982
- name: Upload ${{ inputs.binary }}
7083
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
7184
with:

‎.github/workflows/build-vm-driver.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- arch: aarch64
4040
triple: aarch64-apple-darwin
4141
runner: macos-15-xlarge
42+
entitlements-file: crates/openshell-driver-vm/entitlements.plist
4243
runs-on: ${{ matrix.runner }}
4344
timeout-minutes: 60
4445
defaults:
@@ -109,3 +110,4 @@ jobs:
109110
triple: ${{ matrix.triple }}
110111
cargo-version: ${{ inputs['cargo-version'] }}
111112
supervisor-image-tag: ${{ inputs['supervisor-image-tag'] }}
113+
entitlements-file: ${{ matrix.entitlements-file }}

0 commit comments

Comments
 (0)