Bug 387201 - kioslave needed by flickr export but not included in appimage
Summary: kioslave needed by flickr export but not included in appimage
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Bundle-AppImage (show other bugs)
Version: 5.8.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-22 07:05 UTC by jon33040
Modified: 2022-01-31 13:05 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0
Sentry Crash Report:


Attachments
Screen capture of error message (113.50 KB, image/png)
2017-11-22 07:06 UTC, jon33040
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jon33040 2017-11-22 07:05:43 UTC
The fix to 384826 (flickr export) is supposed to be included in 5.8.0 so I thought I'd test it with the current appimage.

My login credentials have timed out so I have to do "Add another account".

When I do this, I get a message "Unable to create io-slave. Can not find 'kioslave' executable at '/usr/bin, /usr/bin/libexec, ././lib64/kf5'.

(See attached screenshot).
Comment 1 jon33040 2017-11-22 07:06:18 UTC
Created attachment 109010 [details]
Screen capture of error message
Comment 2 Maik Qualmann 2017-11-22 07:38:12 UTC
Strange that Flickr plugin does not use KIO. At this point, the web browser is started via QDesktopServices. Which browser did you set as standard in the system and which Linux do you use?

Maik
Comment 3 jon33040 2017-11-22 08:26:44 UTC
(In reply to Maik Qualmann from comment #2)
> Strange that Flickr plugin does not use KIO. At this point, the web browser
> is started via QDesktopServices. Which browser did you set as standard in
> the system and which Linux do you use?
> 
> Maik

The standard browser is firefox. 
The distro is Kubuntu (Xenial).
Comment 4 caulier.gilles 2017-11-22 08:51:22 UTC
We don't need and we don't want to use KIOSlave.

KIOSLave is the hell to package in bundles (AppImage, PKG, and Windows). So, if the external browser need credential from desktop through KIOSlave, and if it do not work, we cannot do anything.

In all case KIOSlave will never packaged in digiKam AppImage. It just impossible to do.

Gilles Caulier
Comment 5 jon33040 2017-11-22 09:04:06 UTC
(In reply to caulier.gilles from comment #4)
> We don't need and we don't want to use KIOSlave.
> 
> KIOSLave is the hell to package in bundles (AppImage, PKG, and Windows). So,
> if the external browser need credential from desktop through KIOSlave, and
> if it do not work, we cannot do anything.
> 
> In all case KIOSlave will never packaged in digiKam AppImage. It just
> impossible to do.
> 
> Gilles Caulier

That is sort-of what I expected so the real bug is that something needs KIOSlave and it must not.
Comment 6 Maik Qualmann 2017-11-22 18:21:18 UTC
I can not reproduce the problem with my native openSUSE Tumbleweed or with an Ubuntu 17.04 in the virtual machine. Das AppImage runs fine and Flickr works.

Maik
Comment 7 jon33040 2017-11-22 18:24:56 UTC
(In reply to Maik Qualmann from comment #6)
> I can not reproduce the problem with my native openSUSE Tumbleweed or with
> an Ubuntu 17.04 in the virtual machine. Das AppImage runs fine and Flickr
> works.
> 
> Maik

Can you suggest anything I could do that would help?
Comment 8 Maik Qualmann 2017-11-22 19:48:05 UTC
I'm just loading Kubuntu 16.04 for a test in a virtual machine.

Maik
Comment 9 Maik Qualmann 2017-11-22 22:03:12 UTC
I can confirm the error message under Kubuntu. It looks like QDesktopServices under a KDE/KF5 system seems to launch the browser via KIO. Under Kubuntu I only find a kioslave file in a KDE4 folder. I do not know the package names to install the appropriate KF5 packages. This Kubuntu version seems to be a mix of KDE4 and KF5. But we can not fix this problem on the AppImage side.

Maik
Comment 10 caulier.gilles 2017-11-23 02:51:28 UTC
Maik,

QDesktopService::openUrl() is a complexe mechanism

It delegate the job to QPlatformIntegration class :

https://github.com/qt/qtbase/blob/5.10/src/gui/util/qdesktopservices.cpp#L213

which more and less call a generic Unix service here :

https://github.com/qt/qtbase/blob/5.10/src/platformsupport/services/genericunix/qgenericunixservices.cpp#L124

where the browser detection is delegate to kfmclient under KDE...

probably kfmclient call KIO stuff inside. Welcome to the jungle (:=)))...

Gilles
Comment 11 Maik Qualmann 2018-02-02 07:08:31 UTC
*** Bug 389785 has been marked as a duplicate of this bug. ***
Comment 12 Maik Qualmann 2018-07-18 05:57:37 UTC
*** Bug 396619 has been marked as a duplicate of this bug. ***
Comment 13 caulier.gilles 2018-08-14 13:45:11 UTC
Git commit 4cb632060d9042a64dc15cc145495e1b87780ecd by Gilles Caulier.
Committed on 14/08/2018 at 13:43.
Pushed by cgilles into branch 'master'.

add patch to support AppImage through QProcess with QDesktopService

M  +3    -0    project/bundles/3rdparty/ext_qt/CMakeLists.txt
A  +35   -0    project/bundles/3rdparty/ext_qt/qt-appimage-support.patch

https://commits.kde.org/digikam/4cb632060d9042a64dc15cc145495e1b87780ecd
Comment 14 caulier.gilles 2018-08-15 09:22:35 UTC
Maik,

Problem is now fixed with my Qt5 patch :

// -------------------------------------------------------------------------

Git commit 2eb13d7ceab223675a86bbdac0a1065b206c2954 by Gilles Caulier.
Committed on 14/08/2018 at 21:48.
Pushed by cgilles into branch 'master'.

use system() call instead QProcess

M  +6    -13   project/bundles/3rdparty/ext_qt/qt-appimage-support.patch

https://commits.kde.org/digikam/2eb13d7ceab223675a86bbdac0a1065b206c2954

diff --git a/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch b/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
index 781ed92ca8..dd6d99b250 100644
--- a/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
+++ b/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
@@ -2,7 +2,7 @@ diff --git a/qtbase/src/platformsupport/services/genericunix/qgenericunixservice
 index cdb5d33859..5a2bd5f724 100644
 --- a/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp
 +++ b/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp
-@@ -146,7 +146,30 @@ static inline bool launch(const QString &launcher, const QUrl &url)
+@@ -146,7 +146,23 @@ static inline bool launch(const QString &launcher, const QUrl &url)
  #if !QT_CONFIG(process)
      const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
  #else
@@ -17,20 +17,13 @@ index cdb5d33859..5a2bd5f724 100644
 +    {
 +        qDebug() << "Adjusting environment variables for AppImage bundle";
 +
-+        env.insert(QLatin1String("LD_LIBRARY_PATH"),
-+                   env.value(QLatin1String("APPIMAGE_ORIGINAL_LD_LIBRARY_PATH")));
-+        env.insert(QLatin1String("QT_PLUGIN_PATH"),
-+                   env.value(QLatin1String("APPIMAGE_ORIGINAL_QT_PLUGIN_PATH")));
-+        env.insert(QLatin1String("XDG_DATA_DIRS"),
-+                   env.value(QLatin1String("APPIMAGE_ORIGINAL_XDG_DATA_DIRS")));
-+        env.insert(QLatin1String("PATH"),
-+                   env.value(QLatin1String("APPIMAGE_ORIGINAL_PATH")));
++        setenv("LD_LIBRARY_PATH", env.value(QLatin1String("APPIMAGE_ORIGINAL_LD_LIBRARY_PATH")).toLatin1().data(), 1);
++        setenv("QT_PLUGIN_PATH",  env.value(QLatin1String("APPIMAGE_ORIGINAL_QT_PLUGIN_PATH")).toLatin1().data(),  1);
++        setenv("XDG_DATA_DIRS",   env.value(QLatin1String("APPIMAGE_ORIGINAL_XDG_DATA_DIRS")).toLatin1().data(),   1);
++        setenv("PATH",            env.value(QLatin1String("APPIMAGE_ORIGINAL_PATH")).toLatin1().data(),            1);
 +    }
 +
-+    QProcess process;
-+    process.setProcessEnvironment(env);
-+    process.setProgram(command);
-+    const bool ok = process.startDetached();
++    const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
  #endif
      if (!ok)
          qWarning("Launch failed (%s)", qPrintable(command));

// -------------------------------------------------------------------------

In fact, internal QDesktopService for Unix do not support AppImage to call an external binary. This is due to env. variable set at run time by AppImage to relocate dynamic shared library loader to the bundle contents.

I check Qt 5.11 (in fact git/master code of Qt repository), and Qt team use another Technic to support FlatPack through DBUS. AppImage is not yet supported, and this must be reported to Qt bugzilla as upstream.

I don't like the DBUS way, as it give another runtime dependency to Qt which can be fail if the query used to run a binary is not supported to the Linux host box.

In my patch i use system() call instead QProcess, as we use Qt 5.9.6 when the QProcess::startDetached() is a static method which don't care about the env. variable preset before to call the method. In Qt 5.10, a new non static QProcess::startDetached() have been introduced with a complete re-write of internal QProcess implementation.

Voilà. this require 3 days of hack to understand the problem, recompile step by step Qt5, rebuild the bundle and test (:=)))... Outch

Gilles Caulier