Subject: Re: bug#61882: emacs-next-pgtk does not find emacs-org-roam, other path issues

From: Liliana Marie Prikler <[email-masked]>
Date: Thu, 02 Mar 2023 08:11:16 +0100

Am Mittwoch, dem 01.03.2023 um 17:11 +0100 schrieb Csepp:
> 
> [email-masked] writes:
> 
> > Hi,
> > 
> > On +2023-03-01 12:16:56 +0100, Csepp wrote:
> > [...]
> > > How the hell would my paths affect what's in the bin folder? 
> > > Like, the flatpak binary is literally not present in the profile,
> > > that's why it's not showing up in $PATH.
> > 
> > Could something in one of your path directories
> > accidentally have gotten a name starting with '-' ?
> > (or full name '-')?
> > 
> > Surprising things can happen depending on how an
> > app rejects an unexpected option, or tries to use it :)
> > 
> > BTW: If you can't delete a file named '-'
> >      try emacs dirmode. IIRC emacs seems to see
> >      anything and be able to delete it.
> > 
> > Do you have any scripts that are both sourced and executed?
> > If so, are they doing return or exit respectively or
> > something trickier as intended?
> 
> So, first things first:
> % guix package -I | grep -E '(flatpak|roam)'
> emacs-org-roam          2.2.2-
> 0.74422df         out             /gnu/store/bxxjy8ydm62fr0bckxfrj27x
> nlvqbfmy-emacs-org-roam-2.2.2-0.74422df
> flatpak                 1.14.1                  out             /gnu/
> store/mf0k987xvpgk79l74lmdjv9jz8gy8cdf-flatpak-1.14.1
> 
> Both are installed.
> 
> ls $(guix build flatpak)/bin/
> flatpak  flatpak-bisect  flatpak-coredumpctl
> 
> The store paths also match.
> 
> This path also exists:
> $(guix build emacs-org-roam)/share/emacs/site-lisp/org-roam-2.2.2-
> 0.74422df
You're comparing apples to oranges here.  `guix build' need not
reproduce the contents of your profile, especially if you pulled a new
version of guix in between.  Instead, try listing the contents of the
reported store paths.

As for `guix build' and `guix shell' producing different results within
a single generation, the only instance I know of which has this
requires the presence of grafts (and IIRC might already be fixed?)

> I don't know the details of how Emacs loads things, but org-roam has
> an org-roam-autoloads.el while lsp-mode (a package that does work)
> does not.
There ought to be a subdirs.el in your $GUIX_PROFILE/share/emacs/site-
lisp, which explicitly mentions the directories to add to your load
path.  These are store paths.  Thus, even in the off chance that some
symlink in your profile is gone (which I'd find highly alerting in the
first place), it should correctly see the package to add.

> Some relevant paths:
> EMACSLOADPATH=/home/raingloom/.guix-profile/share/emacs/site-lisp
> PATH=/home/raingloom/.local/bin:/run/setuid-
> programs:/home/raingloom/.config/guix/current/bin:/home/raingloom/.gu
> ix-profile/bin:/home/raingloom/.guix-profile/sbin:/run/current-
> system/profile/bin:/run/current-system/profile/sbin
> 
> The only additional item is on PATH and at worst it would shadow an
> existing flatpak binary.  But it doesn't, there is just a single
> utility
> script there that I should probably get rid of.
> 
> Also:
> guix shell --check -p .guix-profile
> This seems to hang.  Or at least it's taking an awful long time for
> something so simple.
You could try something easier like the aforementioned `guix shell
emacs-next-pgtk emacs-org-roam --pure --check'.

> I'm running Guix as my system distro and I'm not in the habit of
> adding random junk to my dotfiles, so I would be rather surprised if
> this turned out to be a path issue
Good to know.

> especially when it's obvious the packages are literally not even
> showing up in the profile they are supposed to show up in.
This was not obvious from your previous report, which see
> emacs-org-roam is installed in my default profile and all the other
> emacs packages work with the emacs-next-pgtk package in the same
> profile.
> guix shell emacs-org-roam emacs-next-pgtk does not work, guix shell
> emacs-org-roam emacs does.
Basing my response on this rather than the otherwise inconsequential
bit about flatpak, it would appear as though you are reporting a bug
specific to emacs-next-pgtk rather than emacs-org-roam.

> % ls ~/.guix-profile/share/emacs/site-lisp/
> 
> This does not print any org-roam directory.
Which leads me to believe that
$ ls /gnu/store/bxxjy8ydm62fr0bckxfrj27xnlvqbfmy-emacs-org-roam-2.2.2-
0.74422df/share/emacs/site-lisp
does not report any such directory either.

If that is indeed the case, try `guix build --repair'-ing it.

This still does not explain the different behaviour of emacs vs. emacs-
next-pgtk in your shell, which has further debugging complexities due
to the lack of isolation.

Cheers