Subject: bug#75709: closed (Re: [bug#75817] [PATCH v2] profiles: emacs-subdirs: Avoid building list with a loop)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 03 Feb 2025 20:25:03 +0000

Your bug report

#75709: Emacs fails to start with "List contains a loop" error

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75709: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75709
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#75817] [PATCH v2] profiles: emacs-subdirs: Avoid building list with a loop
From: Liliana Marie Prikler <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked], [email-masked], Thiago Jung Bauermann <[email-masked]>
Date: Mon, 03 Feb 2025 21:24:23 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Am Montag, dem 03.02.2025 um 20:40 +0100 schrieb Ludovic Courtès:
> Hey Liliana,
> 
> Ludovic Courtès <[email-masked]> skribis:
> 
> > Liliana Marie Prikler <[email-masked]> skribis:
> > 
> > > > Looking forward to applying this fix (exwm wouldn’t start this
> > > > morning).
> > > > :-)
> > > Welp, I just found out the hard way there is no jobset for emacs-
> > > team…  Should we add one or just directly push to master?
> > 
> > There was one but it was deactivated; I’ve now reactivated it.
> > 
> >   https://ci.guix.gnu.org/jobset/emacs-team
> 
> Could you please merge it if that’s OK?
> 
> I think it’s a real problem to keep Emacs broken when we have a fix
> and substitutes.
Ahh, my bad.  It was already merged as
f9b1e548c95a115e2bb143d0f4b1632a600f32da, but I forgot to close the
bug.

Cheers

Subject: Emacs fails to start with "List contains a loop" error
From: Thiago Jung Bauermann <[email-masked]>
To: [email-masked]
Date: Mon, 20 Jan 2025 19:43:00 -0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Since a recent "guix pull", Emacs (I tested with the emacs-pgtk package)
can't start up anymore:

$ emacs
List contains a loop: ("/home/user/.guix-profile/lib/emacs/native-site-lisp" "/gnu/store/k62mmzkbmivw2r3wwlpcxs3lp9vwjyac-emacs-lsp-mode-9.0.0/lib/emacs/native-site-lisp" "/home/user/.guix-profile/lib/emacs/native-site-lisp" "/home/user/.guix-profile/lib/emacs/native-site-lisp" "/gnu/store/k62mmzkbmivw2r3wwlpcxs3lp9vwjyac-emacs-lsp-mode-9.0.0/lib/emacs/native-site-lisp" . #2)
$ echo $?
255

The root cause of the problem is that I have duplicate path entries in
these environment variables:

$ env | grep EMACS
EMACSNATIVELOADPATH=/home/sademeo/.guix-profile/lib/emacs/native-site-lisp:/home/sademeo/.guix-profile/lib/emacs/native-site-lisp
EMACSLOADPATH=/home/sademeo/.guix-profile/share/emacs/site-lisp:/home/sademeo/.guix-profile/share/emacs/site-lisp

If I remove the duplicate entries, Emacs starts correctly again.

I suppose this is a common problem (it's surprisingly hard to ensure a
given shell initialization snippet will run only once), and also it's
hardly a fatal or unrecoverable error. IMHO it should warrant at most a
warning message (if that), not a complete abort of the program.

With that in mind, I bisected Guix and arrived at this commit:

e9b13294700de7082ee23aa6e1c17b4a8c8828ec is the first bad commit
commit e9b13294700de7082ee23aa6e1c17b4a8c8828ec

    profiles: emacs-subdirs: Also expand native-comp-eln-load-path.

To reproduce the problem, it's enough to install emacs-pgtk and
emacs-ccls in your profile. It might be necessary to remove them and
then install them again, not sure why.

Guix version:

$ guix describe
Generation 17   jan 20 2025 18:48:17    (current)
  guix e9b1329
    repository URL: https://git.savannah.gnu.org/git/guix.git
    commit: e9b13294700de7082ee23aa6e1c17b4a8c8828ec

It's probably irrelevant, but just for completeness: Guix is installed
on top of Ubuntu 24.10.

--
Thiago