Bug 402192 - Can't run flatpaks from within Discover (packaged using flatpak)
Summary: Can't run flatpaks from within Discover (packaged using flatpak)
Status: RESOLVED UPSTREAM
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: unspecified
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-16 14:10 UTC by Andrey
Modified: 2024-05-08 13:33 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2018-12-16 14:10:15 UTC
Trying to run installed flatpak by pressing the "Launch" button:
Failed to launch  "DOSBox" :  Failed to execute child process “/app/libexec/flatpak-bwrap” (No such file or directory)
Comment 1 Andrey 2018-12-16 14:16:57 UTC
Probably, non-flatpak programs can't be run also from within Discovery's flatpak.
Have not any to test, though.
Comment 2 Andrey 2018-12-16 15:41:47 UTC
--talk-name=org.freedesktop.Flatpak, flatpak-spawn --host any-command

maybe this could make some use here.
Suggestions are welcome.
Comment 3 Aleix Pol 2018-12-17 03:08:43 UTC
It's because you're running Discover from Flatpak.

Have you tried it if it works?
Comment 4 Andrey 2018-12-17 11:35:42 UTC
No, I haven't. It's suggestion from flatpak guys.
But I think we have to change the Discovery code itself a bit so that could work..
Comment 5 Aleix Pol 2019-01-09 17:58:43 UTC
You can try commenting the runservice bit in FlatpakResource::invokeApplication and see if it works. Beyond it's discover asking flatpak to run. If that solves it we can see to changing the code the right way.
Comment 6 Andrey 2019-01-09 22:01:14 UTC
Am I understand right I can just move away desktopFile in my installation to try, without modifying the code?:
 
    const QString desktopFile = installPath() + QStringLiteral("/export/share/applications/") + appstreamId();
    const QString runservice = QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/discover/runservice");
    if (QFile::exists(desktopFile) && QFile::exists(runservice)) {
        QProcess::startDetached(runservice, {desktopFile});
        return;
    }
Comment 7 Aleix Pol 2019-01-10 12:57:05 UTC
I don't know if libflatpak uses the desktop file to execute it.
Comment 8 Andrey 2019-01-10 14:06:20 UTC
Hmm, it seems sandbox has no that "runservice" file anyway..

Also, I got this when running:
Failed to launch  "DOSBox" :  Failed to execute child process “/app/libexec/flatpak-bwrap” (No such file or directory)
Comment 9 Aleix Pol 2024-05-08 13:33:58 UTC
It seems like the issue is laying entirely upstream in libflatpak, so will close as resolved upstream.

That said, I don't think running Discover as a flatpak will be all that widespread so I don't think it's worth pursuing it right now.