Skip to content

Conversation

@i2h3
Copy link
Collaborator

@i2h3 i2h3 commented Jul 21, 2025

Due to security restrictions, a debugger cannot just attach to any process arbitrarily. Apps must not be hardened and their entitlements explicitly contain an entitlement which allows the retrieval of the task control port of a process.

This enables Xcode to successfully connect to the process of the NextcloudDev build by mac-crafter.

An example Xcode project and appropriate documentation how to leverage this to actually debug the Nextcloud desktop client in Xcode will follow.

@i2h3 i2h3 self-assigned this Jul 21, 2025
@i2h3 i2h3 added the os: 🍎 macOS Apple macOS, formerly also known as OS X label Jul 21, 2025
@i2h3 i2h3 requested review from camilasan, claucambra, Copilot, mgallien and nilsding and removed request for camilasan, mgallien and nilsding July 21, 2025 11:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables Xcode debugger support for the Nextcloud desktop client by conditionally disabling hardened runtime and adding debug entitlements for Debug builds. This allows developers to attach Xcode's debugger to the NextcloudDev build created by mac-crafter, which is normally prevented by macOS security restrictions.

  • Conditionally disables hardened runtime for Debug builds in CMake configuration
  • Adds com.apple.security.get-task-allow entitlement for Debug builds to allow debugger attachment
  • Configures entitlements template to include debug-specific entitlements when appropriate

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
CMakeLists.txt Conditionally disables hardened runtime for Debug builds
admin/osx/CMakeLists.txt Sets up debug entitlements variable based on build type
admin/osx/macosx.entitlements.cmake Adds placeholder for debug entitlements in template

@i2h3
Copy link
Collaborator Author

i2h3 commented Jul 21, 2025

While being completely unrelated to Linux app images, the failing check will most likely be resolved with #8475 which I will wait for to be integrated first.

@nilsding nilsding enabled auto-merge July 21, 2025 12:11
- Disable hardened runtime for debug builds.
- Add required get-task-allow entitlement conditionally.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
@nilsding nilsding force-pushed the xcode-debugger-enablement branch from 88716a8 to 99e7603 Compare July 21, 2025 12:11
@github-actions
Copy link

Artifact containing the AppImage: nextcloud-appimage-pr-8474.zip

SHA256 checksum: 9b7a8f4a31235c3a6ffa08caf8c99031f059d59eb44c5949e6a104657ae7d15d

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarqubecloud
Copy link

@nilsding nilsding merged commit 644d6a2 into master Jul 21, 2025
18 of 20 checks passed
@nilsding nilsding deleted the xcode-debugger-enablement branch July 21, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants