all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Steve Purcell <steve@sanityinc.com>
To: 67025@debbugs.gnu.org
Subject: bug#67025: 29.1; Error in Emacs 29.1 when installing seq from ELPA
Date: Thu, 9 Nov 2023 18:47:57 +0000	[thread overview]
Message-ID: <1936A46D-1A9B-4704-8089-8E05B92EC1DC@sanityinc.com> (raw)

--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)







                 reply	other threads:[~2023-11-09 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1936A46D-1A9B-4704-8089-8E05B92EC1DC@sanityinc.com \
    --to=steve@sanityinc.com \
    --cc=67025@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.