Skip to content

Conversation

@psavery
Copy link
Collaborator

@psavery psavery commented Dec 17, 2024

Race conditions with XProtect on macos-13 can cause spurious failures
for hdiutil create commands.

As a work-around, try the hdiutil create command several times (up
to 10), and only fail if the command fails each time.

@psavery psavery force-pushed the fix-hdiutil-spurious-failures branch from 0a072b1 to 2b079f3 Compare December 17, 2024 17:51
Race conditions with XProtect on macos-13 can cause spurious failures
for `hdiutil create` commands.

As a work-around, try the `hdiutil create` command several times (up
to 10), and only fail if the command fails each time.

Signed-off-by: Patrick Avery <[email protected]>
@psavery psavery force-pushed the fix-hdiutil-spurious-failures branch from 2b079f3 to 0d9baee Compare December 17, 2024 19:17
@psavery psavery marked this pull request as ready for review December 17, 2024 23:22
@psavery psavery requested a review from bnmajor December 17, 2024 23:22
Copy link
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@psavery psavery merged commit 164b618 into master Dec 18, 2024
9 checks passed
@psavery psavery deleted the fix-hdiutil-spurious-failures branch December 18, 2024 13:59
jurzik added a commit to vanillapdf/vanillapdf that referenced this pull request Sep 29, 2025
- Add scripts/hdiutil_retry.sh to work around XProtect race conditions
- Configure CPack to use retry script on macOS (CPACK_COMMAND_HDIUTIL)
- Script retries hdiutil create up to 10 times with 1-second delays
- Based on workaround from HEXRD project: HEXRD/hexrdgui#1768

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
jurzik added a commit to vanillapdf/vanillapdf that referenced this pull request Oct 4, 2025
…146)

* fix: Add hdiutil retry script to resolve macOS CPack build failures

- Add scripts/hdiutil_retry.sh to work around XProtect race conditions
- Configure CPack to use retry script on macOS (CPACK_COMMAND_HDIUTIL)
- Script retries hdiutil create up to 10 times with 1-second delays
- Based on workaround from HEXRD project: HEXRD/hexrdgui#1768

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix: Ensure hdiutil_retry.sh has execute permissions

- Mark scripts/hdiutil_retry.sh as executable in Git index
- Fixes "permission denied" error when CPack tries to execute the script
- Resolves macOS DMG creation failures in GitHub Actions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix: Improve hdiutil retry script for macOS XProtect race conditions

- Use full path to hdiutil (/usr/bin/hdiutil) to avoid PATH issues
- Increase retry delay from 1s to 2s to give XProtect more time
- Redirect error messages to stderr for better logging
- Add reference to CMake issue #25671
- Improve error messages to show which hdiutil command failed

Related: https://gitlab.kitware.com/cmake/cmake/-/issues/25671

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants