GNU bug report logs - #78770
31.0.50; listing packages has become impossible without creating random lisp directories

Previous Next

Package: emacs;

Reported by: "Mark A. Hershberger" <mah <at> everybody.org>

Date: Thu, 12 Jun 2025 02:24:02 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 78770 AT debbugs.gnu.org.

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-gnu-emacs <at> gnu.org:
bug#78770; Package emacs. (Thu, 12 Jun 2025 02:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Mark A. Hershberger" <mah <at> everybody.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 12 Jun 2025 02:24:02 GMT) Full text and rfc822 format available.

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

From: "Mark A. Hershberger" <mah <at> everybody.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Philip Kaludercic <philipk <at> posteo.net>
Subject: 31.0.50; listing packages has become impossible without creating
 random lisp directories
Date: Wed, 11 Jun 2025 22:22:34 -0400
Attempting to list packages consistently ends up with an error.  Backtrace:

Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/home/mah/lisp")
  package-vc-commit(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/.emacs.d/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
  package-menu--print-info-simple(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/.emacs.d/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
  package-menu--refresh(t nil)
  package-menu--generate(nil t)
  package-list-packages(nil)
  funcall-interactively(package-list-packages nil)
  command-execute(package-list-packages record)
  #<subr execute-extended-command>(nil "package-list-packages" nil)
  ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "package-list-packages" nil)
  apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "package-list-packages" nil))
  execute-extended-command(nil "package-list-packages" nil)
  funcall-interactively(execute-extended-command nil "package-list-packages" nil)
  command-execute(execute-extended-command)


This problem was introduced with the following commit. Rolling back this
commit fixes the problem:

ef5c7ec4990a603ff476e2266c31ea055ac0b609
Author:     Philip Kaludercic <philipk <at> posteo.net>
AuthorDate: Wed Apr 30 17:07:09 2025 +0200

Improve detection of VC package revisions

* lisp/emacs-lisp/package-vc.el (package-vc-commit): If the
package specification lists a :lisp-dir, use that to search for
Lisp files.

1 file changed, 3 insertions(+), 1 deletion(-)
 lisp/emacs-lisp/package-vc.el | 4 +++-

modified    lisp/emacs-lisp/package-vc.el
@@ -219,7 +219,9 @@ package-vc-commit
   ;; FIXME: vc should be extended to allow querying the commit of a
   ;; directory (as is possible when dealing with git repositories).
   ;; This should be a fallback option.
-  (cl-loop with dir = (package-desc-dir pkg-desc)
+  (cl-loop with dir = (let ((pkg-spec (package-vc--desc->spec pkg-desc)))
+                        (or (plist-get pkg-spec :lisp-dir)
+                            (package-desc-dir pkg-desc)))
            for file in (directory-files dir t "\\.el\\'" t)
            when (vc-working-revision file) return it
            finally return "unknown"))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78770; Package emacs. (Thu, 12 Jun 2025 06:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Mark A. Hershberger" <mah <at> everybody.org>
Cc: 78770 <at> debbugs.gnu.org, philipk <at> posteo.net
Subject: Re: bug#78770: 31.0.50;
 listing packages has become impossible without creating random lisp
 directories
Date: Thu, 12 Jun 2025 09:27:19 +0300
> Cc: Philip Kaludercic <philipk <at> posteo.net>
> Date: Wed, 11 Jun 2025 22:22:34 -0400
> From:  "Mark A. Hershberger" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 
> Attempting to list packages consistently ends up with an error.  Backtrace:

I don't get any errors here, FWIW.

> Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/home/mah/lisp")
>   package-vc-commit(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/.emacs.d/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
>   package-menu--print-info-simple(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/.emacs.d/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
>   package-menu--refresh(t nil)
>   package-menu--generate(nil t)
>   package-list-packages(nil)
>   funcall-interactively(package-list-packages nil)
>   command-execute(package-list-packages record)
>   #<subr execute-extended-command>(nil "package-list-packages" nil)
>   ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "package-list-packages" nil)
>   apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "package-list-packages" nil))
>   execute-extended-command(nil "package-list-packages" nil)
>   funcall-interactively(execute-extended-command nil "package-list-packages" nil)
>   command-execute(execute-extended-command)

What is that advice shown in the backtrace?  Does this problem happen
in "emacs -Q"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78770; Package emacs. (Thu, 12 Jun 2025 13:31:02 GMT) Full text and rfc822 format available.

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

From: "Mark A. Hershberger" <mah <at> everybody.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78770 <at> debbugs.gnu.org, philipk <at> posteo.net
Subject: Re: bug#78770: 31.0.50; listing packages has become impossible
 without creating random lisp directories
Date: Thu, 12 Jun 2025 09:29:34 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Attempting to list packages consistently ends up with an error.  Backtrace:
>
> I don't get any errors here, FWIW.

I, also, do not get any errors with emacs -Q.

>>   ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "package-list-packages" nil)
>
> What is that advice shown in the backtrace?

The advice was from multiple-cursors.  Removing that package still
results in an error.  I thought the error might have something to do
with the directory it was executed in, but creating an empty  directory
under /tmp showed the same problem.

Here is the current backtrace with multiple-cursors removed and
executing in the new directory:

Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/tmp/test/lisp")
  package-vc-commit(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/emacsd-test/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
  package-menu--print-info-simple(#s(package-desc :name forge :version (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir "/home/mah/emacsd-test/elpa/forge" :extras ((:commit . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
  package-menu--refresh(t nil)
  package-menu--generate(nil t)
  list-packages(nil)
  funcall-interactively(list-packages nil)
  command-execute(list-packages record)
  execute-extended-command(nil "list-packages" "package lis")
  funcall-interactively(execute-extended-command nil "list-packages" "package lis")
  command-execute(execute-extended-command)

I will continue to look for the cause.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78770; Package emacs. (Sat, 14 Jun 2025 22:34:02 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: "Mark A. Hershberger" <mah <at> everybody.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78770 <at> debbugs.gnu.org
Subject: Re: bug#78770: 31.0.50; listing packages has become impossible
 without creating random lisp directories
Date: Sat, 14 Jun 2025 22:32:56 +0000
"Mark A. Hershberger" <mah <at> everybody.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Attempting to list packages consistently ends up with an error.  Backtrace:
>>
>> I don't get any errors here, FWIW.
>
> I, also, do not get any errors with emacs -Q.
>
>>>   ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "package-list-packages" nil)
>>
>> What is that advice shown in the backtrace?
>
> The advice was from multiple-cursors.  Removing that package still
> results in an error.  I thought the error might have something to do
> with the directory it was executed in, but creating an empty  directory
> under /tmp showed the same problem.
>
> Here is the current backtrace with multiple-cursors removed and
> executing in the new directory:
>
> Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/tmp/test/lisp")

Did you perhaps use `package-vc-install-from-checkout' on a directory
you had checked out in /tmp/?

>   package-vc-commit(#s(package-desc :name forge :version (0 5 3)
> :summary "Access Git forges from Magit" :reqs ((emacs (29 1)) (compat
> (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2)) (let-alist
> (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2 7)) (seq (2
> 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive nil :dir
> "/home/mah/emacsd-test/elpa/forge" :extras ((:commit
> . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
>   package-menu--print-info-simple(#s(package-desc :name forge :version
> (0 5 3) :summary "Access Git forges from Magit" :reqs ((emacs (29 1))
> (compat (30 1)) (closql (2 2 2)) (emacsql (4 3 1)) (ghub (4 3 2))
> (let-alist (1 0 6)) (llama (0 6 3)) (magit (4 3 6)) (markdown-mode (2
> 7)) (seq (2 24)) (transient (0 9 0)) (yaml (1 2 0))) :kind vc :archive
> nil :dir "/home/mah/emacsd-test/elpa/forge" :extras ((:commit
> . "aaeec51cca677e678032c87c26d6024efd7c71c4")) :signed nil))
>   package-menu--refresh(t nil)
>   package-menu--generate(nil t)
>   list-packages(nil)
>   funcall-interactively(list-packages nil)
>   command-execute(list-packages record)
>   execute-extended-command(nil "list-packages" "package lis")
>   funcall-interactively(execute-extended-command nil "list-packages" "package lis")
>   command-execute(execute-extended-command)
>
> I will continue to look for the cause.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78770; Package emacs. (Sun, 15 Jun 2025 21:51:02 GMT) Full text and rfc822 format available.

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

From: "Mark A. Hershberger" <mah <at> everybody.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78770 <at> debbugs.gnu.org
Subject: Re: bug#78770: 31.0.50; listing packages has become impossible
 without creating random lisp directories
Date: Sun, 15 Jun 2025 17:49:33 -0400
I was in the process of replying to your email (see below) and I
discovered what looks like an important hint.

I do not have an early-init.el, but when I start emacs I see a list of
loading files:

     $ emacs --init-directory=/home/mah/emacsd-test --eval '(progn (toggle-debug-on-error) (list-packages))'
     Loading /home/mah/.emacs.d/elpa/php-mode/lisp/php-mode-autoloads.el (source)...
     Loading /home/mah/.emacs.d/elpa/php-mode/lisp/php-mode-autoloads.el (source)...done
     Loading /home/mah/.emacs.d/elpa/password-store/contrib/emacs/password-store-autoloads.el (source)...
     Loading /home/mah/.emacs.d/elpa/password-store/contrib/emacs/password-store-autoloads.el (source)...done
     Loading /home/mah/.emacs.d/elpa/ghub/lisp/ghub-autoloads.el (source)...
     Loading /home/mah/.emacs.d/elpa/ghub/lisp/ghub-autoloads.el (source)...done
     Loading /home/mah/.emacs.d/elpa/forge/lisp/forge-autoloads.el (source)...
     Loading /home/mah/.emacs.d/elpa/forge/lisp/forge-autoloads.el (source)...done
     Loading /home/mah/.emacs.d/elpa/mastodon/lisp/mastodon-autoloads.el (source)...
     Loading /home/mah/.emacs.d/elpa/mastodon/lisp/mastodon-autoloads.el (source)...done

As you can see, it is loading them from ~/.emacs.d even though I told it
to use ~/emacsd-test for the init directory.

Further, each of those packages listed has :lisp-dir specified in my
customizations.  For example:

     (mastodon :url "https://codeberg.org/martianh/mastodon.el" :lisp-dir "lisp/")

There are other packages that have :lisp-dir specified, but removing
:lisp-dir for only those packages with an early auto-loader resolves the problem.

If it is still needed, here is what I started to reply:

Philip Kaludercic <philipk <at> posteo.net> writes:

> Did you perhaps use `package-vc-install-from-checkout' on a directory
> you had checked out in /tmp/?

I did not, but something did.  I imagine this is part of the new :vc for
use-package.  My init.el includes the following:

    (use-package mastodon
      :vc (:url "https://codeberg.org/martianh/mastodon.el" :lisp-dir "lisp/" :rev :newest)
      :custom
      (mastodon-instance-url "https://fosstodon.org")
      (mastodon-active-user "hexmode"))

And, the following sequence:

    ~$ cd /tmp
    /tmp$ ls -ld /tmp/.git
    ls: cannot access '/tmp/.git': No such file or directory
    /tmp$ ls -ld /.git
    ls: cannot access '/.git': No such file or directory
    /tmp$ mkdir test
    /tmp$ cd test
    /tmp/test$ emacs --init-directory=/home/mah/emacsd-test --eval '(progn (toggle-debug-on-error) (list-packages))'

Results in the following backtrace:

    Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/tmp/test/lisp")
      directory-files("lisp/" t "\\.el\\'" t)
      package-vc-commit(#s(package-desc :name mastodon :version (2 0 1) :summary "Client for fediverse services using the Mastodon API" :reqs ((emacs (27 1)) (emacs (28 1)) (persist (0 4)) (tp (0 7))) :kind vc :archive nil :dir "/home/mah/emacsd-test/elpa/mastodon" :extras ((:commit . "f6247f0c9b8c15b19e8ddca2f600ceb2cf48beb9")) :signed nil))
      package-menu--print-info-simple(#s(package-desc :name mastodon :version (2 0 1) :summary "Client for fediverse services using the Mastodon API" :reqs ((emacs (27 1)) (emacs (28 1)) (persist (0 4)) (tp (0 7))) :kind vc :archive nil :dir "/home/mah/emacsd-test/elpa/mastodon" :extras ((:commit . "f6247f0c9b8c15b19e8ddca2f600ceb2cf48beb9")) :signed nil))
      package-menu--refresh(t nil)
      package-menu--generate(nil t)
      list-packages()
      (progn (toggle-debug-on-error) (list-packages))
      eval((progn (toggle-debug-on-error) (list-packages)) t)
      command-line-1(("--eval" "(progn (toggle-debug-on-error) (list-packages))"))
      command-line()
      normal-top-level()

Thanks,

Mark.




This bug report was last modified 1 day ago.

Previous Next


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