GNU bug report logs - #67025
29.1; Error in Emacs 29.1 when installing seq from ELPA

Previous Next

Package: emacs;

Reported by: Steve Purcell <steve <at> sanityinc.com>

Date: Thu, 9 Nov 2023 18:50:02 UTC

Severity: normal

Found in version 29.1

To reply to this bug, email your comments to 67025 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#67025; Package emacs. (Thu, 09 Nov 2023 18:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve Purcell <steve <at> sanityinc.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Nov 2023 18:50:02 GMT) Full text and rfc822 format available.

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

From: Steve Purcell <steve <at> sanityinc.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1; Error in Emacs 29.1 when installing seq from ELPA
Date: Thu, 9 Nov 2023 18:47:57 +0000
--text follows this line--


Passing on the following from a correspondent who didn't want to file a
bug themselves:

----------------------------------------------------------------------------
To reproduce, save the following Elisp snippet:

(require 'package)
(setf package-user-dir "/tmp/elpa"
      package-archives '(("gnu-devel" . "https://elpa.gnu.org/devel/")))
(package-refresh-contents)
(let ((debug-on-error t))
  (package-install (cadr (assq 'seq package-archive-contents))))

and then from the command line run:

$ emacs --batch --load bug.el

Result here:

$ emacs --batch --load ~/test/test.el
Importing package-keyring.gpg...
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Contacting host: elpa.gnu.org:443
Package refresh done
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Contacting host: elpa.gnu.org:443
Parsing tar file... 
Parsing tar file...done
Extracting... \ 
Extracting...done
  INFO     Scraping files for loaddefs... 
  INFO     Scraping files for loaddefs...done
Source file ‘/tmp/elpa/seq-2.24.0.20230904.183335/seq.el’ newer than byte-compiled file; using older file
Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "seq-25")
  require(seq-25)
  byte-code("\301\10\302\"\203\16\0\303\304!\210\202\22\0\303\305!\210\306\307!\207" [emacs-version version< "25" require seq-24 seq-25 provide seq] 3)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_32>(("/tmp/elpa/seq-2.24.0.20230904.183335/seq" . 76))
  ...
----------------------------------------------------------------------------

My interpretation:

After installing the ELPA version of seq, Emacs decides it must re-load
seq (presumably because it was already loaded from the built-in
version), and then loads seq.el from the downloaded ELPA package. The
problem is that at this point it hasn't added the new ELPA package's
installation directory to load-path, so when seq.el tries to load
seq-25.el, Emacs fails to find that file.

In my own Emacs config, this led to first-time start-up errors in Emacs
29.1 (only), ie. when installing required packages for the first time. I have
worked around it with the following snippet:

(defun sanityinc/reload-previously-loaded-with-load-path-updated (orig pkg-desc)
  (let ((load-path (cons (package-desc-dir pkg-desc) load-path)))
    (funcall orig pkg-desc)))

(advice-add 'package--reload-previously-loaded :around
            'sanityinc/reload-previously-loaded-with-load-path-updated)






This bug report was last modified 176 days ago.

Previous Next


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