Skip to content

macOS/Qt6/Homebrew deployment issues #69

@jelmervdl

Description

@jelmervdl

When running macdeployqt from a Qt 6 installed through Homebrew, the resulting translateLocally.app bundle still refers to libraries only installed on your system locally. macdeployqt tries to fix all these references, but fails. This issue is about this journey, what I've found so far, and hopefully a solution that not just "just use Qt5 for now".

Source macdeployqt: https://github.com/qt/qtbase/blob/f5f7f78766d62b7192b98b96bbd68dab1961e54e/src/tools/macdeployqt/shared/shared.cpp

The issue starts when macdeployqt starts copying the plugins into the application bundle. The Homebrew version of Qt6 is compiled with relative paths:

> otool -l /usr/local/Cellar/qt/6.2.0/share/qt/plugins/platforms/libqcocoa.dylib
...
Load command 35
          cmd LC_RPATH
      cmdsize 48
         path @loader_path/../../../../lib (offset 12)

From the original location, that path resolves to /usr/local/Cellar/qt/6.2.0/lib. However, macdeployqt tries to resolve this after the plugin is copied, and then this path is no longer valid. Then, this path resolves to $BUILD_DIR/lib.

Current work-around I'm trying because it's too stupid to work:

ln -s $(brew --prefix qt)/lib ./lib

Experimenting in #68 with this solution.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions