From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: seq; Error during initial package install Date: Sat, 27 Apr 2024 09:17:17 +0000 Message-ID: <87bk5vrwpu.fsf@posteo.net> References: <86le4zw6bu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Parker, Ron" , Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 27 11:18:08 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s0eC8-0007kH-8D for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Apr 2024 11:18:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0eBU-0007Fb-Kv; Sat, 27 Apr 2024 05:17:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0eBR-0007ES-LM for emacs-devel@gnu.org; Sat, 27 Apr 2024 05:17:25 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0eBO-00022b-Rj for emacs-devel@gnu.org; Sat, 27 Apr 2024 05:17:25 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 93CCE24002B for ; Sat, 27 Apr 2024 11:17:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714209439; bh=jU3S+EYfHbtWnP1hGrPDbEGKRYfAGK8owGHiYLvGG1E=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=eAscQFIkBY2JPdSUxzdKb+bRgKAJMGFOE8ocHv2Hhdc+cCrH0e+s48bYSVaaG9l69 M+CFEAE/sg9R0J6YwIoUJaYheS2jByIel4jU27iS950WtbgnSYufDDGUzg6LS4AjtT DMKdA6w2uGeOT0P9OqQ9uOoVbvv+IzJui19JgINV0ckVqjxupFn2M9Cq8PWtBEb3tI F1HpGUnwuI+vzGCHaBQu3gagFnZ05qAqVxQBuyY1VGhxZ95GCtS7H/W/Kd1PHQuuyL i807qcPtoJSUY6v1xpQu3TResCr2vyHoXi6YgcqXeT4K+Ehc8XxdhAiP73lEJGpAAt D5OmfFEvyW3sw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VRPB62zLkz9rxF; Sat, 27 Apr 2024 11:17:18 +0200 (CEST) In-Reply-To: <86le4zw6bu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Apr 2024 11:36:05 +0300") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318181 Archived-At: Eli Zaretskii writes: >> From: "Parker, Ron" >> Date: Thu, 18 Apr 2024 18:29:19 +0000 >> >> When I start Emacs on a fresh install of my configuration, I have to >> restart a couple times before all of the packages successfully install. >> Upon trying to debug it, I ran into an error with seq being unable to >> load seq-25.el and reduced it to a minimal test case. >> >> Put the following in an empty directory as init.el: >> >> (setq debug-on-error t >> package-install-upgrade-built-in t) >> (package-install 'seq) >> >> then in the directory run: >> >> emacs -Q --init-directory $(pwd) -l init.el >> >> When I do this, I get the following error: >> >> Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "seq-25") >> require(seq-25) >> (if (version< emacs-version "25") (require 'seq-24) (require 'seq-25)) The issue is that package.el is re-loading the built-in seq, but all the seq.el on ELPA does is try to load the right version of seq (for Emacs 24 or 25, as seen above). At this point the load-path has not been modified yet, which is why `require' fails. I see two solutions: 1. Temporarily prepends the directory to load-path: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ab1731aeb54..9eea1c45db5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -871,8 +871,9 @@ package--reload-previously-loaded (unless (equal (file-name-base library) (format "%s-autoloads" (package-desc-name pkg-desc))) (push (cons (expand-file-name library dir) recent-index) result)))) - (mapc (lambda (c) (load (car c) nil t)) - (sort result (lambda (x y) (< (cdr x) (cdr y)))))))) + (let ((load-path (cons dir load-path))) + (mapc (lambda (c) (load (car c) nil t)) + (sort result (lambda (x y) (< (cdr x) (cdr y))))))))) (defun package-activate-1 (pkg-desc &optional reload deps) "Activate package given by PKG-DESC, even if it was already active. 2. Loads the autoload file before reloading the package, thus updating load-path, since this is done in the autoloads file: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ab1731aeb54..bed0122e8ca 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -898,10 +898,10 @@ package-activate-1 (if (listp package--quickstart-pkgs) ;; We're only collecting the set of packages to activate! (push pkg-desc package--quickstart-pkgs) - (when reload - (package--reload-previously-loaded pkg-desc)) (with-demoted-errors "Error loading autoloads: %s" - (load (package--autoloads-file-name pkg-desc) nil t))) + (load (package--autoloads-file-name pkg-desc) nil t)) + (when reload + (package--reload-previously-loaded pkg-desc))) ;; Add info node. (when (file-exists-p (expand-file-name "dir" pkg-dir)) ;; FIXME: not the friendliest, but simple. I cannot test this right now, since there appears to be an unrelated issue with elpa.gnu.org's signing keys? >> load-with-code-conversion("/Users//.emacs-test-elpa-seq/elpa/seq-2.24/seq..." >> "/Users//.emacs-test-elpa-seq/elpa/seq-2.24/seq..." nil t) >> # >> (("/Users//.emacs-test-elpa-seq/elpa/seq-2.24/seq" . 76)) >> mapc(# >> (("/Users//.emacs-test-elpa-seq/elpa/seq-2.24/seq" . 76))) >> package--reload-previously-loaded(#s(package-desc :name seq :version (2 24) :summary "Sequence >> manipulation functions" :reqs nil :kind nil :archive nil :dir >> "/Users//.emacs-test-elpa-seq/elpa/seq-2.24" :extras ((:keywords "sequences") (:maintainer nil . >> emacs-devel@gnu.org) (:authors ("Nicolas Petton" . nicolas@petton.fr)) (:url . >> https://elpa.gnu.org/packages/seq.html) (:commit . "27a90793a13f149121180e864fa53d68b9eac0b3")) : >> signed nil)) >> >> package-activate-1(#s(package-desc :name seq :version (2 24) :summary "Sequence manipulation >> functions" :reqs nil :kind nil :archive nil :dir "/Users//.emacs-test-elpa-seq/elpa/seq-2.24" :extras >> ((:keywords "sequences") (:maintainer nil . emacs-devel@gnu.org) (:authors ("Nicolas Petton" . >> nicolas@petton.fr)) (:url . https://elpa.gnu.org/packages/seq.html) (:commit . >> "27a90793a13f149121180e864fa53d68b9eac0b3")) :signed nil) :reload :deps) >> >> package-unpack(#s(package-desc :name seq :version (2 24) :summary "Sequence manipulation functions" >> :reqs nil :kind tar :archive "gnu" :dir nil :extras ((:keywords "sequences") (:maintainer nil . >> emacs-devel@gnu.org) (:authors ("Nicolas Petton" . nicolas@petton.fr)) (:url . >> https://elpa.gnu.org/packages/seq.html) (:commit . "27a90793a13f149121180e864fa53d68b9eac0b3")) : >> signed nil)) >> >> #f(compiled-function () #)() >> >> package--with-response-buffer-1(https://elpa.gnu.org/packages/ #f(compiled-function () #> 0x1511bb8ba7930de3>) :file "seq-2.24.tar" :async nil :error-function #> F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_79> :noerror nil) >> >> package-install-from-archive(#s(package-desc :name seq :version (2 24) :summary "Sequence >> manipulation functions" :reqs nil :kind tar :archive "gnu" :dir nil :extras ((:keywords "sequences") (:maintainer >> nil . emacs-devel@gnu.org) (:authors ("Nicolas Petton" . nicolas@petton.fr)) (:url . >> https://elpa.gnu.org/packages/seq.html) (:commit . "27a90793a13f149121180e864fa53d68b9eac0b3")) : >> signed nil)) >> >> package-download-transaction((#s(package-desc :name seq :version (2 24) :summary "Sequence >> manipulation functions" :reqs nil :kind tar :archive "gnu" :dir nil :extras ((:keywords "sequences") (:maintainer >> nil . emacs-devel@gnu.org) (:authors ("Nicolas Petton" . nicolas@petton.fr)) (:url . >> https://elpa.gnu.org/packages/seq.html) (:commit . "27a90793a13f149121180e864fa53d68b9eac0b3")) : >> signed nil))) >> package-install(seq) >> load-with-code-conversion("/Users//.emacs-test-elpa-seq/init.el" >> "/Users//.emacs-test-elpa-seq/init.el" nil t) >> command-line-1(("-l" "init.el" "init.el")) >> command-line() >> normal-top-level() >> >> Emacs : GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2.1 (Build >> 23C71)) >> >> Package: seq > > Stefan and Philip, any comments or suggestions? -- Philip Kaludercic on peregrine