From: "N. Jackson" <nljlistbox2@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 33536@debbugs.gnu.org
Subject: bug#33536: Package state inconsistent on package install after abnormal Emacs startup [was Re: bug#33536: 26.1.90; package wants to remove bbdb]
Date: Thu, 06 Dec 2018 20:23:35 -0500 [thread overview]
Message-ID: <87o99ygmeg.fsf@moondust.localdomain> (raw)
In-Reply-To: <87zhttet7t.fsf@moondust.localdomain>
retitle 33536 Package state inconsistent on package install after abnormal Emacs startup
quit
Hello Glenn,
At 16:06 -0500 on Wednesday 2018-12-05, Glenn Morris wrote:
>
> Can you reproduce this from a clean state, eg
> rm -rf /tmp/foo
> mkdir /tmp/foo
> HOME=/tmp/foo emacs
Yes, I was able to reproduce it from a clean slate, after some
fiddling which shed some more light on the matter.
I observe the problem in Emacs 26.1, 26.1.90 (tarball), and master
of a few days ago (e02d375cb6670e2306b9c67d7f6fd2dd1d1b2711).
The problem is not specific to bbdb.
The invalid state that Package gets into is that the problematic
package is missing from `package-selected-packages', it is listed by
Package as a "dependency" instead of "installed", and Package will
offer to remove it after the next package operation.
One way to get into that invalid state is to install a package after
Emacs encounters an init file error at startup. (See tediously
detailed recipe below.)
This is arguably a user error: An error in one's init files should
be resolved before using Emacs. Note however, that no message is
written to *Messages* [1] and in my normal configuration (with
multiple frames being restored by Desktop), the warning window is in
a buried frame that I never see, so it's quite easy to install a
package without realising that there was an init file error.
In any case, user error or not, I think that Package should avoid
putting itself into an inconsistent state.
DETAILED RECIPE:
0. Create a clean home:
$ rm -rf /tmp/foo; mkdir /tmp/foo
1. Install a package (chess, for example) and exit Emacs:
$ HOME=/tmp/foo src/emacs &
M-x list-packages RET
M-< ; Navigate to top of list.
C-s chess C-s RET ; Navigate to the `chess' package.
i ; Mark it for install.
x ; Install it.
=> Packages to install: 1 (chess-2.0.4). Proceed? (y or n)
y
Operation [ Install 1 ] finished
C-x C-c ; Exit Emacs.
2. Place some invalid Elisp in init file:
$ HOME=/tmp/foo src/emacs &
C-x C-f /tmp/foo/.emacs RET ; Open init file.
M-> ; Navigate to end of buffer.
This is invalid Elisp. ; Type some invalid Elisp.
C-x C-s ; Save init file.
C-x C-c ; Exit Emacs.
3. Fail to notice the warning at start up. Install another package (e.g. csv-mode)
$ HOME=/tmp/foo src/emacs &
;; A warning of an initialization error is displayed in a window
;; but we fail to notice it.
M-x list-packages RET
M-< ; Navigate to top of list.
C-s csv-mode C-s RET ; Navigate to the `csv-mode' package.
i ; Mark it for install.
x ; Install it.
=> Packages to install: 1 (csv-mode-1.7). Proceed? (y or n)
y
=> Operation [ Install 1 ] finished
C-x C-c ; Exit Emacs.
4. Fix the invalid Elisp in init file.
$ HOME=/tmp/foo src/emacs &
;; A warning of the initialization error is displayed in a window.
C-x C-f /tmp/foo/.emacs RET ; Open init file.
M-> ; Navigate to end of buffer.
C-S-backspace ; Kill the line of invalid Elisp.
C-x C-s ; Save init file.
C-x C-c ; Exit Emacs.
5. Observe that Package is in an inconsistent state.
$ HOME=/tmp/foo src/emacs &
;; Now Package is in an inconsistent state:
;; 1. csv-mode is missing from 'package-selected-packages'.
;; 2. csv-mode is listed as a "dependency" instead of "installed".
;; 3. Package will offer to remove csv-mode after the next package
;; operation.
[1] I filed a bug about lack of feedback in *Messages* about init
file errors: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33654.
prev parent reply other threads:[~2018-12-07 1:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 4:12 bug#33536: 26.1.90; package wants to remove bbdb N. Jackson
2018-12-05 21:06 ` Glenn Morris
2018-12-07 1:23 ` N. Jackson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o99ygmeg.fsf@moondust.localdomain \
--to=nljlistbox2@gmail.com \
--cc=33536@debbugs.gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.