Skip to content

fix(macOS): skip build-tree RPATH to prevent install_name_tool conflict - #9509

Merged
mgallien merged 1 commit into
masterfrom
i2h3/fix/skip-build-tree-rpath
Feb 24, 2026
Merged

fix(macOS): skip build-tree RPATH to prevent install_name_tool conflict#9509
mgallien merged 1 commit into
masterfrom
i2h3/fix/skip-build-tree-rpath

Conversation

@i2h3

@i2h3 i2h3 commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

CMake automatically adds the binary's RUNTIME_OUTPUT_DIRECTORY (work/build/bin) to the nextcloud executable's RPATH at build time. macdeployqt runs as a POST_BUILD step and replaces that path with @loader_path/../Frameworks (the self-contained bundle convention). When cmake --install then runs, it tries to remove the original build-tree RPATH via install_name_tool -delete_rpath, but macdeployqt has already eliminated it, causing:

install_name_tool: no LC_RPATH load command with path:
.../work/build/bin found in: .../NextcloudDev

Set BUILD_WITH_INSTALL_RPATH TRUE on the nextcloud target inside the BUILD_OWNCLOUD_OSX_BUNDLE block. This tells CMake to use the install RPATH (empty for a macOS bundle) during build rather than a separate build-tree RPATH, so no install_name_tool fixup is generated at cmake --install time.

@i2h3 i2h3 added this to the 33.0.0 milestone Feb 24, 2026
@i2h3 i2h3 self-assigned this Feb 24, 2026
Copilot AI review requested due to automatic review settings February 24, 2026 16:01
@i2h3 i2h3 added the os: 🍎 macOS Apple macOS, formerly also known as OS X label Feb 24, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Feb 24, 2026
@i2h3

i2h3 commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-33.0

@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Feb 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts macOS bundle build settings to prevent cmake --install from attempting an install_name_tool -delete_rpath on RPATH entries that macdeployqt has already removed during POST_BUILD.

Changes:

  • Set BUILD_WITH_INSTALL_RPATH TRUE for the nextcloud macOS bundle target to avoid build-tree RPATH tracking and install-time deletion attempts.
  • Set BUILD_WITH_INSTALL_RPATH TRUE for the nextcloudsync_vfs_suffix plugin target on Apple, addressing the same install-time RPATH deletion conflict after macdeployqt.

Reviewed changes

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

File Description
src/libsync/vfs/suffix/CMakeLists.txt Ensures the suffix VFS plugin builds using the install RPATH on macOS to avoid install-time install_name_tool conflicts.
src/gui/CMakeLists.txt Ensures the main nextcloud bundle target builds with install RPATH so cmake --install doesn’t try to delete a build-tree RPATH that macdeployqt already removed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libsync/vfs/suffix/CMakeLists.txt

@nilsding nilsding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FYI: this is also included in #9510

CMake automatically adds the binary's RUNTIME_OUTPUT_DIRECTORY
(work/build/bin) to the nextcloud executable's RPATH at build time.
macdeployqt runs as a POST_BUILD step and replaces that path with
@loader_path/../Frameworks (the self-contained bundle convention).
When cmake --install then runs, it tries to remove the original
build-tree RPATH via install_name_tool -delete_rpath, but macdeployqt
has already eliminated it, causing:

  install_name_tool: no LC_RPATH load command with path:
  .../work/build/bin found in: .../NextcloudDev

Set BUILD_WITH_INSTALL_RPATH TRUE on the nextcloud target inside the
BUILD_OWNCLOUD_OSX_BUNDLE block. This tells CMake to use the install
RPATH (empty for a macOS bundle) during build rather than a separate
build-tree RPATH, so no install_name_tool fixup is generated at
cmake --install time.

Signed-off-by: Iva Horn <[email protected]>
@mgallien
mgallien enabled auto-merge February 24, 2026 19:26
@mgallien
mgallien force-pushed the i2h3/fix/skip-build-tree-rpath branch from ef5a935 to d1090ba Compare February 24, 2026 19:26
@github-actions

Copy link
Copy Markdown
Contributor

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

Digest: sha256:e266df1ddb2904498110ded9d3eb766b00041b20291eaf76ea5aa45ffa73660d

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
Copy Markdown

@mgallien
mgallien merged commit 8511b8a into master Feb 24, 2026
24 checks passed
@mgallien
mgallien deleted the i2h3/fix/skip-build-tree-rpath branch February 24, 2026 20:36
@github-project-automation github-project-automation Bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Feb 24, 2026
@mgallien mgallien modified the milestones: 33.0.0, 34.0.0 Mar 12, 2026
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.

5 participants