GNU bug report logs - #35641
[PATCH] services: gdm: Include user profile in D-Bus paths.

Previous Next

Package: guix-patches;

Reported by: Timothy Sample <samplet <at> ngyro.com>

Date: Wed, 8 May 2019 19:01:01 UTC

Severity: normal

Tags: patch

Done: Timothy Sample <samplet <at> ngyro.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 35641 in the body.
You can then email your comments to 35641 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#35641; Package guix-patches. (Wed, 08 May 2019 19:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timothy Sample <samplet <at> ngyro.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 08 May 2019 19:01:01 GMT) Full text and rfc822 format available.

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

From: Timothy Sample <samplet <at> ngyro.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: gdm: Include user profile in D-Bus paths.
Date: Wed, 08 May 2019 14:59:50 -0400
[Message part 1 (text/plain, inline)]
Hi Guix,

I avoided doing this when fixing up GDM because it seemed a little
ham-fisted (clumsy).  However, I think it is better than all the ink
that would be spilled on help-guix without it.

In short, the point is to make sure that D-Bus services included in a
user’s profile can be found and started by the session bus.  This means
that if you are using GDM and install “evolution-data-server” and
“gnome-calendar” (for example), the session bus will be able to start
all of the services that GNOME Calendar needs to function correctly.
There are a handful of major GNOME applications that need this.

Furthermore, I think we should add “evolution-data-server” as a
propagated input for packages that require it.  This way, things like
“guix install evolution” will just work the way one expects.

Is it okay to assume that “.guix-profile” is the user’s profile like
this?  If it isn’t okay in general, is it okay enough for now?

[0001-services-gdm-Include-user-profile-in-D-Bus-paths.patch (text/x-patch, inline)]
From e32c27dfa950d250520c3c8ecccba90add863639 Mon Sep 17 00:00:00 2001
From: Timothy Sample <samplet <at> ngyro.com>
Date: Wed, 8 May 2019 09:13:14 -0400
Subject: [PATCH] services: gdm: Include user profile in D-Bus paths.

This partially addresses <https://bugs.gnu.org/35267>.

* gnu/services/xorg.scm (dbus-daemon-wrapper): When '$HOME' is set,
include directories from '$HOME/.guix-profile' in the search paths of
the D-Bus daemon.
---
 gnu/services/xorg.scm | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 65e9d48915..027524f11d 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -767,14 +767,24 @@ the GNOME desktop environment.")
          (shell (file-append shadow "/sbin/nologin")))))
 
 (define dbus-daemon-wrapper
-  (program-file "gdm-dbus-wrapper"
-                #~(begin
-                    (setenv "XDG_CONFIG_DIRS"
-                            "/run/current-system/profile/etc/xdg")
-                    (setenv "XDG_DATA_DIRS"
-                            "/run/current-system/profile/share")
-                    (apply execl (string-append #$dbus "/bin/dbus-daemon")
-                           (program-arguments)))))
+  (program-file
+   "gdm-dbus-wrapper"
+   #~(begin
+       (use-modules (srfi srfi-26))
+       (let* ((system-profile "/run/current-system/profile")
+              (user-profile (and=> (getenv "HOME")
+                                   (cut string-append <> "/.guix-profile")))
+              (profiles (if user-profile
+                            (list user-profile system-profile)
+                            (list system-profile))))
+         (setenv "XDG_CONFIG_DIRS"
+                 (string-join (map (cut string-append <> "/etc/xdg") profiles)
+                              ":"))
+         (setenv "XDG_DATA_DIRS"
+                 (string-join (map (cut string-append <> "/share") profiles)
+                              ":"))
+         (apply execl (string-append #$dbus "/bin/dbus-daemon")
+                (program-arguments))))))
 
 (define-record-type* <gdm-configuration>
   gdm-configuration make-gdm-configuration
-- 
2.21.0


Information forwarded to guix-patches <at> gnu.org:
bug#35641; Package guix-patches. (Fri, 10 May 2019 13:15:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: 35641 <at> debbugs.gnu.org
Subject: Re: [bug#35641] [PATCH] services: gdm: Include user profile in D-Bus
 paths.
Date: Fri, 10 May 2019 15:14:06 +0200
Hi,

Timothy Sample <samplet <at> ngyro.com> skribis:

> I avoided doing this when fixing up GDM because it seemed a little
> ham-fisted (clumsy).  However, I think it is better than all the ink
> that would be spilled on help-guix without it.

The e-ink, you mean.

> In short, the point is to make sure that D-Bus services included in a
> user’s profile can be found and started by the session bus.  This means
> that if you are using GDM and install “evolution-data-server” and
> “gnome-calendar” (for example), the session bus will be able to start
> all of the services that GNOME Calendar needs to function correctly.
> There are a handful of major GNOME applications that need this.
>
> Furthermore, I think we should add “evolution-data-server” as a
> propagated input for packages that require it.  This way, things like
> “guix install evolution” will just work the way one expects.

Sounds like a worthy goal.  :-)

> Is it okay to assume that “.guix-profile” is the user’s profile like
> this?  If it isn’t okay in general, is it okay enough for now?

In this particular case, I’d say it’s OK.

Do we have any other option on the table anyway?

>>From e32c27dfa950d250520c3c8ecccba90add863639 Mon Sep 17 00:00:00 2001
> From: Timothy Sample <samplet <at> ngyro.com>
> Date: Wed, 8 May 2019 09:13:14 -0400
> Subject: [PATCH] services: gdm: Include user profile in D-Bus paths.
>
> This partially addresses <https://bugs.gnu.org/35267>.
>
> * gnu/services/xorg.scm (dbus-daemon-wrapper): When '$HOME' is set,
> include directories from '$HOME/.guix-profile' in the search paths of
> the D-Bus daemon.

[...]

> +  (program-file
> +   "gdm-dbus-wrapper"
> +   #~(begin
> +       (use-modules (srfi srfi-26))

Same thing with a few comment explaining what you wrote above would be
great.

LGTM!

Thanks,
Ludo’.




Reply sent to Timothy Sample <samplet <at> ngyro.com>:
You have taken responsibility. (Sat, 11 May 2019 17:46:02 GMT) Full text and rfc822 format available.

Notification sent to Timothy Sample <samplet <at> ngyro.com>:
bug acknowledged by developer. (Sat, 11 May 2019 17:46:02 GMT) Full text and rfc822 format available.

Message #13 received at 35641-done <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 35641-done <at> debbugs.gnu.org
Subject: Re: [bug#35641] [PATCH] services: gdm: Include user profile in D-Bus
 paths.
Date: Sat, 11 May 2019 13:45:29 -0400
Hi Ludo,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Timothy Sample <samplet <at> ngyro.com> skribis:
>
> [...]
>
>> Is it okay to assume that “.guix-profile” is the user’s profile like
>> this?  If it isn’t okay in general, is it okay enough for now?
>
> In this particular case, I’d say it’s OK.
>
> Do we have any other option on the table anyway?

We could run D-Bus from a login shell.  The reason I didn’t opt for this
is that GDM launches D-Bus from a stripped-down environment.  It’s not
clear to me if there’s a reason for doing so, or if it was just the way
the code came together.  Essentially, I’m trying to be conservative.

I’m still holding out hope that a future “user sessions” feature in Guix
will make all of these hacks go away.  :)

>>>From e32c27dfa950d250520c3c8ecccba90add863639 Mon Sep 17 00:00:00 2001
>> From: Timothy Sample <samplet <at> ngyro.com>
>> Date: Wed, 8 May 2019 09:13:14 -0400
>> Subject: [PATCH] services: gdm: Include user profile in D-Bus paths.
>>
>> This partially addresses <https://bugs.gnu.org/35267>.
>>
>> * gnu/services/xorg.scm (dbus-daemon-wrapper): When '$HOME' is set,
>> include directories from '$HOME/.guix-profile' in the search paths of
>> the D-Bus daemon.
>
> [...]
>
>> +  (program-file
>> +   "gdm-dbus-wrapper"
>> +   #~(begin
>> +       (use-modules (srfi srfi-26))
>
> Same thing with a few comment explaining what you wrote above would be
> great.
>
> LGTM!

I pushed a nicer version (following the style of the “xinitrc” code)
with a long comment as dcb3a0fe0a086b4762a721e9b1da64826d5160d0.

Thanks for the review!


-- Tim




Information forwarded to guix-patches <at> gnu.org:
bug#35641; Package guix-patches. (Sun, 12 May 2019 21:18:02 GMT) Full text and rfc822 format available.

Message #16 received at 35641-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: 35641-done <at> debbugs.gnu.org
Subject: Re: [bug#35641] [PATCH] services: gdm: Include user profile in D-Bus
 paths.
Date: Sun, 12 May 2019 23:17:32 +0200
Hi Timothy,

Timothy Sample <samplet <at> ngyro.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Timothy Sample <samplet <at> ngyro.com> skribis:
>>
>> [...]
>>
>>> Is it okay to assume that “.guix-profile” is the user’s profile like
>>> this?  If it isn’t okay in general, is it okay enough for now?
>>
>> In this particular case, I’d say it’s OK.
>>
>> Do we have any other option on the table anyway?
>
> We could run D-Bus from a login shell.  The reason I didn’t opt for this
> is that GDM launches D-Bus from a stripped-down environment.  It’s not
> clear to me if there’s a reason for doing so, or if it was just the way
> the code came together.  Essentially, I’m trying to be conservative.
>
> I’m still holding out hope that a future “user sessions” feature in Guix
> will make all of these hacks go away.  :)

As we accumulate the hacks, motivation rises!  :-)

> I pushed a nicer version (following the style of the “xinitrc” code)
> with a long comment as dcb3a0fe0a086b4762a721e9b1da64826d5160d0.

Thank you!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Jun 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 293 days ago.

Previous Next


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