From 64b2c0f0eb37c2d7452ae608582878db40919ec4 Mon Sep 17 00:00:00 2001 From: fwcd Date: Mon, 8 Jul 2024 18:27:25 +0200 Subject: [PATCH] Update XProtect workaround --- .github/workflows/build.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38217b2..f50cdb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,24 +122,6 @@ jobs: echo "==> Build environment" xcode-select -p xcrun --show-sdk-version - # TODO: Replace this with a better solution - # See https://github.com/actions/runner-images/issues/7522 - - name: Disable XProtect to work around race condition in CPack - if: runner.os == 'macOS' - run: | - set +e - set -x - daemons=( - com.apple.XProtect.daemon.scan - com.apple.XprotectFramework.PluginService - com.apple.XprotectFramework.scan - com.apple.metadata.mds - com.apple.metadata.mds.index - ) - for daemon in "${daemons[@]}"; do - sudo launchctl unload -w "system/$daemon" - echo " -> $?" - done # TODO: Remove this workaround once CMake in GitHub's runner image is # updated to 3.29.2, i.e. the `PACKAGE_PREFIX_DIR` issue is fixed again (the @@ -238,7 +220,19 @@ jobs: key: ccache-${{ matrix.triplet }}-${{ env.mixxx_commit }}-${{ github.ref }}-${{ github.run_number }} - name: Package Mixxx if: matrix.package_extension && matrix.cpack_generator - run: cpack -G ${{ matrix.cpack_generator }} -V && mv *.${{ matrix.package_extension }} "mixxx-${{ env.mixxx_version }}-${{ matrix.triplet }}${{ matrix.suffix }}.${{ matrix.package_extension }}" + run: | + set -e + + # Work around 'Resource busy' errors likely caused by a race condition + # between hdiutil and CPack by killing XProtect. We should replace this + # with a better solution once fixed upstream. + # See https://github.com/actions/runner-images/issues/7522 + while true; do pkill -9 XProtect; sleep 0.2; done & + while pgrep XProtect; do sleep 0.5; done + + cpack -G ${{ matrix.cpack_generator }} -V + mv *.${{ matrix.package_extension }} \ + "mixxx-${{ env.mixxx_version }}-${{ matrix.triplet }}${{ matrix.suffix }}.${{ matrix.package_extension }}" working-directory: ${{ env.MIXXX_ROOT }}/build - name: Upload packaged Mixxx binaries if: matrix.package_extension && matrix.cpack_generator