all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Timothy Sample <samplet@ngyro.com>
To: brettg@posteo.net
Cc: 35484@debbugs.gnu.org
Subject: bug#35484: GDM failing to start stumpwm after merge
Date: Mon, 29 Apr 2019 15:08:16 -0400	[thread overview]
Message-ID: <87y33spr33.fsf@ngyro.com> (raw)
In-Reply-To: <87zho9cu2a.fsf@posteo.net>

[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]

Hi Brett,

brettg@posteo.net writes:

> On 29.04.2019 18:05, Timothy Sample wrote:
>>
>> After doing some testing in a VM, it looks like this is an issue
>> with my
>> recent commit: 8caa458953eeac783c73a0e5aaa72842fe3914c9.
>>
>> I added a placeholder desktop entry file, and even though I did my best
>> to make it invisible, GDM is still selecting it.  (I tested GNOME and
>> XFCE, but I guess they were preferred by GDM over the placeholder,
>> whereas StumpWM is not.  Maybe the has to do with how the names are
>> sorted.)

This is exactly the problem.  To find a default session, it sorts the
names of all the “.desktop” files it can find (using “g_strcmp0”), and
picks the first.  Since we have “GNOME” < “XFCE” < “Fail” < “stumpwm”,
my tests did not catch this error.

I can think of two options for a fix before 1.0 (which is supposed to be
tomorrow!).  The cute one is to just rename “Fail” to “~Fail”, on the
expectation that this will come after most other names when sorted.  The
ugly one is to patch GDM to exclude the placeholder file when looking
for “.desktop” files, and then to select it instead of raising an error
when it can’t find anything.

My preference is for the ugly one, because the cute one feels like
putting a silly hack on top of silly hack – it’s just a bit too much.
I’ve attached a patch.  Thoughts?  (If I don’t hear anything, I will
push it – it’s important that this works for 1.0).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gdm-Avoid-selecting-the-placeholder-session.patch --]
[-- Type: text/x-patch, Size: 2162 bytes --]

From 6b78b1d9c9a4c5ecb55dcd973248310fbbea3a33 Mon Sep 17 00:00:00 2001
From: Timothy Sample <samplet@ngyro.com>
Date: Mon, 29 Apr 2019 14:49:42 -0400
Subject: [PATCH] gnu: gdm: Avoid selecting the placeholder session.

This fixes <https://bugs.gnu.org/35484>.

* gnu/packages/gnome.scm (gdm)[arguments]: Modify the pre-configure phase to
patch GDM to only select the placeholder session if there are no others.
---
 gnu/packages/gnome.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 17dc2fd102..f19b1836d3 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5597,7 +5597,7 @@ libxml2.")
        (modify-phases %standard-phases
          (add-before
           'configure 'pre-configure
-          (lambda* (#:key inputs #:allow-other-keys)
+          (lambda* (#:key inputs outputs #:allow-other-keys)
             ;; We don't have <systemd/sd-daemon.h>.
             (substitute* '("common/gdm-log.c"
                            "daemon/gdm-server.c"
@@ -5665,6 +5665,16 @@ libxml2.")
               (("\"gnome-session\"")
                (string-append "\"" (assoc-ref inputs "gnome-session")
                               "/bin/gnome-session\"")))
+            ;; Do not automatically select the placeholder session.
+            (substitute* "daemon/gdm-session.c"
+              (("!g_str_has_suffix [(]base_name, \"\\.desktop\"[)]")
+               (string-append "!g_str_has_suffix (base_name, \".desktop\") || "
+                              "(g_strcmp0(search_dirs[i], \""
+                              (assoc-ref outputs "out") "/share/gdm/BuiltInSessions/"
+                              "\") == 0 && "
+                              "g_strcmp0(base_name, \"fail.desktop\") == 0)"))
+              (("g_error [(]\"GdmSession: no session desktop files installed, aborting\\.\\.\\.\"[)];")
+               "{ self->priv->fallback_session_name = g_strdup(\"fail\"); goto out; }"))
             #t))
          ;; GDM requires that there be at least one desktop entry
          ;; file.  This phase installs a hidden one that simply
-- 
2.21.0


[-- Attachment #3: Type: text/plain, Size: 560 bytes --]


In the future, we should find a way to make GDM errors less
catastrophic, but I doubt we could do that in a day (I certainly
couldn’t)!

> Thank you for looking into this Tim! I have gone back to SLiM for the
> time being until it is fixed :).
>
> If anybody else is having this issue, going back to SLiM is really
> easy, check out my commit for reference.
>
> https://github.com/brettgilio/guix-system/commit/64d389db13c2f78ee5c58af28c1639b098113c93

Thanks for providing this.  Hopefully it helps anybody else having
problems.


-- Tim

  reply	other threads:[~2019-04-29 19:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  4:30 bug#35484: GDM failing to start stumpwm after merge Brett Gilio
2019-04-29  8:46 ` pelzflorian (Florian Pelz)
2019-04-29 13:16 ` Timothy Sample
2019-04-29 16:05   ` Timothy Sample
2019-04-29 17:20     ` brettg
2019-04-29 19:08       ` Timothy Sample [this message]
2019-04-29 21:49         ` Ludovic Courtès
2019-04-30  3:10           ` Timothy Sample
2019-04-30 12:46             ` Ludovic Courtès
2019-04-30  0:44         ` Brett Gilio
2019-04-30  3:20           ` Timothy Sample
2019-04-29 15:25 ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y33spr33.fsf@ngyro.com \
    --to=samplet@ngyro.com \
    --cc=35484@debbugs.gnu.org \
    --cc=brettg@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.