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

WebEngine-based application deployed with "macdeployqt" may have incorrect dylib install paths

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Out of scope
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      macOS

      Description

      This is A MacOS-specific issue. Qt 5.12.3 is affected, but most likely older versions as well.

      Steps to reproduce:

      1. Install Qt via Homebrew
      2. Build and deploy "Simple Browser" (WebEngineWidgets) example
        1. /usr/local/opt/qt/bin/qmake
        2. make
        3. /usr/local/opt/qt/bin/macdeployqt simplebrowser.app/
      3. Uninstall Qt
      4. Run deployed "Simple Browser": simplebrowser.app/Contents/MacOS/simplebrowser

      What happens:

      It doesn't work, only prints:

      dyld: Library not loaded: /usr/local/Cellar/qt/5.12.3/lib/QtGui.framework/Versions/5/QtGui
        Referenced from: /Users/skale/Projekty/qt-simplebrowser/simplebrowser.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
        Reason: image not found
      dyld: Library not loaded: /usr/local/Cellar/qt/5.12.3/lib/QtGui.framework/Versions/5/QtGui
        Referenced from: /Users/skale/Projekty/qt-simplebrowser/simplebrowser.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
        Reason: image not found
      

      Why it happens:

      As it can be seen on listings below, install paths in QtWebEngineProcess.app, which is embedded in simplebrowser.app, all point to locations where these libs used to be on a development machine (/usr/local/Cellar/qt/5.12.3/lib). In the result, the deployed application does not work except for the computer which it was deployed on.

      Running `otool -L` on various executables and dylibs prints following:

      otool -L simplebrowser.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
      
      simplebrowser.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess:
      	/usr/local/Cellar/qt/5.12.3/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.3)
      	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
      	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
      	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
      	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
      	/usr/local/Cellar/qt/5.12.3/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.12.0, current version 5.12.3)
      	/usr/local/Cellar/qt/5.12.3/lib/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.12.0, current version 5.12.3)
      	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
      	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
      
      otool -L simplebrowser.app/Contents/MacOS/simplebrowser
      
      simplebrowser.app/Contents/MacOS/simplebrowser:
      	@executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.12.0, current version 5.12.3)
      	@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.3)
      	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
      	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
      	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
      	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
      	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
      	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
      
      otool -L simplebrowser.app/Contents/Frameworks/QtCore.framework/QtCore
      
      simplebrowser.app/Contents/Frameworks/QtCore.framework/QtCore:
      	@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.3)
      	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
      	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
      	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
      	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1671.10.106)
      	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.220.15)
      	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 50.1.0)
      	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 934.0.0)
      	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
      	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1560.12.0)
      	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
      	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
      	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
      

      What doesn't help

      Unfortunately, following workaround presented in QTBUG-41611 does not help. Error does not change.

      /usr/local/opt/qt/bin/macdeployqt simplebrowser.app/ -executable=simplebrowser.app/Contents/MacOS/simplebrowser
      

      Possible root cause

      This may help finding a root cause — Qt distribution available in Homebrew has been configured with following options:

            -verbose
            -prefix #{prefix}
            -release
            -opensource -confirm-license
            -system-zlib
            -qt-libpng
            -qt-libjpeg
            -qt-freetype
            -qt-pcre
            -nomake examples
            -nomake tests
            -no-rpath
            -pkg-config
            -dbus-runtime
            -proprietary-codecs
      

      https://github.com/Homebrew/homebrew-core/blob/1e6fc8013f0cf92d77b115635c010b744ff4ffa6/Formula/qt.rb#L28-L42

      Notably -no-rpath option is present, they have valid reasons for that.

        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:
            skalee Sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes