Try to kill XProtect before running Mac CI (#30779)

This is an attempt to fix errors on the Mac CI when running `hdiutil`
that look like this:

```
Run python3 ./mach package --release
hdiutil: create failed - Resource busy
Creating Servo.app
Copying files
Swapping prefs
Finding dylibs and relinking
Adding version to Credits.rtf
Creating dmg
Packaging MacOS dmg exited with return value 1
Error: Process completed with exit code 1.
```

This approach was taken from
https://github.com/actions/runner-images/issues/7522.
This commit is contained in:
Martin Robinson 2023-11-24 11:26:36 +01:00 committed by GitHub
parent 5b08febe88
commit 6dec39e959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,6 +56,13 @@ jobs:
name: Mac Build
runs-on: macos-13
steps:
# XProtect can cause random failures if it decides that the DMG we create
# during the packaging phase is malware.
# TODO(mrobinson): Is there a way we can do things in a less suspicious way so
# we don't have to kill this service?
- name: Kill XProtectBehaviorService
run: |
echo Killing XProtect.; sudo pkill -9 XProtect >/dev/null || true;
- uses: actions/checkout@v3
if: github.event_name != 'pull_request_target'
with: