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

macdeployqt mistakenly detect my library as debug libs

    XMLWordPrintable

Details

    • 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

    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

        1. image.png
          7 kB
          Jens
        2. image-2021-02-07-01-50-04-518.png
          154 kB
          Haoyu Liu
        3. image-2021-02-07-01-55-23-393.png
          7 kB
          Haoyu Liu
        4. image-2021-02-07-01-56-35-452.png
          13 kB
          Haoyu Liu
        5. image-2021-02-07-01-58-06-995.png
          7 kB
          Haoyu Liu
        6. macdeploytest.zip
          0.9 kB
          Haoyu Liu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            leroy Haoyu Liu
            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