Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.15.0, 5.15.2, 6.0.0, 6.0.1
-
None
-
macOS BigSur, Qt6.0.1 and Qt5.15.2 tested
Description
When deploying an application with one of its library dependencies names containing "_debug" (e.g. /usr/local/opt/abseil/lib/libabsl_debugging_internal.dylib) macdeployqt will complain it as a debug build and refuses to deploy QCocoa platform plugins.
=======================================================
Digging further, the "useDebugLibs" control if debug libraries are used. Since QCocoa has no "_debug" suffix, the LHS will evaluate to false.
This for loop will continue if "useDebugLibs" is "true" in this condition
This statement is around Line 200 in main.cpp:
Where the "deploymentInfo.isDebug" was set "true" at around Line970 in shared.cpp:
The isDebugLibrary is should be checking if the library name "ends" with the "_debug" suffix but it however does:
A "containing" check.
So my libabsl_debugging_internal.dylib breaks "macdeployqt" thus no qcocoa platform plugins are deployed.
=======================================================
I've uploaded a minimal proof of concept:
Download and extract the zip
- To Compile and run macdeployqt
mkdir build; cd build;
cmake ..; cmake --build .
macdeployqt ./mainapp.app
- Then double-click the mainapp.app, it'll fail due to missing libqcocoa platform plugin (can verify by checking if ./mainapp.app/Contents/PlugIns exists)
Now edit the CMakeLists.txt, switch the TEST_LIBRARY_NAME variable comments. do a clean recompile with macdeployqt, it should be working after double-clicking on the app bundle.
A QMessageBox would pop-up if it works well
Attachments
For Gerrit Dashboard: QTBUG-90982 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
337347,5 | macdeployqt: detect debug libs by using “_debug” suffix | dev | qt/qttools | Status: MERGED | +2 | 0 |
370076,2 | macdeployqt: detect debug libs by using “_debug” suffix | 6.1 | qt/qttools | Status: MERGED | +2 | 0 |
370079,2 | macdeployqt: detect debug libs by using “_debug” suffix | tqtc/lts-5.15 | qt/tqtc-qttools | Status: MERGED | +2 | 0 |