probonopd / go-appimage

Go implementation of AppImage tools
MIT License
772 stars 72 forks source link

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" #45

Open probonopd opened 4 years ago

probonopd commented 4 years ago
rm -rf appdir || true
mkdir -p appdir/usr/bin
mkdir -p appdir/usr/share/applications
mkdir -p appdir/usr/share/icons
cp /usr/bin/kcalc appdir/usr/bin/
cp /usr/share/applications/org.kde.kcalc.desktop appdir/usr/share/applications/
mkdir -p appdir/usr/share/icons/hicolor/scalable/applications
cp /usr/share/icons/Humanity/apps/48/kcalc.svg appdir/usr/share/icons/hicolor/scalable/applications/
Downloads/appimagetool-492-x86_64.AppImage deploy appdir/usr/share/applications/org.kde.kcalc.desktop 

If one changes the last line to use -s, then it works:

Downloads/appimagetool-492-x86_64.AppImage deploy appdir/usr/share/applications/org.kde.kcalc.desktop 

Proably the culprit is something in here:

2020/07/30 17:06:59 Patching qt_prfxpath, otherwise can't load platform plugin...
2020/07/30 17:06:59 Offset of qt_prfxpath: 3561388
2020/07/30 17:06:59 Qt prefix directory in the AppDir: appdir/usr/lib/x86_64-linux-gnu/qt5
2020/07/30 17:06:59 Relative path from ld-linux to Qt prefix directory in the AppDir: ../usr/lib/x86_64-linux-gnu/qt5

The "Relative path from ld-linux to Qt prefix directory in the AppDir" should only matter if -s is used. Why is it even running when it is not used?

probonopd commented 4 years ago

Turns out it is trying to load from /home/me/appdir/usr/bin/lib/x86_64-linux-gnu/qt5/plugins. So patching qt_prfxpath to . is not the right thing to do apparently. What do we need to put there if -s is not used? ..?

probonopd commented 4 years ago

Looks like we still haven't nailed this yet:

https://travis-ci.org/github/AppImage/appimage.github.io/builds/722530582#L365

QFactoryLoader::QFactoryLoader() checking directory path "/run/firejail/appimage/.appimage-9221/usr/bin/platforms" ...
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
ragnar-lodbrok commented 2 years ago

Having the same issue even with -s option:


2022/03/07 22:06:08 Detected Qt 5
2022/03/07 22:06:08 Offset of qt_prfxpath: 3226844
2022/03/07 22:06:08 Length of value of qt_prfxpath: 4
2022/03/07 22:06:08 qt_prfxpath: /usr
2022/03/07 22:06:08 Got qt_prfxpath but it does not contain 'plugins'
2022/03/07 22:06:35 libqxcb.so found: [/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqxcb.so]
2022/03/07 22:06:35 Guessed qt_prfxpath to be /usr/lib/arm-linux-gnueabihf/qt5
2022/03/07 22:06:35 Looking in /usr/lib/arm-linux-gnueabihf/qt5/plugins
2022/03/07 22:06:36 len(allELFsUnderPath): 1
2022/03/07 22:06:36 libraryLocations: [appdir/usr/bin appdir/usr/share/applications /usr/lib64 /lib64 /usr/lib /lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 /opt/vc/lib /usr/local/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf/libfakeroot /lib/arm-linux-gnueabihf/gconv /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms]
2022/03/07 22:06:36 len(allELFs): 343
2022/03/07 22:06:36 Selecting for deployment required Qt plugins...
2022/03/07 22:06:37 len(allELFsUnderPath): 1
2022/03/07 22:06:37 libraryLocations: [appdir/usr/bin appdir/usr/share/applications /usr/lib64 /lib64 /usr/lib /lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 /opt/vc/lib /usr/local/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf/libfakeroot /lib/arm-linux-gnueabihf/gconv /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms /usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes]```

Is there any solution or workaround? 
probonopd commented 2 years ago

I haven't had a chance to test this on arm-linux-gnueabihf yet, sorry.

Any help debugging and fixing this would be appreciated.

ragnar-lodbrok commented 2 years ago

I've made a build of linuxdeployqt on arm (that was surprisingly easy) and it works fine. All my attempts to debug/workaround it e.g. by changing QCoreApplication::setLibraryPaths failed, so I guess I can't help with fixing it.