According to https://github.com/actions/runner-images/issues/7522 this is a race condition with XProtect
in MacOs ≥ 13 ⇒ CMake clearly isn't causing this. But we could make it work around the issue by waiting a second on failure in this step and retrying the command afterwards.
I don't own a mac computer, but encounter this issue on a Github Actions runner (see for example https://github.com/wxMaxima-developers/wxmaxima/actions/runs/7862494985/job/21452044449#step:9:24) issuing the command
cpack -G DragNDrop
the only strange thing in my CMakeLists.txt
I am aware of doing is the typical link magic that makes the binary work on every Mac:
elseif(APPLE)
set(MACOSX_BUNDLE_NAME wxmaxima)
set(MACOSX_BUNDLE_ICON_FILE wxmac.icns)
set(MACOSX_BUNDLE TRUE)
list(APPEND SOURCE_FILES ${RESOURCE_FILES})
add_executable(wxmaxima ${SOURCE_FILES})
set_target_properties(wxmaxima PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
RESOURCE "${RESOURCE_FILES}"
)
install(
# The bundle utilities need to be run in a
# separate step, meaning from within a string.
# they provide the fixup command that makes the
# .dylibs run from within the app bundle.
CODE "include(BundleUtilities)
# the separate step doesn't know about
# the values our variables had in the
# cmakefile so we need to set them again.
set(BU_CHMOD_BUNDLE_ITEMS TRUE)
fixup_bundle(\"${CMAKE_BINARY_DIR}/src/wxmaxima.app\" \"\" \"\")"
COMPONENT Runtime)
else()
add_executable(wxmaxima ${SOURCE_FILES})
endif()
Yet another use case: ctest is unable to kill the application I develop (wxMaxima) on timeout - which is bad, if the test halts only when run on a CI that discards any output if the job runs longer than a few hours. If the program were killed by a signal that actually kills the program I would get diagnostic output, instead.