fixes the GitHub Actions CPack failure on macOS (#6074)

* fixes the GitHub Actions CPack failure on macOS

* Disables Spotlight indexing which can interfere with disk image operations
* Implements retry logic (waits 5 seconds and retries once if CPack fails)
This commit is contained in:
Scot Breitenfeld
2025-12-02 12:42:18 -06:00
committed by GitHub
parent bd76ec789a
commit 083eb93a3c
3 changed files with 37 additions and 3 deletions
+7 -1
View File
@@ -380,8 +380,14 @@ jobs:
working-directory: ${{ runner.workspace }}/build
- name: Run Package
run: cpack -C ${{ inputs.build_mode }} -V
run: |
# Disable indexing to prevent file locking during CPack
sudo mdutil -i off / || true
# Run cpack with retry
cpack -C ${{ inputs.build_mode }} -V || (sleep 5 && cpack -C ${{ inputs.build_mode }} -V)
working-directory: ${{ runner.workspace }}/build
shell: bash
- name: List files in the space
run: |
+11 -1
View File
@@ -308,8 +308,18 @@ jobs:
if: ${{ matrix.run_tests }}
- name: Run Package
run: cpack -C ${{ inputs.build_mode }} -V
run: |
if [[ "${{ matrix.ostype }}" == "macos" ]]; then
# Disable indexing to prevent file locking during CPack
sudo mdutil -i off / || true
# Run cpack with retry
cpack -C ${{ inputs.build_mode }} -V || (sleep 5 && cpack -C ${{ inputs.build_mode }} -V)
else
cpack -C ${{ inputs.build_mode }} -V
fi
working-directory: ${{ runner.workspace }}/build
shell: bash
# if: ${{ (matrix.ostype != 'macos') && (inputs.build_mode != 'Debug') }}
# - name: Run Package (Mac_latest)
+19 -1
View File
@@ -306,8 +306,26 @@ jobs:
id: buildhdf5
shell: bash
run: |
# macOS: Disable Spotlight indexing to prevent file locking during CPack
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "Disabling Spotlight indexing temporarily"
sudo mdutil -i off / || true
fi
cd "${{ github.workspace }}"
cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh
# Run workflow with retry logic for macOS CPack failures
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "Running CMake workflow with macOS retry logic..."
if ! cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh; then
echo "⚠️ First attempt failed, retrying in 5 seconds..."
sleep 5
cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh
fi
else
# Non-macOS: run normally without retry
cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh
fi
- name: Extract version information
id: version-info