Bug#1040690: Bug#1030394: Bug#1040690: reassign bug to correct package
On Mon, 24 Jul 2023, 11:35 David Bremner, wrote: > Richard Lewis writes: > > On Sun, 23 Jul 2023, 12:34 David Bremner, wrote: > > > > As far as the actual bug with failing to clean up, I ran > > % systemd-nspawn --machine bullseye /usr/lib/dh-elpa/helper/remove emacs > dash 2.17.0 > > and that cleans up the directory > > /usr/share/emacs/site-lisp/elpa/dash-2.17.0 > > so the bug is at some other level of the stack. I guess I will have to > look at the log from the upgrade, but I haven't had a chance to do that > yet. > I was trying to understand when (and how ) your command above was intended to be run as part of the upgrade. I cna see that in bullseye /usr/lib/emacsen-common/packages/remove/elpa-dash would do it if called with 'emacs'. but this is never called: What happens in the 'apt upgrade' is: the old emacsen-common prerm is called (' upgrade '): /var/lib/dpkg/info/emacsen-common.prerm upgrade 3.0.5 This calls: /usr/lib/emacsen-common/emacs-package-remove --prerm emacsen-common This calls: /usr/lib/emacsen-common/packages/remove/emacsen-common and at the end it _unlinks_: /var/lib/emacsen-common/state/package/installed/emacsen-common Then, apt prepares to unpack elpa-dash: The elpa-dash prerm (from bullseye) is called as: /var/lib/dpkg/info/elpa-dash.prerm upgrade 2.19.1+git20220608.1.0ac1ecf+dfsg-1) but this starts with: if [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-remove ] ; then /usr/lib/emacsen-common/emacs-package-remove --prerm elpa-dash fi ... and so does nothing, because /var/lib/emacsen-common/state/package/installed/emacsen-common is gone. I couldnt add debug statements to the new maintainer scripts, but: reading https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#details-of-unpack-phase-of-installation-or-upgrade I think we are now at step 3: ' upgrade ' the elpa-dash preinst starts with if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then so this does nothing. then elpa-dash files are unpacked (step 4) now /usr/lib/emacsen-common/packages/remove/elpa-dash contains 'usr/lib/dh-elpa/helper/remove $1 dash 2.19.1' so we can no longer remove the old version So the issue is that emacsen-common is unpacked before the elpa-dash package
Bug#1040690: Bug#1030394: Bug#1040690: reassign bug to correct package
Richard Lewis writes: > On Sun, 23 Jul 2023, 12:34 David Bremner, wrote: > >> Did you start from a clean debootstrap here? Because I don't see where >> in your second reproducer the addon packages get installed. >> > > no, i reused the chroot from the "first attempt" reproducer > A clean recipe, not requiring any 'login' is: > > mkdir -p /tmp/bullseye > cd /tmp/bullseye > debootstrap bullseye . https://deb.debian.org/debian > ln -s /tmp/bullseye /var/lib/machines/bullseye btw, there is no need to use a symlink here (depends on space in /var I guess) > systemd-nspawn --machine bullseye apt install emacs elpa-helpful A smaller set of packages is just emacs and elpa-dash. > sed -i /bullseye/bookworm/ tmp/bullseye/apt/sources.list There are a couple of typos here, but I get what you meant. Should be more like sed -i s/bullseye/bookworm/ /var/lib/machines/bullseye/etc/apt/sources.list > systemd-nspawn --machine bullseye apt update > systemd-nspawn --machine bullseye apt upgrade I checked that changing this to full-upgrade does not change anything > # this all works, including upgrading emacs :) OK, this downgrades the importance of the crash when upgrading emacs in a chroot, I agree. As far as the actual bug with failing to clean up, I ran % systemd-nspawn --machine bullseye /usr/lib/dh-elpa/helper/remove emacs dash 2.17.0 and that cleans up the directory /usr/share/emacs/site-lisp/elpa/dash-2.17.0 so the bug is at some other level of the stack. I guess I will have to look at the log from the upgrade, but I haven't had a chance to do that yet.
Bug#1030394: Bug#1040690: Bug#1030394: Bug#1040690: reassign bug to correct package
On Sun, 23 Jul 2023, 12:34 David Bremner, wrote: > Richard Lewis writes: > > > I suspect a plain chroot isnt 'enough', i had success with > systemd-nspawn: > > > > ln -s /tmp/bullseye/ /var/lib/machines > > > > # im sure there is a better way than these two lines > > cp /etc/passwd bullseye/etc/passwd > > cp /etc/shadow bullseye/etc/shadow > > > > systemd-nspawn --ephemeral --boot --machine bullseye > > # (you dont really need --ephemeral of course) > > > > log into the container as root: > > # apt install emacs-gtk > > > > (and say yes to allow the installation to finish) > > > > # ls /usr/share/emacs/site-lisp/elpa > > dash-2.17.0 dash-functional-1.2.0 elisp-refs-1.4 helpful-0.18 > loop-1.3 > > dash-2.19.1 elisp-refs-1.3 f-0.20.0helpful-0.19 > s-1.12.0 > > > > Shows the 'duplicate' dirs for the old versions of elpa-dash and > elpa-helpful > > > > Did you start from a clean debootstrap here? Because I don't see where > in your second reproducer the addon packages get installed. > no, i reused the chroot from the "first attempt" reproducer A clean recipe, not requiring any 'login' is: mkdir -p /tmp/bullseye cd /tmp/bullseye debootstrap bullseye . https://deb.debian.org/debian ln -s /tmp/bullseye /var/lib/machines/bullseye systemd-nspawn --machine bullseye apt install emacs elpa-helpful # at this stage we have: # $ ls /tmp/bullseye/usr/share/emacs/site-lisp/elpa/ # dash-2.17.0 dash-functional-1.2.0 elisp-refs-1.3 f-0.20.0 helpful-0.18 loop-1.3 s-1.12.0 sed -i /bullseye/bookworm/ tmp/bullseye/apt/sources.list # systemd-nspawn --machine bullseye apt update systemd-nspawn --machine bullseye apt upgrade # this all works, including upgrading emacs :) # but, old directories for elpa-dash and elpa-helpful and elpa-elisp-refs have not been removed: # $ ls /tmp/bullseye/usr/share/em$ ls /tmp/bullseye/usr/share/emacs/site-lisp/elpa{,-src} /tmp/bullseye/usr/share/emacs/site-lisp/elpa: dash-2.17.0 dash-functional-1.2.0 elisp-refs-1.4 helpful-0.18 loop-1.3 dash-2.19.1 elisp-refs-1.3 f-0.20.0helpful-0.19 s-1.12.0 /tmp/bullseye/usr/share/emacs/site-lisp/elpa-src: dash-2.19.1 dash-functional-1.2.0 elisp-refs-1.4 f-0.20.0 helpful-0.19 loop-1.3 s-1.12.0 # nb: on the host /tmp/bullseye and the symlink /var/lib/machine/bullseye should be removed once finished! >
Bug#1030394: Bug#1040690: Bug#1030394: Bug#1040690: reassign bug to correct package
Richard Lewis writes: > I suspect a plain chroot isnt 'enough', i had success with systemd-nspawn: > > ln -s /tmp/bullseye/ /var/lib/machines > > # im sure there is a better way than these two lines > cp /etc/passwd bullseye/etc/passwd > cp /etc/shadow bullseye/etc/shadow > > systemd-nspawn --ephemeral --boot --machine bullseye > # (you dont really need --ephemeral of course) > > log into the container as root: > # apt install emacs-gtk > > (and say yes to allow the installation to finish) > > # ls /usr/share/emacs/site-lisp/elpa > dash-2.17.0 dash-functional-1.2.0 elisp-refs-1.4 helpful-0.18 loop-1.3 > dash-2.19.1 elisp-refs-1.3 f-0.20.0helpful-0.19 s-1.12.0 > > Shows the 'duplicate' dirs for the old versions of elpa-dash and elpa-helpful > Did you start from a clean debootstrap here? Because I don't see where in your second reproducer the addon packages get installed.
Bug#1040690: Bug#1030394: Bug#1040690: reassign bug to correct package
I suspect a plain chroot isnt 'enough', i had success with systemd-nspawn: ln -s /tmp/bullseye/ /var/lib/machines # im sure there is a better way than these two lines cp /etc/passwd bullseye/etc/passwd cp /etc/shadow bullseye/etc/shadow systemd-nspawn --ephemeral --boot --machine bullseye # (you dont really need --ephemeral of course) log into the container as root: # apt install emacs-gtk (and say yes to allow the installation to finish) # ls /usr/share/emacs/site-lisp/elpa dash-2.17.0 dash-functional-1.2.0 elisp-refs-1.4 helpful-0.18 loop-1.3 dash-2.19.1 elisp-refs-1.3 f-0.20.0helpful-0.19 s-1.12.0 Shows the 'duplicate' dirs for the old versions of elpa-dash and elpa-helpful Additionally: # echo "(require 'helpful nil t)" > ~/.emacs # emacs --no-init-file --batch --eval "(byte-compile-file \".emacs\")" # reproduces the warnings: Loading /etc/emacs/site-start.d/00debian.el (source)... Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/elpa/helpful-0.18/helpful.elc Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/elpa/elisp-refs-1.3/elisp-refs.elc Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash.elc Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/elpa/loop-1.3/loop.elc Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/elpa/dash-functional-1.2.0/dash-functional.elc ## to cleanup: # close the container by pressing C-] several times # rm /var/lib/machines/bullseye and /tmp/bullseye