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.bugs Subject: bug#65283: 29.1; package-vc-install fails to install package "ement" because some dependencies installed by it are omitted from load-path Date: Tue, 15 Aug 2023 21:52:11 +0000 Message-ID: <878racj7n8.fsf@posteo.net> References: <9bea8c31-fda0-dc75-7c37-ac5aedba1bc4@alphapapa.net> <87sf8mhwip.fsf@posteo.net> <87h6p0jcb3.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30833"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65283@debbugs.gnu.org To: Adam Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 15 23:53:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qW1yf-0007pD-On for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Aug 2023 23:53:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW1yK-0004RN-2U; Tue, 15 Aug 2023 17:53:04 -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 1qW1yI-0004RF-LF for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 17:53:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW1yI-0001cd-C2 for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 17:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qW1yI-0004WK-7a for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 17:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Aug 2023 21:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65283 X-GNU-PR-Package: emacs Original-Received: via spool by 65283-submit@debbugs.gnu.org id=B65283.169213634317329 (code B ref 65283); Tue, 15 Aug 2023 21:53:02 +0000 Original-Received: (at 65283) by debbugs.gnu.org; 15 Aug 2023 21:52:23 +0000 Original-Received: from localhost ([127.0.0.1]:36997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW1xe-0004VP-TV for submit@debbugs.gnu.org; Tue, 15 Aug 2023 17:52:23 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:54703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW1xb-0004VB-GS for 65283@debbugs.gnu.org; Tue, 15 Aug 2023 17:52:21 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 862E0240028 for <65283@debbugs.gnu.org>; Tue, 15 Aug 2023 23:52:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692136333; bh=McBejLWDS05rN8xeZE1ONoOBXm9VOgY2heVpbZucwGo=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=E+ueivTIdL5GdCfIvedptqTeXbuVCVtUdPmWL5Fn5npPre2yrmtrJGXB9nSsbkBBr Rdu2HMpCaCOcpK5qEF6scGoasojNqYPdVzsDlZ0ksTxBDtKoBAbmvTp/o+vBdu19wr o0+ETiYTGd+lueWIFyO5cWkI4Lr3JD7hCotJTBElN+/xIHMg9pQxB3dPlwMP+eQxMY uijwziayBiHjET+eToJXiWuB3R+DEMp6koq4eH6N1JP4S88c+tNLKVarXavh/FyaZO jAPrwaFhuuFjMZKqkc1+bFydJvZyHFGI8b81BlGmjpR8dwfnWV5e7ATm4cfM7ez5UN qT9JOB0Krl6uA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RQQ3J56Smz6tw6; Tue, 15 Aug 2023 23:52:12 +0200 (CEST) In-Reply-To: (Adam Porter's message of "Tue, 15 Aug 2023 15:47:51 -0500") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267522 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Adam Porter writes: > Hi Philip, > > On 8/15/23 15:11, Philip Kaludercic wrote: >> Adam Porter writes: >> >>> On 8/14/23 03:13, Philip Kaludercic wrote: >>>> Adam Porter writes: >>>> >>>>> Hi, >>>>> >>>>> Wanting to test whether package-vc-install in Emacs 29.1 is now a >>>>> suitable replacement for Quelpa for installing my Ement.el > package from >>>>> git, I started an instance of Emacs 29.1 in a clean configuration and >>>>> evaluated: >> >> When you say clean configuration, do you mean that you invoked emacs >> with -Q, or also --init-directory=3D[some fresh directory]? I noticed >> that you appear to be using Guix, so did you perhaps use a Guix >> container shell? > I've tried three different ways now: > > 1. Using my with-emacs.sh script [0] (which was written for Emacs > before the "--init-directory" option was added, but remains compatible > with Emacs 29.1): > > with-emacs.sh -e emacs-29.1 -- --eval '(package-vc-install > "https://github.com/alphapapa/ement.el")' > > 2. Using "-q --init-directory", i.e. > > emacs-29.1 -q --init-directory=3D$(mktemp -d) --eval > '(package-vc-install "https://github.com/alphapapa/ement.el")' > > 3. Using "-Q --init-directory", i.e. > > emacs-29.1 -Q --init-directory=3D$(mktemp -d) --eval > '(package-vc-install "https://github.com/alphapapa/ement.el")' > > All three ways seem to produce the same problem with the same error > messages and the same load-path missing taxy-magit-section's > directory. I have been using the third approach (with the difference that I invoked `package-vc-install' as a command using M-x), and it worked. When I use your command, it doesn't -- so that is good from a reproducability perspective. > I do have Emacs 29.1 installed with Guix, on top of my Debian > system. However, I've been using this setup for quite some time now, > having also used Guix to install Emacs 27 and 28 previously, and I've > never had this problem before. So I don't think that Guix is related > to the problem, although I can't say for certain. I wasn't implying that it was to blame, rather I just wanted to make sure whether or not you were/weren't launching Emacs in an isolated container. > Scouring the "*Messages*" buffer again, I noticed another series of > messages: > > Checking /tmp/tmp.m5Cj6y1gaF/elpa/taxy-0.10.1/examples... > Done (Total of 1 file compiled, 4 failed, 2 skipped in 2 directories) > Contacting host: elpa.gnu.org:443 > Parsing tar file...done > Extracting...done > INFO Scraping files for loaddefs...done > GEN taxy-magit-section-autoloads.el > Unable to activate package =E2=80=98taxy-magit-section=E2=80=99. > Required package =E2=80=98magit-section-3.2.1=E2=80=99 is unavailable > Contacting host: elpa.gnu.org:443 > Parsing tar file...done > Extracting...done > INFO Scraping files for loaddefs...done > GEN dash-autoloads.el > Checking /tmp/tmp.m5Cj6y1gaF/elpa/dash-2.19.1... [2 times] > > As you can see, it says that it can't activate taxy-magit-section > because magit-section-3.2.1 is unavailable. However, about 20 lines > later: > > Checking /tmp/tmp.m5Cj6y1gaF/elpa/dash-2.19.1/doc... > Done (Total of 2 files compiled, 2 skipped) > Contacting host: elpa.nongnu.org:443 > Parsing tar file...done > Extracting...done > INFO Scraping files for loaddefs...done > GEN magit-section-autoloads.el > Checking /tmp/tmp.m5Cj6y1gaF/elpa/magit-section-3.3.0... [3 times] > Compiling > /tmp/tmp.m5Cj6y1gaF/elpa/magit-section-3.3.0/magit-section.el...done > Wrote /tmp/tmp.m5Cj6y1gaF/elpa/magit-section-3.3.0/magit-section.elc > Checking /tmp/tmp.m5Cj6y1gaF/elpa/magit-section-3.3.0... > Done (Total of 1 file compiled, 2 skipped) > INFO Scraping files for loaddefs...done > GEN ement-autoloads.el > > So it installs magit-section (at v3.3.0) two packages later. > > The taxy-magit-section has these dependencies specified in > "taxy-magit-section.el": > > ;; Package-Requires: ((emacs "26.3") (magit-section "3.2.1") (taxy > "0.10")) > > And, as listed in "C-h P taxy-magit-section RET": > > Package taxy-magit-section is dependency. > > Status: Installed in =E2=80=98taxy-magit-section-0.12.2/=E2=80=99. > Version: 0.12.2 > Commit: 594531569c03206cbc83b74d679ffd0e93edb4d0 > Summary: View Taxy structs in a Magit Section buffer > Requires: emacs-26.3, magit-section-3.2.1, taxy-0.10 > > So it seems that magit-section is being installed after > taxy-magit-section rather than before, which seems to prevent Emacs > from activating the taxy-magit-section package (and thereby adding it > to load-path), which later causes the compilation of ement to fail > since it can't find taxy-magit-section. That is interesting,=20=20 > And all of this seems to be because the version number of > magit-section is not being correctly recognized as a later version and > thereby fulfilling the dependency--this even though it is being > recognized as a dependency and installed by another part of the > process. > > Meanwhile, if I install using package-install with: > > emacs-29.1 --init-directory=3D$(mktemp -d) -q --eval "(package-install > 'ement)" > > Then installation of all packages proceeds without error, and > load-path shows: > > ("/tmp/tmp.19yxzzQiIk/elpa/ement-0.10" " > /tmp/tmp.19yxzzQiIk/elpa/persist-0.5" " > /tmp/tmp.19yxzzQiIk/elpa/plz-0.7" " > /tmp/tmp.19yxzzQiIk/elpa/taxy-magit-section-0.12.2" " > /tmp/tmp.19yxzzQiIk/elpa/magit-section-3.3.0" " > /tmp/tmp.19yxzzQiIk/elpa/dash-2.19.1" " > /tmp/tmp.19yxzzQiIk/elpa/taxy-0.10.1" " > /tmp/tmp.19yxzzQiIk/elpa/svg-lib-0.2.7" " > /tmp/tmp.19yxzzQiIk/elpa/transient-0.4.1" " > /tmp/tmp.19yxzzQiIk/elpa/compat-29.1.4.2" " > /home/me/.guix-profile/share/emacs/site-lisp"=20 [...] > So there appears to be a bug somewhere in the package-vc library. With a slight modification of `package-vc-install-dependencies', we can see in which order the dependencies are installed: --8<---------------cut here---------------start------------->8--- (package-vc-install-dependencies (package-desc-reqs (cadr (assoc 'ement pac= kage-archive-contents)))) ;=3D> (:to-install (svg-lib persist plz taxy taxy-magit-section) :missing n= il) ; ^ mapc runs over this --8<---------------cut here---------------end--------------->8--- This made me suspect that there might be a bug in that function, and with these changes, the above command works (I can't test it because my matrix account AFAIK isn't supported by Ement): --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index db8b41aee6a..2da788ddeec 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -451,13 +451,11 @@ package-vc-install-dependencies (desc (cadr (assoc package pac)))) (and desc (seq-some (apply-partially #'depends-on-p target) - (package-desc-reqs desc)))))) + (mapcar #'car (package-desc-reqs desc))))))) (dependent-order (a b) (let ((desc-a (package-desc-name a)) (desc-b (package-desc-name b))) - (or (not desc-a) (not desc-b) - (not (depends-on-p desc-b desc-a)) - (depends-on-p desc-a desc-b))))) + (depends-on-p desc-a desc-b)))) (mapc #'search requirements) (cl-callf sort to-install #'version-order) (cl-callf seq-uniq to-install #'duplicate-p) --=-=-= Content-Type: text/plain It boils down to a lack-of-type-safety kind of bug. It was comparing 'package-name with (package-name . "version string"), that always ends up being nil. Not sure about the change to `dependent-order', I'll have to think about that in more detail tomorrow. Perhaps there is an all-together shorter patch? > I see that you tested with an Emacs 30.0.50 build. Could you test > with 29.1, the version I'm using? > > Thanks, > Adam > > 0: https://github.com/alphapapa/with-emacs.sh --=-=-=--