linuxdeployqt icon indicating copy to clipboard operation
linuxdeployqt copied to clipboard

Recent update broke connection to d-bus Secret Agent API

Open rupi-lol opened this issue 2 years ago • 12 comments

Not a qt developer, just a user that did some debugging after Nextcloud Client stopped working with any Secret Agent but kwallet: https://github.com/nextcloud/desktop/issues/4715

As stated in that bug it seems that some change between the release 8 and the continuous one broke the ability of qtkeychain to talk to other programs providing the Secret Agent API.

rupi-lol avatar Aug 03 '22 20:08 rupi-lol

Confirmed the problem derives from linuxdeployqt. Built an appimage with build-daily.sh, changed the continuous appimage to release '8' from 13.6. 2021 (the only other option would be even older and labeled do not use). Authentication using d-bus Secret Agent works like expected (well.. at least in my envirionment).

Can you compare the contents of the AppImage made with linuxdeployqt 8 vs. continous? Do they contain different files?

probonopd avatar Aug 03 '22 21:08 probonopd

@probonopd I built 2 AppImages of Nextcloud Client:

  • one with linuxdeployqt continous which has the problem with libsecret,
  • one with linuxdeployqt 8 which works fine

Here the difference between the two AppImage:

$ diff -r /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/ /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/
Binary files /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/AppRun and /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/AppRun differ
Binary files /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/bin/nextcloud and /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/usr/bin/nextcloud differ
Only in /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib: libglib-2.0.so.0
Only in /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib: libgobject-2.0.so.0
Binary files /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib/libnextcloudsync.so and /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/usr/lib/libnextcloudsync.so differ
Binary files /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib/libnextcloudsync.so.0 and /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/usr/lib/libnextcloudsync.so.0 differ
Binary files /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib/libnextcloudsync.so.3.5.50 and /tmp/Nextcloud-linuxdeployqt-8-x86_64.AppImage/usr/lib/libnextcloudsync.so.3.5.50 differ

It seems odd to me that the 'continuous Appimage' contains libglib-2.0.so.0 and libgobject-2.0.so.0.

FredL69 avatar Aug 04 '22 07:08 FredL69

Oh.. while I was rebuilding the deleted images someone did this allready.. anyways it is like stated above: Diff of the file listings by appimagetool: 66a67

usr/lib/libglib-2.0.so.0 68a70 usr/lib/libgobject-2.0.so.0

rupi-lol avatar Aug 04 '22 07:08 rupi-lol

What happens if you delete libglib and libgobject from /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/usr/lib and then run /tmp/Nextcloud-linuxdeployqt-continuous-x86_64.AppImage/AppRun?

It seems like https://github.com/AppImage/pkg2appimage/commit/1e3ecde6b92ef198405463415b8090a4435d0cb0 added these files, which was done due to https://github.com/probonopd/Emacs.AppImage/issues/16.

probonopd avatar Aug 04 '22 09:08 probonopd

@probonopd If I delete them, the app runs fine.

FredL69 avatar Aug 04 '22 09:08 FredL69

Thanks for testing and confirming @FredericLespez. This seems to bring us to an inconvenient tradeoff situation where bundling libglib-2.0.so.0 and libgobject-2.0.so.0 breaks some apps while not bundling them breaks others. Not sure how to proceed here.

probonopd avatar Aug 04 '22 10:08 probonopd

@probonopd You're welcome I am not an expert, so I cannot help you :-( While a suitable solution is found, maybe a workaround can be used inside Nexcloud client build script ?

Is there a way to remove these libraries before "packing" the AppImage ?

FredL69 avatar Aug 04 '22 10:08 FredL69

running a test right now

rupi-lol avatar Aug 04 '22 10:08 rupi-lol

running a test right now

not familiar enough with the toolchain.. did not find a way to avoid inclusion/delete them after wards with the toolchain given in the buildenv

rupi-lol avatar Aug 04 '22 10:08 rupi-lol

Create an AppImage, unpack AppImage to get an AppDir, delete files from that AppDir, turn AppDir into an AppImage again.

probonopd avatar Aug 04 '22 10:08 probonopd

+ rm ./squashfs-root/usr/lib/libgobject-2.0.so.0
+ rm ./squashfs-root/usr/lib/libglib-2.0.so.0
+ ./squashfs-root/AppRun /app/usr/share/applications/com.nextcloud.desktopclient.nextcloud.desktop -appimage
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

And here I am after I decided to use the AppImage because I wanted to avoid the headaches that come with the Qt / cmake buildchain :) Thanks for hint though

rupi-lol avatar Aug 04 '22 11:08 rupi-lol

Create an AppImage, unpack AppImage to get an AppDir, delete files from that AppDir, turn AppDir into an AppImage again. Thanks to your help, I managed to modify the Nextcloud Client build script tp unpack the generated AppImage, delete the files and repack it. See https://github.com/nextcloud/client-building/pull/105

FredL69 avatar Aug 04 '22 14:08 FredL69