Skip to content

Commit

Permalink
Try to fix codesign / symlink issue - remove dead symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
olsen232 committed Nov 23, 2023
1 parent c956505 commit 1f3e0b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ if(MACOS)
COMMAND ${XCODE_CODESIGN} --display --verbose \"\${CHECK_DIR}/\${CPACK_PACKAGE_FILE_NAME}/Kart.app\"
COMMAND_ECHO STDERR
COMMAND_ERROR_IS_FATAL ANY)
# codesign --verify --strict=all only works in macOS 15 and later,
# a bug in earlier versions means it fails with 'file not found'
# codesign --verify --strict=all would be better but it is broken in recent XCode versions:
# an arg-parsing / arg-forwarding bug means it fails with 'file not found'
execute_process(
COMMAND ${XCODE_CODESIGN} --verify --verbose --deep \"\${CHECK_DIR}/\${CPACK_PACKAGE_FILE_NAME}/Kart.app\"
COMMAND ${XCODE_CODESIGN} --verify --strict=symlinks --verbose --deep \"\${CHECK_DIR}/\${CPACK_PACKAGE_FILE_NAME}/Kart.app\"
COMMAND_ECHO STDERR
COMMAND_ERROR_IS_FATAL ANY)
Expand Down
6 changes: 3 additions & 3 deletions cmake/KartBundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ elseif(MACOS AND MACOS_SIGN_BUNDLE)
--strict --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos/entitlements.plist -o
runtime pyinstaller/dist/Kart.app
COMMAND ${XCODE_CODESIGN} --display --verbose pyinstaller/dist/Kart.app
# codesign --verify --strict=all only works in macOS 15 and later,
# a bug in earlier versions means it fails with "file not found"
COMMAND ${XCODE_CODESIGN} --verify --verbose --deep pyinstaller/dist/Kart.app
# codesign --verify --strict=all would be better but it is broken in recent XCode versions: an
# arg-parsing / arg-forwarding bug means it fails with 'file not found'
COMMAND ${XCODE_CODESIGN} --verify --strict=symlinks --verbose --deep pyinstaller/dist/Kart.app
COMMAND ${CMAKE_COMMAND} -E touch pyinstaller/codesign.stamp
VERBATIM
COMMENT "Code-signing macOS bundle")
Expand Down
6 changes: 6 additions & 0 deletions kart.spec
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ if USE_CLI_HELPER and dist_contents_root != dist_bin_root:
(dist_contents_root / f"kart{exe_suffix}").rename(
dist_bin_root / f"kart{exe_suffix}"
)
if is_darwin:
# There could be a symlink in Resources that points to the file we just moved out of Frameworks.
# We don't want any such symlinks since the kart executable only works from dist_bin_root anyway.
p = Path(DISTPATH) / "Kart.app" / "Contents" / "Resources" / f"kart{exe_suffix}"
if p.is_symlink():
p.unlink()


# Ideally we'd do this before BUNDLE so it could sign it on macOS, but we
Expand Down

0 comments on commit 1f3e0b9

Please sign in to comment.