mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
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:
@@ -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: |
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user