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#61669: 30.0.50; package-vc: assertion failed when installing Org with package-vc-install-selected-packages (cl-assertion-failed ((package-vc-p pkg) nil)) Date: Wed, 22 Feb 2023 14:46:02 +0000 Message-ID: <871qmhpxlh.fsf@posteo.net> References: <87bklohwhv.fsf@anche.no> 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="28489"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61669@debbugs.gnu.org To: Yuu Yin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 22 15:47:21 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 1pUqOu-00075S-H1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Feb 2023 15:47:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUqOj-0008Tp-Kv; Wed, 22 Feb 2023 09:47:09 -0500 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 1pUqOd-0008Sn-3J for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUqOc-0003HI-FB for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUqOc-0004YQ-1J for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Feb 2023 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61669 X-GNU-PR-Package: emacs Original-Received: via spool by 61669-submit@debbugs.gnu.org id=B61669.167707717517450 (code B ref 61669); Wed, 22 Feb 2023 14:47:01 +0000 Original-Received: (at 61669) by debbugs.gnu.org; 22 Feb 2023 14:46:15 +0000 Original-Received: from localhost ([127.0.0.1]:58449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUqNq-0004XL-9n for submit@debbugs.gnu.org; Wed, 22 Feb 2023 09:46:15 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:48371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUqNm-0004Wy-Ow for 61669@debbugs.gnu.org; Wed, 22 Feb 2023 09:46:13 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B21B12404D0 for <61669@debbugs.gnu.org>; Wed, 22 Feb 2023 15:46:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677077164; bh=1d7zjPoiuXePDdIoNcBvsfJZJww58eUhAwm4dg2iDsA=; h=From:To:Cc:Subject:Date:From; b=XI9yBWrcyJDTM3LhesJ+YCE9q3DAm6lLrV/0aJDxJLto99Qq5BwGgHkiPSJ++emPG vGuuyzcSM7EIvny8ItcmCJl/118+jZQln9Qwjlb/RUuNNKlPDlReaakNbMhxx3XnbC mZkpPwcQpcLR4jTpiTT0Y+m7/N7t4TkHbclAqaZJOuFc1cJUhHfkmE5/hNnJKL9H5c SITR2EZBY8FglEzfcYRxf9Cf6ytkIfeps3iH+DoBpoqCj7YEc9sH/tGc3SEE+N0Zse fxz3STjHiVzxhk0jqdN+qCzXXgjBhoQWARyuC5Z/CJPWnZeOCLnpJowcbXMw5uff3p IU+NfMaWNLk9Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PMJqt3gRPz6tmF; Wed, 22 Feb 2023 15:46:02 +0100 (CET) In-Reply-To: <87bklohwhv.fsf@anche.no> (Yuu Yin's message of "Mon, 20 Feb 2023 18:12:28 -0300") 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:256363 Archived-At: --=-=-= Content-Type: text/plain Could you try applying the following two patches: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Avoid-reusing-lisp-dir-twice-in-package-vc-main-file.patch >From 64f44c5fa062a3afdcb9dc589e3078211f05e298 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 22 Feb 2023 15:28:44 +0100 Subject: [PATCH 2/2] Avoid reusing :lisp-dir twice in 'package-vc--main-file' * lisp/emacs-lisp/package-vc.el (package-vc--main-file): Just use :lisp-dir from 'package-desc-extras', not 'pkg-spec'. This avoid appending the contents of :lisp-dir twice, in case it is specified both in pkg-spec and pkg-desc. --- lisp/emacs-lisp/package-vc.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index b22823fd706..ea2766b8dc4 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -309,7 +309,6 @@ package-vc--main-file (directory (file-name-concat (or (package-desc-dir pkg-desc) (expand-file-name name package-user-dir)) - (plist-get pkg-spec :lisp-dir) (and-let* ((extras (package-desc-extras pkg-desc))) (alist-get :lisp-dir extras)))) (file (or (plist-get pkg-spec :main-file) -- 2.30.2 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ensure-right-package-desc-type-before-installing-pac.patch >From 6a06b9ac0ec4da9ddacfcb3c1008dc81c32fe0f1 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 22 Feb 2023 15:23:43 +0100 Subject: [PATCH 1/2] Ensure right package-desc-type before installing package * lisp/emacs-lisp/package-vc.el (package-vc--unpack): Move copying code from 'package-vc-install'. (package-vc-install): Remove copying. (Bug#61669) --- lisp/emacs-lisp/package-vc.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index b753adcb8a0..b22823fd706 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -615,6 +615,10 @@ package-vc--unpack how to fetch and build the package. See `package-vc--archive-spec-alist' for details. The optional argument REV specifies a specific revision to checkout. This overrides the `:branch' attribute in PKG-SPEC." + (unless (eq (package-desc-kind pkg-desc) 'vc) + (let ((copy (copy-package-desc pkg-desc))) + (setf (package-desc-kind copy) 'vc + pkg-desc copy))) (pcase-let* (((map :lisp-dir) pkg-spec) (name (package-desc-name pkg-desc)) (dirname (package-desc-full-name pkg-desc)) @@ -826,9 +830,7 @@ package-vc-install rev))) ((and-let* ((desc (assoc package package-archive-contents #'string=))) (package-vc--unpack - (let ((copy (copy-package-desc (cadr desc)))) - (setf (package-desc-kind copy) 'vc) - copy) + (cadr desc) (or (package-vc--desc->spec (cadr desc)) (and-let* ((extras (package-desc-extras (cadr desc))) (url (alist-get :url extras)) -- 2.30.2 --=-=-= Content-Type: text/plain The issue appears to be that, compared to package-vc-install, package-vc-install-selected-packages did not ensure that the package descriptor was of the right type. The first patch addresses that. The second one fixes a bug that this also uncovered, but that is not directly related to your issue. Yuu Yin writes: > HAPPENED > > Trying to install Org from Savannah/Git with > `package-vc-install-selected-packages` errors with failed assertion. > > ``` > (cl-assertion-failed ((package-vc-p pkg) nil)) > ``` > > In my GNU Emacs installation, pacakge-vc works for installing other > packages from Git repositories, but not Org. > > EXPECTED > > package-vc installs Org successfuly. > > REPRODUCE > > On a non-customized GNU Emacs 30.0.50, eval > > ``` > (setq-default debug-on-error t) > > (setq package-vc-selected-packages '((org > :url "https://git.savannah.gnu.org/git/emacs/org-mode.git" > :branch "main" > :lisp-dir "lisp" > :vc-backend Git))) > > (package-vc-install-selected-packages) > ``` By the way, is there a reason you manually wrote out the package specification (e.g. to test something)? As the package is on ELPA, you could have also used the information provided by the archive: (setq package-vc-selected-packages '((org))) > BACKTRACE > > For what it is worth, notice package-vc installs Org in `elpa/org-9.6.1` instead of `elpa/org`. Yes, this makes sense considering that the descriptor version did not indicate that the package was a VC package. > ``` > Debugger entered--Lisp error: (cl-assertion-failed ((package-vc-p pkg) nil)) > cl--assertion-failed((package-vc-p pkg)) > package-vc--version(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil)) > package-vc--generate-description-file(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/org-pkg.el") > package-vc--unpack-1(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/") > package-vc--unpack(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) (:url "https://git.savannah.gnu.org/git/emacs/org-mode.git" :branch "main" :lisp-dir "lisp" :vc-backend Git)) > package-vc-install-selected-packages() > elisp--eval-last-sexp(nil) > eval-last-sexp(nil) > funcall-interactively(eval-last-sexp nil) > command-execute(eval-last-sexp) > recursive-edit() > debug(error (cl-assertion-failed ((package-vc-p pkg) nil))) > cl--assertion-failed((package-vc-p pkg)) > package-vc--version(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil)) > package-vc--generate-description-file(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/org-pkg.el") > package-vc--unpack-1(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/") > package-vc--unpack(#s(package-desc :name org :version (9 6 1) :summary "Outline-based notes management and organizer" :reqs ((emacs (25 1))) :kind tar :archive "gnu" :dir "/home/yuu/.config/emacsen/bug/elpa/org-9.6.1/" :extras ((:lisp-dir . "lisp") (:lisp-dir . "lisp") (:url . "https://orgmode.org") (:keywords "outlines" "hypermedia" "calendar" "wp") (:maintainer "Bastien Guerry" . "bzg@gnu.org") (:authors ("Carsten Dominik" . "carsten.dominik@gmail.com")) (:commit . "630f86dfc42472aafd9a4f305e1965cbe92b2891")) :signed nil) (:url "https://git.tecosaur.net/tec/org-mode" :branch "dev" :lisp-dir "lisp" :vc-backend Git)) > package-vc-install-selected-packages() > elisp--eval-last-sexp(nil) > eval-last-sexp(nil) > funcall-interactively(eval-last-sexp nil) > command-execute(eval-last-sexp) > > SYSTEM INFORMATION > > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.16.0, Xaw3d scroll bars) > Repository revision: dc843e0a9b3ba3e29bc65bdbd1050cfcc96cad5d > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 > System Description: NixOS 23.05 (Stoat) > > Configured using: > 'configure > --prefix=/nix/store/mpn2g01lmxhsd249p6klvki16g2z5n28-emacs-git-20230215.0 > --disable-build-details --with-modules --with-x-toolkit=lucid > --with-xft --with-cairo --with-native-compilation' > > Configured features: > CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON > LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY > INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF > TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB > > Important settings: > value of $EMACSLOADPATH: > value of $EMACSNATIVELOADPATH: /nix/store/3m84mvjv04mg0i5jk4qnmb6sccd64gf3-emacs-packages-deps/share/emacs/native-lisp:: > value of $LC_CTYPE: pt_BR.UTF-8 > value of $LC_TIME: en_DK.UTF-8 > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: ELisp/d > > Minor modes in effect: > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > line-number-mode: t > indent-tabs-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > > Load-path shadows: > /etc/profiles/per-user/yuu/share/emacs/site-lisp/site-start hides /nix/store/3m84mvjv04mg0i5jk4qnmb6sccd64gf3-emacs-packages-deps/share/emacs/site-lisp/site-start > /etc/profiles/per-user/yuu/share/emacs/site-lisp/site-start hides /nix/store/mpn2g01lmxhsd249p6klvki16g2z5n28-emacs-git-20230215.0/share/emacs/site-lisp/site-start > /nix/store/3m84mvjv04mg0i5jk4qnmb6sccd64gf3-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/mpn2g01lmxhsd249p6klvki16g2z5n28-emacs-git-20230215.0/share/emacs/30.0.50/lisp/emacs-lisp/let-alist > > Features: > (shadow sort mail-extr emacsbug message yank-media puny dired > dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config > gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 > mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums > mm-util mail-prsvr mail-utils misearch multi-isearch mule-util jka-compr > help-fns cl-print debug backtrace find-func loaddefs-gen radix-tree > vc-git diff-mode easy-mmode finder-inf package-vc vc vc-dispatcher > lisp-mnt format-spec face-remap bookmark text-property-search pp comp > comp-cstr warnings icons rx cl-extra help-mode > visual-fill-column-autoloads writeroom-mode-autoloads vterm-autoloads > pdf-tools-autoloads let-alist-autoloads tablist-autoloads > emojify-logos-autoloads emojify-autoloads ht-autoloads info > dash-autoloads emacsql-sqlite-autoloads emacsql-autoloads package > browse-url url url-proxy url-privacy url-expand url-methods url-history > url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers > url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache > json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs > cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify > ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win > term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe > tabulated-list replace newcomment text-mode lisp-mode prog-mode register > page tab-bar menu-bar rfn-eshadow isearch easymenu timer select > scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors > frame minibuffer nadvice seq simple cl-generic indonesian philippine > cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao > korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech > european ethiopic indian cyrillic chinese composite emoji-zwj charscript > charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure > cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp > files window text-properties overlay sha1 md5 base64 format env > code-pages mule custom widget keymap hashtable-print-readable backquote > threads dbusbind inotify dynamic-setting system-font-setting > font-render-setting cairo x-toolkit x multi-tty make-network-process > native-compile emacs) > > Memory information: > ((conses 16 162257 13781) > (symbols 48 14001 0) > (strings 32 44897 1851) > (string-bytes 1 1298807) > (vectors 16 24166) > (vector-slots 8 463867 19912) > (floats 8 54 193) > (intervals 56 1864 261) > (buffers 984 17)) > > > > -- Philip Kaludercic --=-=-=--