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

macdeployqt mistakenly detect my library as debug libs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0, 5.15.2, 6.0.0, 6.0.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      macOS BigSur, Qt6.0.1 and Qt5.15.2 tested
    • Platform/s:
      macOS

      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

      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

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            leroy Haoyu Liu
            PM Owner:
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes