GNU bug report logs - #59728
30.0.50; package-vc does not handle package-quickstart

Previous Next

Package: emacs;

Reported by: Matt Armstrong <matt <at> rfc20.org>

Date: Wed, 30 Nov 2022 18:36:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 29.1

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59728 in the body.
You can then email your comments to 59728 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to philipk <at> posteo.net, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#59728; Package emacs. (Wed, 30 Nov 2022 18:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matt Armstrong <matt <at> rfc20.org>:
New bug report received and forwarded. Copy sent to philipk <at> posteo.net, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Wed, 30 Nov 2022 18:36:02 GMT) Full text and rfc822 format available.

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

From: Matt Armstrong <matt <at> rfc20.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; package-vc does not handle package-quickstart
Date: Wed, 30 Nov 2022 10:35:02 -0800
X-debbugs-cc: Philip Kaludercic <philipk <at> posteo.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>

package.el provides `package-quickstart':

    package-quickstart is a variable defined in ‘package.el’.

    Its value is t
    Original value was nil

    Precompute activation actions to speed up startup.
    This requires the use of ‘package-quickstart-refresh’ every time the
    activations need to be changed, such as when ‘package-load-list’ is modified.

This places a package-quickstart.elc file in `user-emacs-directory' that
is loaded at startup, instead of loading the individual
`user-emacs-directory'/elpa/*-autoloads.el files.

In practice package.el takes care of calling
`package-quickstart-refresh' as needed.  As a user making normal use of
package.el I don't believe I have ever needed to call
`package-quickstart-refresh' manually.

I am playing with package-vc.el and immediately noticed that functions
like `package-vc-install-from-checkout' and `package-vc-rebuild' do not
call `package-quickstart-refresh'.

The effect is that package-vc leaves a "stale" package-quickstart.elc in
the `user-emacs-directory', and the user must run
`package-quickstart-refresh' manually.

Ideally the various `package-vc-*' functions take care of running the
function when necessary.

----------------------------------------------------------------------


In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2022-11-30 built on naz
Repository revision: 1abda0c83981a6d35dd4b2dd3e88e9886d13cb09
Repository branch: master
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure 'CFLAGS=-Og -g3 -fsanitize=address' 'CXXFLAGS=-Og -g3
 -fsanitize=address' LDFLAGS=-static-libasan --enable-checking=yes
 --enable-check-lisp-object-type --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  bug-reference-prog-mode: t
  msb-mode: t
  display-time-mode: t
  flyspell-mode: t
  global-tab-line-mode: t
  tab-line-mode: t
  server-mode: t
  shell-dirtrack-mode: t
  auto-insert-mode: t
  keyfreq-autosave-mode: t
  keyfreq-mode: t
  savehist-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  editorconfig-mode: t
  which-key-mode: t
  electric-pair-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t

Load-path shadows:
~/env/elisp/ol-notmuch hides /home/matt/.config/emacs/elpa/ol-notmuch-2.0.0/ol-notmuch
/home/matt/.config/emacs/elpa/transient-0.3.7/transient hides /home/matt/git/e/daily-driver/lisp/transient

Features:
(shadow sort mail-extr dabbrev emacsbug shortdoc cl-print cus-edit pp
cus-start cus-load badautoloads-autoloads magit-extras face-remap
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func imenu
edebug debug backtrace magit-diff smerge-mode diff git-commit log-edit
add-log magit-core magit-autorevert autorevert magit-margin
magit-transient magit-process with-editor magit-mode magit-git dired-aux
copyright mule-util magit-utils crm loaddefs-gen mm-archive
network-stream url-cache url-http url-auth url-gw nsm vc-hg vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view pcvs-util package-vc vc
lisp-mnt package-x misearch multi-isearch vc-git diff-mode vc-dispatcher
bug-reference protbuf msb time flyspell ispell org-element org-persist
org-id avl-tree ol-w3m ol-rmail ol-mhe ol-irc ol-info org-habit
org-agenda org-refile ol-gnus nnselect gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start
gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time
gnus-spec gnus-int gnus-range message sendmail yank-media rfc822 mml
mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win ol-eww eww xdg url-queue shr pixel-fill kinsoku
url-file svg xml dom puny mm-url gnus nnheader gnus-util mail-utils
range wid-edit mm-util mail-prsvr ol-doi org-link-doi ol-docview
doc-view filenotify jka-compr image-mode exif dired dired-loaddefs
ol-bibtex bibtex iso8601 ol-bbdb midnight tab-line server geiser-guile
info-look transient geiser-debug geiser-repl compile
text-property-search geiser-image geiser-capf geiser-doc geiser-menu
geiser-autodoc geiser-edit etags fileloop generator xref
geiser-completion geiser-eval geiser-connection tq geiser-syntax scheme
geiser-log geiser-popup view geiser web-mode disp-table nix-mode ffap
thingatpt smie nix-repl nix-shell nix-store magit-section dash nix-log
nix-instantiate nix-shebang nix-format nix finder-inf dirtrack ob-shell
shell ob-ruby ob-python python pcase treesit ob-dot org-protocol org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint
org-pcomplete pcomplete comint ansi-osc ansi-color org-list org-footnote
org-faces org-entities time-date noutline outline ob-emacs-lisp ob-core
ob-eval org-cycle org-table org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs ol-notmuch ol rx org-fold org-fold-core org-compat
org-version org-macs format-spec skeleton autoinsert advice keyfreq
project edmacro kmacro warnings icons savehist icomplete editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch
which-key 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 eieio eieio-core
password-cache json subr-x map byte-opt url-vars cl-extra cl-macs gv
cl-seq elec-pair use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core bytecomp byte-compile info geiser-guile-autoloads
geiser-impl help-fns radix-tree help-mode cl-loaddefs cl-lib
geiser-custom geiser-base ring geiser-autoloads orderless-autoloads
nix-mode-autoloads graphviz-dot-mode-autoloads markdown-mode-autoloads
org-drill-autoloads persist-autoloads ox-hugo-autoloads tomelr-autoloads
ol-notmuch-autoloads notmuch-autoloads pylint-autoloads elpy-autoloads
highlight-indentation-autoloads pyvenv-autoloads s-autoloads
flymake-ruby-autoloads flymake-easy-autoloads go-mode-autoloads
yasnippet-autoloads company-autoloads shfmt-autoloads
flymake-yamllint-autoloads yaml-mode-autoloads debbugs-autoloads
bazel-autoloads clang-format+-autoloads clang-format-autoloads
google-c-style-autoloads cmake-mode-autoloads meson-mode-autoloads
d-mode-autoloads magit-autoloads git-commit-autoloads
transient-autoloads magit-section-autoloads dash-autoloads
with-editor-autoloads vertico-autoloads editorconfig-autoloads
which-key-autoloads exec-path-from-shell-autoloads use-package-autoloads
bind-key-autoloads envrc-autoloads inheritenv-autoloads
web-mode-autoloads nixpkgs-fmt-autoloads reformatter-autoloads rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-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 gtk pgtk lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 654397 159228)
 (symbols 48 41290 29)
 (strings 32 217792 26674)
 (string-bytes 1 6059735)
 (vectors 16 76757)
 (vector-slots 8 887126 115596)
 (floats 8 417 667)
 (intervals 56 8512 1191)
 (buffers 984 31))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59728; Package emacs. (Wed, 30 Nov 2022 19:54:02 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Matt Armstrong <matt <at> rfc20.org>
Cc: 59728 <at> debbugs.gnu.org, stefan monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#59728: 30.0.50; package-vc does not handle package-quickstart
Date: Wed, 30 Nov 2022 19:53:01 +0000
[Message part 1 (text/plain, inline)]
Matt Armstrong <matt <at> rfc20.org> writes:

> X-debbugs-cc: Philip Kaludercic <philipk <at> posteo.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>
>
> package.el provides `package-quickstart':
>
>     package-quickstart is a variable defined in ‘package.el’.
>
>     Its value is t
>     Original value was nil
>
>     Precompute activation actions to speed up startup.
>     This requires the use of ‘package-quickstart-refresh’ every time the
>     activations need to be changed, such as when ‘package-load-list’ is modified.
>
> This places a package-quickstart.elc file in `user-emacs-directory' that
> is loaded at startup, instead of loading the individual
> `user-emacs-directory'/elpa/*-autoloads.el files.
>
> In practice package.el takes care of calling
> `package-quickstart-refresh' as needed.  As a user making normal use of
> package.el I don't believe I have ever needed to call
> `package-quickstart-refresh' manually.
>
> I am playing with package-vc.el and immediately noticed that functions
> like `package-vc-install-from-checkout' and `package-vc-rebuild' do not
> call `package-quickstart-refresh'.
>
> The effect is that package-vc leaves a "stale" package-quickstart.elc in
> the `user-emacs-directory', and the user must run
> `package-quickstart-refresh' manually.
>
> Ideally the various `package-vc-*' functions take care of running the
> function when necessary.

The central function here is `package-vc--unpack-1' so the following
patch should take care of that:

[Message part 2 (text/plain, inline)]
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index a4520ab800..5f7674190b 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -433,7 +433,8 @@ package-vc--unpack-1
                               (car load-path))))
                   (current-buffer))
            (buffer-string))
-         nil (expand-file-name auto-name pkg-dir))))
+         nil (expand-file-name auto-name pkg-dir)))
+      (package-quickstart-refresh))
 
     ;; Generate package file
     (package-vc--generate-description-file pkg-desc pkg-file)
[Message part 3 (text/plain, inline)]
However I am uncertain if this is too aggressive?  I don't have the time
to test it properly right now, but could try this (or some variation
thereof) and tell me if it addresses the issue?

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59728; Package emacs. (Thu, 01 Dec 2022 00:16:01 GMT) Full text and rfc822 format available.

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

From: Matt Armstrong <matt <at> rfc20.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 59728 <at> debbugs.gnu.org, stefan monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#59728: 30.0.50; package-vc does not handle package-quickstart
Date: Wed, 30 Nov 2022 16:14:53 -0800
[Message part 1 (text/plain, inline)]
Philip Kaludercic <philipk <at> posteo.net> writes:

> The central function here is `package-vc--unpack-1' so the following
> patch should take care of that:
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index a4520ab800..5f7674190b 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -433,7 +433,8 @@ package-vc--unpack-1
>                                (car load-path))))
>                    (current-buffer))
>             (buffer-string))
> -         nil (expand-file-name auto-name pkg-dir))))
> +         nil (expand-file-name auto-name pkg-dir)))
> +      (package-quickstart-refresh))
>  
>      ;; Generate package file
>      (package-vc--generate-description-file pkg-desc pkg-file)
>
> However I am uncertain if this is too aggressive?  I don't have the time
> to test it properly right now, but could try this (or some variation
> thereof) and tell me if it addresses the issue?

I moved the call to `package-quickstart-refresh' down, as it byte
compiles the autoloads and judging from other comments in this function,
and also discussion in bug#59707, that is best done after the new
version of the package is loaded.

Also, the two `package--quickstart-maybe-refresh' calls in package.el
are just after a `package--save-selected-packages' call, so I did the
same here.

The seems to work fine in my manual testing.  Thanks for the tip!

As for whether this is too aggressive, I'm not sure.  Seems about as
aggressive as package.el is today.

[0002-Refresh-the-package-quickstart-file-in-package-vc.patch (text/x-diff, inline)]
From b74f1ac29f6427094a6beb15a6a0227f750281c3 Mon Sep 17 00:00:00 2001
From: Matt Armstrong <matt <at> rfc20.org>
Date: Wed, 30 Nov 2022 15:58:07 -0800
Subject: [PATCH 2/2] Refresh the package quickstart file in package-vc

* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Call
`package--quickstart-maybe-refresh', just as
`package-install-from-buffer' does.  (bug#59728)
---
 lisp/emacs-lisp/package-vc.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index a4520ab800..04b4c81c13 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -464,6 +464,7 @@ package-vc--unpack-1
   (package--save-selected-packages
    (cons (package-desc-name pkg-desc)
          package-selected-packages))
+  (package--quickstart-maybe-refresh)
 
   ;; Confirm that the installation was successful
   (let ((main-file (package-vc--main-file pkg-desc)))
-- 
2.35.1


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59728; Package emacs. (Sat, 10 Dec 2022 09:02:02 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Matt Armstrong <matt <at> rfc20.org>
Cc: 59728 <at> debbugs.gnu.org, stefan monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#59728: 30.0.50; package-vc does not handle package-quickstart
Date: Sat, 10 Dec 2022 09:01:37 +0000
Matt Armstrong <matt <at> rfc20.org> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> The central function here is `package-vc--unpack-1' so the following
>> patch should take care of that:
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index a4520ab800..5f7674190b 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -433,7 +433,8 @@ package-vc--unpack-1
>>                                (car load-path))))
>>                    (current-buffer))
>>             (buffer-string))
>> -         nil (expand-file-name auto-name pkg-dir))))
>> +         nil (expand-file-name auto-name pkg-dir)))
>> +      (package-quickstart-refresh))
>>  
>>      ;; Generate package file
>>      (package-vc--generate-description-file pkg-desc pkg-file)
>>
>> However I am uncertain if this is too aggressive?  I don't have the time
>> to test it properly right now, but could try this (or some variation
>> thereof) and tell me if it addresses the issue?
>
> I moved the call to `package-quickstart-refresh' down, as it byte
> compiles the autoloads and judging from other comments in this function,
> and also discussion in bug#59707, that is best done after the new
> version of the package is loaded.
>
> Also, the two `package--quickstart-maybe-refresh' calls in package.el
> are just after a `package--save-selected-packages' call, so I did the
> same here.
>
> The seems to work fine in my manual testing.  Thanks for the tip!
>
> As for whether this is too aggressive, I'm not sure.  Seems about as
> aggressive as package.el is today.
>
> From b74f1ac29f6427094a6beb15a6a0227f750281c3 Mon Sep 17 00:00:00 2001
> From: Matt Armstrong <matt <at> rfc20.org>
> Date: Wed, 30 Nov 2022 15:58:07 -0800
> Subject: [PATCH 2/2] Refresh the package quickstart file in package-vc
>
> * lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Call
> `package--quickstart-maybe-refresh', just as
> `package-install-from-buffer' does.  (bug#59728)
> ---
>  lisp/emacs-lisp/package-vc.el | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index a4520ab800..04b4c81c13 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -464,6 +464,7 @@ package-vc--unpack-1
>    (package--save-selected-packages
>     (cons (package-desc-name pkg-desc)
>           package-selected-packages))
> +  (package--quickstart-maybe-refresh)
>  
>    ;; Confirm that the installation was successful
>    (let ((main-file (package-vc--main-file pkg-desc)))

Sorry for the delay, I've tested the patch and it seems fine.  It has
been pushed to the emacs-29 branch.

Thanks!




bug marked as fixed in version 29.1, send any further explanations to 59728 <at> debbugs.gnu.org and Matt Armstrong <matt <at> rfc20.org> Request was from Philip Kaludercic <philipk <at> posteo.net> to control <at> debbugs.gnu.org. (Sat, 10 Dec 2022 09:06:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Jan 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 102 days ago.

Previous Next


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