GNU bug report logs - #59825
[PATCH] gnu: Add flatpak-xdg-utils.

Previous Next

Package: guix-patches;

Reported by: John Kehayias <john.kehayias <at> protonmail.com>

Date: Sun, 4 Dec 2022 22:16:01 UTC

Severity: normal

Tags: patch

Done: John Kehayias <john.kehayias <at> protonmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59825 in the body.
You can then email your comments to 59825 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59825; Package guix-patches. (Sun, 04 Dec 2022 22:16:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Kehayias <john.kehayias <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 04 Dec 2022 22:16:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: Guix-patches <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: Add flatpak-xdg-utils.
Date: Sun, 04 Dec 2022 22:15:23 +0000
[Message part 1 (text/plain, inline)]
Hi Guix,

Here is a little package from the Flatpak folks which is also useful in a guix shell container. This lets you run, for example, xdg-open in the container and it will open on the host side. So let's say you come across a URL, you can just use xdg-open from this package so it will open in the host's web browser, rather than trying in the container. This relies on having portals on the host side, like xdg-desktop-portal-gtk.

Here is a simple test example:

--8<---------------cut here---------------start------------->8---
guix shell -NC flatpak-xdg-utils --preserve='^DBUS_SESSION_BUS_ADDRESS$' -- xdg-open "<https://guix.gnu.org>"
--8<---------------cut here---------------end--------------->8---

which will open Guix's website on the host side.

I've checked it works, the license (some files LGPL2+ other LGPL2.1+), linted, and styled. I adjusted the description from upstream slightly to indicate it is not just for Flatpak sandboxes.

Thanks!
John
[0001-gnu-Add-flatpak-xdg-utils.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#59825; Package guix-patches. (Wed, 14 Dec 2022 10:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 59825 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: John Kehayias <john.kehayias <at> protonmail.com>
Cc: 59825 <at> debbugs.gnu.org
Subject: Re: bug#59825: [PATCH] gnu: Add flatpak-xdg-utils.
Date: Wed, 14 Dec 2022 11:00:11 +0100
Hi!

John Kehayias <john.kehayias <at> protonmail.com> skribis:

> Here is a little package from the Flatpak folks which is also useful in a guix shell container. This lets you run, for example, xdg-open in the container and it will open on the host side. So let's say you come across a URL, you can just use xdg-open from this package so it will open in the host's web browser, rather than trying in the container. This relies on having portals on the host side, like xdg-desktop-portal-gtk.
>
> Here is a simple test example:
>
> guix shell -NC flatpak-xdg-utils --preserve='^DBUS_SESSION_BUS_ADDRESS$' -- xdg-open "<https://guix.gnu.org>"
>
> which will open Guix's website on the host side.

Interesting (and scary as well, depending on how it’s implemented).

Don’t you need to share /tmp as well?  ‘DBUS_SESSION_BUS_ADDRESS’ refers
to a socket in /tmp for me.

> From 8669a7fb0e1b9ba320c6312d7423500a56236edc Mon Sep 17 00:00:00 2001
> From: John Kehayias <john.kehayias <at> protonmail.com>
> Date: Sun, 4 Dec 2022 17:06:19 -0500
> Subject: [PATCH] gnu: Add flatpak-xdg-utils.
>
> * gnu/packages/freedesktop.scm (flatpak-xdg-utils): New variable.

<https://qa.guix.gnu.org/issue/59825> mentions a build failure on
i686-linux; could you take a look?

Apart from that, it LGTM!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#59825; Package guix-patches. (Sat, 17 Dec 2022 05:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 59825 <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 59825 <at> debbugs.gnu.org
Subject: Re: bug#59825: [PATCH] gnu: Add flatpak-xdg-utils.
Date: Sat, 17 Dec 2022 05:54:20 +0000
Howdy,

On Wed, Dec 14, 2022 at 11:00 AM, Ludovic Courtès wrote:

> Hi!
>
> John Kehayias <john.kehayias <at> protonmail.com> skribis:
>
>> Here is a little package from the Flatpak folks which is also useful in a guix shell
>> container. This lets you run, for example, xdg-open in the container and it will open on
>> the host side. So let's say you come across a URL, you can just use xdg-open from this
>> package so it will open in the host's web browser, rather than trying in the container.
>> This relies on having portals on the host side, like xdg-desktop-portal-gtk.
>>
>> Here is a simple test example:
>>
>> guix shell -NC flatpak-xdg-utils --preserve='^DBUS_SESSION_BUS_ADDRESS$' -- xdg-open
>> "<https://guix.gnu.org>"
>>
>> which will open Guix's website on the host side.
>
> Interesting (and scary as well, depending on how it’s implemented).
>

Yes, a bit of both! The scary one I think is 'flatpak-spawn' which will run something on the host, but as this is done via portals there's some control there over what it implements and how. I don't know the details though, but I did see checks somewhere for what checking what is allowed to be accessed.

e.g. with guix shell -NC flatpak-xdg-utils --preserve='^DBUS_SESSION_BUS_ADDRESS$' -- flatpak-spawn --host ls /

So yeah, punching holes in a sandbox. Anyway...

> Don’t you need to share /tmp as well?  ‘DBUS_SESSION_BUS_ADDRESS’ refers
> to a socket in /tmp for me.
>

It does point to something in /tmp for me as well, but which doesn't exist...not sure the details of DBus, which I always find confusing.

Note the -N argument, that was key for me to get it working easily. Without that and even sharing /tmp it didn't work, nor if I tried manually adding files that -N adds. So it must be something else about the network option that gets access to the DBus socket?

>> From 8669a7fb0e1b9ba320c6312d7423500a56236edc Mon Sep 17 00:00:00 2001
>> From: John Kehayias <john.kehayias <at> protonmail.com>
>> Date: Sun, 4 Dec 2022 17:06:19 -0500
>> Subject: [PATCH] gnu: Add flatpak-xdg-utils.
>>
>> * gnu/packages/freedesktop.scm (flatpak-xdg-utils): New variable.
>
> <https://qa.guix.gnu.org/issue/59825> mentions a build failure on
> i686-linux; could you take a look?
>

Took me a bit to figure out the logs, but looks like some issue on the build server as in the configure phase I see:

WARNING: Could not create compilation database.

Locally it has built fine, for the same derivation hash as well.

> Apart from that, it LGTM!
>

Great! I'll add it to my early lists of commits I'll make, once I finally get a breather here.

> Thanks,
> Ludo’.

And thank you!

John





Information forwarded to guix-patches <at> gnu.org:
bug#59825; Package guix-patches. (Tue, 03 Jan 2023 17:36:02 GMT) Full text and rfc822 format available.

Message #14 received at 59825 <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 59825-done <at> debbugs.gnu.org, 59825 <at> debbugs.gnu.org
Subject: Re: bug#59825: [PATCH] gnu: Add flatpak-xdg-utils.
Date: Tue, 03 Jan 2023 17:35:25 +0000
Pushed as 2f0418cd2c33497130e1b764952e8063117d7f8a (my first commit!)





Reply sent to John Kehayias <john.kehayias <at> protonmail.com>:
You have taken responsibility. (Tue, 03 Jan 2023 17:36:02 GMT) Full text and rfc822 format available.

Notification sent to John Kehayias <john.kehayias <at> protonmail.com>:
bug acknowledged by developer. (Tue, 03 Jan 2023 17:36:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Feb 2023 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 139 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.