Re-enable macOS CI with DevToolsSecurity configuration and automatic code signing
Re-enable macOS CI with debugging support
Completed
- [x] Uncomment the MacOS job in
.github/workflows/build.yaml - [x] Add DevToolsSecurity step to enable debugging on macOS runner
- [x] Modified Makefile to auto-sign binaries when built on macOS
- [x] Use prerequisite instead of recursive make for signing
- [x] Removed redundant pre-build step from workflow
- [x] Update
.mergify.ymlto require macOS CI for merging
Latest Changes (commit addressing review feedback)
Makefile Improvement: Changed from using recursive make (@$(MAKE) sign) to using sign as a prerequisite of all. This is cleaner and more idiomatic:
-
all: $(TARGETS) signensuressignruns after building -
sign: $(TARGETS)guarantees binaries exist before signing - Removed the file existence check since the dependency ensures binaries are built
How It Works
The run_tests script builds test binaries with make -j all. The Makefile now:
- Builds all targets in parallel when using
-j - Runs the
signtarget after all targets are built (dependency ensures correct order) - Signs binaries on macOS with the required entitlements for debugging
Original prompt
Problem
In PR #949, macOS CI tests that use debuggers were disabled because upgrading from
macos-13tomacos-14caused debugger-related tests to fail. The issue is that newer macOS versions have stricter security requirements for debugging.The previous attempt in PR #949 added:
- An
entitlements.plistfile withget-task-allowentitlement intests/testdata/cpp/simple/- A
make signtarget in the Makefile to codesign binaries with the entitlementHowever, this wasn't sufficient because DevToolsSecurity needs to be enabled on the runner before debuggers can attach to processes.
Solution
Re-enable the macOS CI job in
.github/workflows/build.yamlwith the following changes:
- Uncomment the MacOS job (lines 99-179 approximately)
- Add a step to enable DevToolsSecurity before running tests:
- name: 'Enable Developer Mode for debugging' run: | sudo DevToolsSecurity -enable sudo security authorizationdb write system.privilege.taskport allow- Add a step to sign test binaries before running tests:
- name: 'Sign test binaries for debugging' run: | cd tests/testdata/cpp/simple make clean all sign- Update
.mergify.ymlto uncomment thestatus-success=MacOS (vim)lines so that macOS CI is required again for merging.Files to modify
.github/workflows/build.yaml- Uncomment the MacOS job and add the DevToolsSecurity and signing steps.mergify.yml- Uncomment all the# - status-success=MacOS (vim)linesTesting
The PR should trigger the macOS CI job, which will validate that the fix works.
This pull request was created as a result of the following prompt from Copilot chat.
Problem
In PR #949, macOS CI tests that use debuggers were disabled because upgrading from
macos-13tomacos-14caused debugger-related tests to fail. The issue is that newer macOS versions have stricter security requirements for debugging.The previous attempt in PR #949 added:
- An
entitlements.plistfile withget-task-allowentitlement intests/testdata/cpp/simple/- A
make signtarget in the Makefile to codesign binaries with the entitlementHowever, this wasn't sufficient because DevToolsSecurity needs to be enabled on the runner before debuggers can attach to processes.
Solution
Re-enable the macOS CI job in
.github/workflows/build.yamlwith the following changes:
- Uncomment the MacOS job (lines 99-179 approximately)
- Add a step to enable DevToolsSecurity before running tests:
- name: 'Enable Developer Mode for debugging' run: | sudo DevToolsSecurity -enable sudo security authorizationdb write system.privilege.taskport allow- Add a step to sign test binaries before running tests:
- name: 'Sign test binaries for debugging' run: | cd tests/testdata/cpp/simple make clean all sign- Update
.mergify.ymlto uncomment thestatus-success=MacOS (vim)lines so that macOS CI is required again for merging.Files to modify
.github/workflows/build.yaml- Uncomment the MacOS job and add the DevToolsSecurity and signing steps.mergify.yml- Uncomment all the# - status-success=MacOS (vim)linesTesting
The PR should trigger the macOS CI job, which will validate that the fix works.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
@copilot it doesn't look like it's working. breakpoints.test.vim shouldn't take this long to run
@copilot it doesn't look like it's working. breakpoints.test.vim shouldn't take this long to run
Fixed in commit 8459907. The issue was that run_tests builds binaries with make -j all, but they weren't being signed. I updated the Makefile to automatically sign binaries on macOS after building them, so now whenever the tests build the binaries, they'll be properly signed for debugging.