GNU bug report logs - #42333
Doom Emacs breaks the Emacs autoloads mechanism used in Guix

Previous Next

Package: guix;

Reported by: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>

Date: Sun, 12 Jul 2020 07:13:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.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 42333 in the body.
You can then email your comments to 42333 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 bug-guix <at> gnu.org:
bug#42333; Package guix. (Sun, 12 Jul 2020 07:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 12 Jul 2020 07:13:02 GMT) Full text and rfc822 format available.

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

From: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
To: bug-guix <at> gnu.org
Subject: Emacs: error on guix-emacs-autoload-packages
Date: Sun, 12 Jul 2020 13:11:58 +0300
Hi,

I'm having a bit of trouble with Emacs on Guix. When I do `M-x
guix-emacs-autoload-packages` I get the following error:

--8<---------------cut here---------------start------------->8---
guix-emacs-find-autoloads: Opening directory: No such file or directory, /home/brown121407/.guix-profile/share/emacs/site-lisp/contrib
--8<---------------cut here---------------end--------------->8---

This happened (this time!) after I installed Org mode from the package
interface in Emacs. I don't think that is exacly what triggered it now
but that was the last thing I did before restarting Emacs and running
into this. The other times it happened (twice before) I don't remember
what I was doing.

I'm using Doom Emacs right now. I have problems with Emacs almost since
I set it up on this laptop. I use the same config I'm using on my PC,
where everything works. Both machines use Guix System.

Besides this problem with loading Emacs packages from Guix I also
encountered problems with Org mode while trying to build my website.
Those were also not met before, on the same config, on my PC.

In case someone wants to test building the website:

1. Clone https://git.sr.ht/~brown121407/brown.121407.xyz
2. Open publish.el in Emacs
3. M-x eval-buffer RET
4. M-x b7-publish-all RET

It requires Org mode and the stuff you'd expect to publish HTML like
htmlize and also the contrib files of Org which on Guix should be in the
emacs-org-contrib package.

If all is fine (as it is on my PC) you should go through the whole site
build fine. But if it's borked as it is on my laptop it should give you
some obscure errors about setting IDs (if you check the backtrace it
should be something about `org-id-add-location` or similar things). That
is if you don't run into other errors earlier than that stage (which
happened to me).

Here's my EMACSLOADPATH:

--8<---------------cut here---------------start------------->8---
[brown121407 <at> T420 ~]$ echo $EMACSLOADPATH
/home/brown121407/.guix-profile/share/emacs/site-lisp:/home/brown121407/.guix-profile/share/emacs/26.3/lisp:/home/brown121407/.guix-profile/share/emacs/site-lisp:/home/brown121407/.guix-profile/share/emacs/26.3/lisp:/home/brown121407/.guix-profile/share/emacs/site-lisp:/home/brown121407/.guix-profile/share/emacs/26.3/lisp
--8<---------------cut here---------------end--------------->8---

Here's the backtrace:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/home/brown121407/.guix-profile/share/emacs/site-lisp/contrib")
  directory-files("/home/brown121407/.guix-profile/share/emacs/site-lisp/contrib" full-name ".*-autoloads\\.elc?\\'")
  guix-emacs-find-autoloads("/home/brown121407/.guix-profile/share/emacs/site-lisp/contrib")
  mapcan(guix-emacs-find-autoloads ("/home/brown121407/.guix-profile/share/emacs/site-lisp/contrib" "/home/brown121407/.guix-profile/share/emacs/site-lisp" "/home/brown121407/.guix-profile/share/emacs/site-lisp" "/home/brown121407/.guix-profile/share/emacs/site-lisp"))
  guix-emacs-autoload-packages()
  funcall-interactively(guix-emacs-autoload-packages)
  call-interactively(guix-emacs-autoload-packages record nil)
  command-execute(guix-emacs-autoload-packages record)
  counsel-M-x-action("guix-emacs-autoload-packages")
  ivy-call()
  ivy-read("M-x " ("guix-emacs-autoload-packages" "list-packages" "eval-buffer" "guix" "cd" "5x5" "amx" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "lsp" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "=irc" "=rss" "calc" "diff" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "lsp!" "mail" "mpuz" "mu4e" "pass" "ping" "pong" "talk" "term" "undo" "yank" "zone" "=mu4e" ...) :predicate #f(compiled-function (x) #<bytecode 0x1cd4621>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)
--8<---------------cut here---------------end--------------->8---

Here's the output of `guix describe` and `guix system describe`:

--8<---------------cut here---------------start------------->8---
[brown121407 <at> T420 ~]$ guix describe
Generation 3    Jul 12 2020 11:33:56    (current)
  nonguix d174095
    repository URL: https://gitlab.com/nonguix/nonguix
    branch: master
    commit: d174095d26f46fa148f540fcefbdcef52451f5ec
  brett f2e2d5c
    repository URL: https://git.sr.ht/~brettgilio/cfg
    branch: master
    commit: f2e2d5ca554049715f281b80448b868197da80e6
  evan 6eb4ede
    repository URL: https://git.sr.ht/~ev4nx99/guix-channel
    branch: master
    commit: 6eb4ede0c48502aceb681f45bda15fb28f38b990
  brown121407 7245765
    repository URL: https://git.sr.ht/~brown121407/guix.121407.xyz
    branch: master
    commit: 7245765f85a155ba03fada98cfe8270578594301
  guix 83b5ea9
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 83b5ea9d18772334a47c3d76c6ca73a123cac12c

[brown121407 <at> T420 ~]$ guix system describe
Generation 5    Jul 10 2020 22:27:51    (current)
  file name: /var/guix/profiles/system-5-link
  canonical file name: /gnu/store/2c7rcrqdf11cqgb797l5qfv7xa20q0pb-system
  label: GNU with Linux 5.4.51
  bootloader: grub
  root device: UUID: 792f9783-0923-4f96-a2d3-b083f69dd46c
  kernel: /gnu/store/fxg5iiy5nyvgdj5w00zhgmj9s1hv3z5v-linux-5.4.51/bzImage
  channels:
    nonguix:
      repository URL: https://gitlab.com/nonguix/nonguix
      branch: master
      commit: d174095d26f46fa148f540fcefbdcef52451f5ec
    brett:
      repository URL: https://git.sr.ht/~brettgilio/cfg
      branch: master
      commit: fa4fb6e4e5062614d2d21dfa9c64b52cdc091892
    evan:
      repository URL: https://git.sr.ht/~ev4nx99/guix-channel
      branch: master
      commit: 6eb4ede0c48502aceb681f45bda15fb28f38b990
    brown121407:
      repository URL: https://git.sr.ht/~brown121407/guix.121407.xyz
      branch: master
      commit: 7245765f85a155ba03fada98cfe8270578594301
    guix:
      repository URL: https://git.savannah.gnu.org/git/guix.git
      branch: master
      commit: ec4c404c0575b340a04b3922fb828ac5417832dd
  configuration file: /gnu/store/rsg585v5z1bia3nxgll56h1n5p1vjz2i-configuration.scm
--8<---------------cut here---------------end--------------->8---

Cheers,
Sergiu




Information forwarded to bug-guix <at> gnu.org:
bug#42333; Package guix. (Sun, 12 Jul 2020 10:49:01 GMT) Full text and rfc822 format available.

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

From: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
To: bug-guix <at> gnu.org
Subject: Re: bug#42333: Emacs: error on guix-emacs-autoload-packages
Date: Sun, 12 Jul 2020 16:48:11 +0300
I managed to somehow fix it in a way.

- Uninstall Emacs and all the packages installed with Guix
- rm -rf .emacs.d
- guix gc
- Reinstall Emacs

This way guix-emacs-autoload-packages works again. I installed ALL the
packages I needed from Guix (I ditched Doom Emacs) and generating my
site work too now.

Weird thing is that I needed to (require 'org-id) in the script for my
site but on my PC I don't have to.

I still don't get this weird behaviour.

--
Sergiu




Information forwarded to bug-guix <at> gnu.org:
bug#42333; Package guix. (Mon, 13 Jul 2020 06:42:01 GMT) Full text and rfc822 format available.

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

From: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
To: bug-guix <at> gnu.org
Subject: Re: bug#42333: Emacs: error on guix-emacs-autoload-packages
Date: Mon, 13 Jul 2020 12:41:08 +0300
Alexandru-Sergiu Marton <brown121407 <at> posteo.ro> writes:

> This way guix-emacs-autoload-packages works again. I installed ALL the
> packages I needed from Guix (I ditched Doom Emacs) and generating my
> site works too now.

I managed to narrow down the problem. If I install Doom Emacs, Guix's
EMACSLOADPATH doesn't seem to be loaded at all into the load-path
variable. This can be fixed with:

(mapc (lambda (p) (add-load-path! p)) (split-string (getenv "EMACSLOADPATH") ":"))

At this point it doesn't complain about that contrib path not being
found. To get there, I pulled my config [1] and ran `doom sync`.

The next time I fired up Emacs and I tried to run
`guix-emacs-autoload-packages` it started to complain about that path.
So I guess somewhere in that processes it screws up the load-path even
more if it manages to add "$GUIX_PROFILE/share/emacs/site-lisp/contrib"
in there.

Since I couldn't find anything actually there or using that path, for
now I have this in my config:

(delete (concat (getenv "HOME") "/.guix-profile/share/emacs/site-lisp/contrib") load-path)

I still have no idea why is the thing behaving the way that it is since
I never had issues like this with the same config on my other machine.
If you have any pointers as to what might have happened or had similar
problems yourself I would love to hear from you.


[1] https://git.sr.ht/~brown121407/dotfiles/tree/master/doom/.config/doom

--
Sergiu




Information forwarded to bug-guix <at> gnu.org:
bug#42333; Package guix. (Wed, 15 Jul 2020 16:24:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
Cc: 42333 <at> debbugs.gnu.org
Subject: Re: bug#42333: Emacs: error on guix-emacs-autoload-packages
Date: Wed, 15 Jul 2020 12:23:47 -0400
Hello Alexandru,

Alexandru-Sergiu Marton <brown121407 <at> posteo.ro> writes:

> I managed to somehow fix it in a way.
>
> - Uninstall Emacs and all the packages installed with Guix
> - rm -rf .emacs.d
> - guix gc
> - Reinstall Emacs
>
> This way guix-emacs-autoload-packages works again. I installed ALL the
> packages I needed from Guix (I ditched Doom Emacs) and generating my
> site work too now.
>
> Weird thing is that I needed to (require 'org-id) in the script for my
> site but on my PC I don't have to.
>
> I still don't get this weird behaviour.

If you could come with a minimal reproducer, I could have a look.

Otherwise, I'm afraid there's too many variables to keep track
(emacs-doom, possible conflicts with Org when installed from different
places, etc.).

Thank you,

Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#42333; Package guix. (Sun, 19 Jul 2020 19:50:01 GMT) Full text and rfc822 format available.

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

From: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 42333 <at> debbugs.gnu.org
Subject: Re: bug#42333: Emacs: error on guix-emacs-autoload-packages
Date: Sun, 19 Jul 2020 22:48:53 +0300
Hi, sorry for the long time it took to reply.

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> If you could come with a minimal reproducer, I could have a look.
>
> Otherwise, I'm afraid there's too many variables to keep track
> (emacs-doom, possible conflicts with Org when installed from different
> places, etc.).

I managed to gather more information as I found another person who had
the same problems as me.

Steps to reproduce:
- Install emacs and emacs-telega with guix
- Install Doom Emacs (https://github.com/hlissner/doom-emacs)
- Start Emacs and try M-x telega RET

This should give you an error saying something along the lines of "No
file or directory." Even if it doesn't give you this exact same error,
check what I say below about load-path.

It seems that Doom plays with Emacs' load-path. Telega is just a
concrete example of an Emacs package installed with Guix that isn't
working. You should be able to find problems with many others.

When checking the value of the environment variable EMACSLOADPATH, both
the result from the shell (through echo $EMACSLOADPATH) and from Emacs
(through (getenv "EMACSLOADPATH")) seem to be equal. What is not right
is that the load-path Emacs Lisp variable doesn't contain the paths from
EMACSLOADPATH.

What fixed it for me and the other person was adding this line at the
end of our config.el (Doom's config file):

--8<---------------cut here---------------start------------->8---
(mapc (lambda (p) (add-load-path! p)) (split-string (getenv "EMACSLOADPATH") ":"))
--8<---------------cut here---------------end--------------->8---

This is a hack but gets the job done for now.

I thought about this problem being caused by Doom's envvars file, but
that file contains the correct value of EMACSLOADPATH and we saw that
querying that environment variable from inside Emacs gives the correct
answer.

Finding the root of this problem will be beneficial to a lot of
potential Guix users that might ditch it if they see their beloved Emacs
config doesn't work well with packages installed from Guix.

Cheers,
Sergiu




Information forwarded to bug-guix <at> gnu.org:
bug#42333; Package guix. (Fri, 24 Jul 2020 23:04:02 GMT) Full text and rfc822 format available.

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

From: Brett Gilio <brettg <at> gnu.org>
To: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>
Cc: 42333 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#42333: Emacs: error on guix-emacs-autoload-packages
Date: Fri, 24 Jul 2020 18:03:25 -0500
Alexandru-Sergiu Marton <brown121407 <at> posteo.ro> writes:
>
> (mapc (lambda (p) (add-load-path! p)) (split-string (getenv "EMACSLOADPATH") ":"))
>

Are you still needing to use this snippet to get your configuration to work?




Changed bug title to 'Doom Emacs breaks the Emacs autoloads mechanism used in Guix' from 'Emacs: error on guix-emacs-autoload-packages' Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 01 Sep 2020 18:03:02 GMT) Full text and rfc822 format available.

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Thu, 14 Jul 2022 02:43:02 GMT) Full text and rfc822 format available.

Notification sent to Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>:
bug acknowledged by developer. (Thu, 14 Jul 2022 02:43:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Brett Gilio <brettg <at> gnu.org>
Cc: Alexandru-Sergiu Marton <brown121407 <at> posteo.ro>, 42333-done <at> debbugs.gnu.org
Subject: Re: bug#42333: Doom Emacs breaks the Emacs autoloads mechanism used
 in Guix
Date: Wed, 13 Jul 2022 22:42:03 -0400
Hi,

Brett Gilio <brettg <at> gnu.org> writes:

> Alexandru-Sergiu Marton <brown121407 <at> posteo.ro> writes:
>>
>> (mapc (lambda (p) (add-load-path! p)) (split-string (getenv "EMACSLOADPATH") ":"))
>>
>
> Are you still needing to use this snippet to get your configuration to work?

Closing, as we haven't heard back in a long while.

Thanks,

Maxim




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

This bug report was last modified 1 year and 230 days ago.

Previous Next


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