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

Deploying a universal app for macOS fails



    • macOS
    • 9a2198f9c (dev), 599335411 (6.5), 283d5c96e (6.4)


      I am currently in the process of porting my app over to Qt6. For reference, you can find the code here: https://gitlab.com/rpdev/opentodolist/-/tree/541-migrate-to-qt6

      I am using cmake for building the app. Currently, my invocation of cmake looks like that (cf https://gitlab.com/rpdev/opentodolist/-/blob/541-migrate-to-qt6/ci/macos-build.sh#L35):


      $QT_DIR/bin/qt-cmake \
          -GNinja \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_OSX_ARCHITECTURES="x86_64" \

      In this case, I am building an Intel only version of the app - which works fine. From what I understood, in order to create a universal version of the app which runs natively on both Intel as well as Apple devices, I would have to pass two values to the CMAKE_OSX_ARCHITECTURES variable like that:



      $QT_DIR/bin/qt-cmake \
          -GNinja \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \

      If I do so, the build works, however, deploying the app using macdeployqt does not. The deployment fails with the following (cf https://gitlab.com/rpdev/opentodolist/-/jobs/3536003989#L1654):


      ~/builds/i3aD_eyc/0/rpdev/opentodolist/build-macos/dist-web ~/builds/i3aD_eyc/0/rpdev/opentodolist/build-macos1655ERROR: "error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: \"-delete_rpath /Users/mhoeher/Qt/6.5.0/macos/lib\" specified more than once\nUsage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input\n"1656ERROR: ""1657WARNING: Plugin "libqsqlodbc.dylib" uses private API and is not Mac App store compliant.1658WARNING: Skip plugin "libqsqlodbc.dylib"1659WARNING: Plugin "libqsqlpsql.dylib" uses private API and is not Mac App store compliant.1660WARNING: Skip plugin "libqsqlpsql.dylib"1661ERROR: Codesign signing error:1662ERROR: "/Users/mhoeher/builds/i3aD_eyc/0/rpdev/opentodolist/build-macos/dist-web/OpenTodoList.app/Contents/MacOS/OpenTodoList: replacing existing signature\n/Users/mhoeher/builds/i3aD_eyc/0/rpdev/opentodolist/build-macos/dist-web/OpenTodoList.app/Contents/MacOS/OpenTodoList: code object is not signed at all\nIn subcomponent: /Users/mhoeher/builds/i3aD_eyc/0/rpdev/opentodolist/build-macos/dist-web/OpenTodoList.app/Contents/Frameworks/QtQuickControls2.framework\n"1663ERROR: codesign verification error:1664ERROR: "OpenTodoList.app: code object is not signed at all\n"

      The interesting thing is that the call to macdeployqt itself does not return an exit code unequal to zero (but still produces some of the above mentioned errors), but the resulting app bundle is not properly signed afterwards (so the codesign check in the following script part causes the failure):



      # Include Qt Runtime in App Bundle. Also sign the bundle
      # and prepare it for notarization:
      mkdir -p dist-web
      cp -r app/OpenTodoList.app dist-web
      pushd dist-web
      $QT_DIR/bin/macdeployqt \
          OpenTodoList.app/ \
          -qmldir=../../app \
          -appstore-compliant \
          -sign-for-notarization="Developer ID Application: Martin Hoeher (786Z636JV9)"
      # Create a zip archive suitable for uploading to the notarization
      # service:
      ditto \
          -ck --rsrc \
          --sequesterRsrc \
          --keepParent \
          "dist-web/OpenTodoList.app" "dist-web/OpenTodoList.zip"
      # Make sure the app has been signed:
      codesign -v dist-web/OpenTodoList.app

      Please let me know if you need any further input from my side to better understand the issue. Thanks!




        Issue Links

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



              vestbo Tor Arne Vestbø
              mhoeher Martin Höher
              0 Vote for this issue
              4 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes