Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-90982

macdeployqt mistakenly detect my library as debug libs



    • Bug
    • Resolution: Unresolved
    • 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
    • macOS


      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

      1. 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


        For Gerrit Dashboard: QTBUG-90982
        # Subject Branch Project Status CR V



            sorvig Morten Sørvig
            leroy Haoyu Liu
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            0 Vote for this issue
            1 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes