From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "N. Jackson" Newsgroups: gmane.emacs.bugs 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 Message-ID: <87o99ygmeg.fsf@moondust.localdomain> References: <87zhttet7t.fsf@moondust.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544145747 7487 195.159.176.226 (7 Dec 2018 01:22:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2018 01:22:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33536@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 02:22:23 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gV4qU-0001oH-KG for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Dec 2018 02:22:22 +0100 Original-Received: from localhost ([::1]:43672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gV4sb-00030E-6F for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Dec 2018 20:24:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gV4sH-000303-Aj for bug-gnu-emacs@gnu.org; Thu, 06 Dec 2018 20:24:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gV4s7-0001oG-17 for bug-gnu-emacs@gnu.org; Thu, 06 Dec 2018 20:24:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gV4s6-0001nn-Fr for bug-gnu-emacs@gnu.org; Thu, 06 Dec 2018 20:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gV4s6-0004JG-Aq for bug-gnu-emacs@gnu.org; Thu, 06 Dec 2018 20:24:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87zhttet7t.fsf@moondust.localdomain> Resent-From: "N. Jackson" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Dec 2018 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33536 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33536-submit@debbugs.gnu.org id=B33536.154414583616551 (code B ref 33536); Fri, 07 Dec 2018 01:24:02 +0000 Original-Received: (at 33536) by debbugs.gnu.org; 7 Dec 2018 01:23:56 +0000 Original-Received: from localhost ([127.0.0.1]:36168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gV4rv-0004Ij-PQ for submit@debbugs.gnu.org; Thu, 06 Dec 2018 20:23:55 -0500 Original-Received: from mail-io1-f50.google.com ([209.85.166.50]:34647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gV4rl-0004I9-U0; Thu, 06 Dec 2018 20:23:45 -0500 Original-Received: by mail-io1-f50.google.com with SMTP id r9so2041674ioa.1; Thu, 06 Dec 2018 17:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=cqTuPzDx26lWBoVkX/swp5H7OyoPJfNsy7RCdmsRcr0=; b=RUPQ6i+KaHmCbEisovXXabnl3WGyKE0S+ECFozDNqDSMaFXl10ykP1eY2wHSKrzXVs SwB92tVfBIZz4FNyx44jyTj4qmPQNW90JixEBAskR6Azo2velJ0wUDSSGDIJR6CV8ylZ 26X8ORsA02HtwFPpGyO2vHA+Tabegb/dkf7FqTVmQqI7cf+Tu/txTOD75SEe34nA3T2n oovoEYgh3VyQi6hPQOpbhg4XTIRkTjqwy+k4e2HNMiwx3VBzY2tZYF3XTAjJ+zh1yCy1 cT3KNsPPk+9uRp6E1MHXL85tMMkXQQ4s3OXERRLscR8J0pNifAgX/hgqrteFvlyNwVTF rBzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=cqTuPzDx26lWBoVkX/swp5H7OyoPJfNsy7RCdmsRcr0=; b=nkBF1P5xfzB/84mM/erRFjvi51BdMI4Fr1TCx48lUSaYDNKN5guUHypw+x0ECFijgf xUG1WbbgVIgNAanl13Z24Bd3H2nUo6ck9t1Bhm+3CIfWW+GmkMpcBlEoijgRSMeRwr/x lLgNHDFtzQldaLelj5jlWyxG6F6A6sX8jUc93AYv0AwcSMhqE1Axcly3g/IN9wraujQZ RfUynx7pdBJiYoCI98Eb5FXBiXAhvNtXnJ62zpaLz52oYT4KK/sYK38LjIJ4/N2um8Am FSLcMXR1WR36crVJdFW5N3jqOGJZbpnxP4oHcfxjI5JeAfhQlzhziMkLStF1REQQUUz/ Jqzw== X-Gm-Message-State: AA+aEWaiA/DYdZvTLvhnYx5h0ya2Xl+Qhvr55DsVhZBhrMaQZbb7vetU Tw5RZ5f4AIKg25cb9EkWgUUfkRDe X-Google-Smtp-Source: AFSGD/Vy4uYNf83w0JKTejXlcmkOtpOxJdUGRRK/SFwVjmLEPZojlixvFSZrLU88YrbGUolrJdktWQ== X-Received: by 2002:a6b:e007:: with SMTP id z7mr218050iog.44.1544145816144; Thu, 06 Dec 2018 17:23:36 -0800 (PST) Original-Received: from moondust.localdomain.nodomain.none (toroon474qw-lp130-08-70-26-73-61.dsl.bell.ca. [70.26.73.61]) by smtp.gmail.com with ESMTPSA id v202sm1143856ita.13.2018.12.06.17.23.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 17:23:35 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153158 Archived-At: 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.