GNU bug report logs - #24467
adding package archives after calling package-initialize lists all their packages as "new"

Previous Next

Package: emacs;

Reported by: SK Kim <tttuuu888 <at> gmail.com>

Date: Mon, 19 Sep 2016 05:49:02 UTC

Severity: minor

Tags: confirmed

Merged with 21703

Found in versions 25.0.50, 25.1

To reply to this bug, email your comments to 24467 AT debbugs.gnu.org.

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

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


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Mon, 19 Sep 2016 05:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to SK Kim <tttuuu888 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 19 Sep 2016 05:49:02 GMT) Full text and rfc822 format available.

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

From: SK Kim <tttuuu888 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; package
Date: Mon, 19 Sep 2016 14:29:43 +0900
[Message part 1 (text/plain, inline)]
After i set gnu and mepla for pacakage-archives in my init.el as
below,

(package-initialize)
(setq package-archives
    '(("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa" . "http://melpa.milkbox.net/packages/")))

whenever i start package-list-packages, status of mepla packages is
always new.

thanks.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Mon, 19 Sep 2016 22:02:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: SK Kim <tttuuu888 <at> gmail.com>
Cc: 24467 <at> debbugs.gnu.org, Michael Heerdegen <michael_heerdegen <at> web.de>
Subject: Re: bug#24467: 25.1; package
Date: Mon, 19 Sep 2016 18:01:37 -0400
merge 24467 21703
quit

On Mon, Sep 19, 2016 at 1:29 AM, SK Kim <tttuuu888 <at> gmail.com> wrote:
> After i set gnu and mepla for pacakage-archives in my init.el as
> below,
>
> (package-initialize)
> (setq package-archives
>     '(("gnu" . "http://elpa.gnu.org/packages/")
>      ("melpa" . "http://melpa.milkbox.net/packages/")))
>
> whenever i start package-list-packages, status of mepla packages is
> always new.

Seems to be the same as #21703 "25.0.50; package.el: Thousands of new
packages each day", but I'm not able to reproduce.

I put the above as my init.el in a temporary HOME dir, when I run
package-list-packages melpa packages are all "available" for me.

  0blayout           20160919.823  available  melpa      Layout
grouping with ease
  2048-game          20151026.1233 available  melpa      play 2048 in Emacs
  4clojure           20131014.1507 available  melpa      Open and
evaluate 4clojure.com questions
  @                  20140707.520  available  melpa
multiple-inheritance prototype-based objects DSL
...




Merged 21703 24467. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 19 Sep 2016 22:02:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Sat, 24 Sep 2016 22:30:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 24467 <at> debbugs.gnu.org, SK Kim <tttuuu888 <at> gmail.com>
Subject: Re: bug#24467: 25.1; package
Date: Sun, 25 Sep 2016 00:28:54 +0200
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> merge 24467 21703
> quit
>
> On Mon, Sep 19, 2016 at 1:29 AM, SK Kim <tttuuu888 <at> gmail.com> wrote:
> > After i set gnu and mepla for pacakage-archives in my init.el as
> > below,
> >
> > (package-initialize)
> > (setq package-archives
> >     '(("gnu" . "http://elpa.gnu.org/packages/")
> >      ("melpa" . "http://melpa.milkbox.net/packages/")))
> >
> > whenever i start package-list-packages, status of mepla packages is
> > always new.
>
> Seems to be the same as #21703 "25.0.50; package.el: Thousands of new
> packages each day", but I'm not able to reproduce.
>
> I put the above as my init.el in a temporary HOME dir, when I run
> package-list-packages melpa packages are all "available" for me.

Maybe it is different on the first run?

Hmm, anyway, I found out that with

 (package-initialize)
 (setq package-archives
     '(("gnu" . "http://elpa.gnu.org/packages/")
      ("melpa" . "http://melpa.milkbox.net/packages/")))

in my init file I see the issue.  But with

  (setq package-archives
        '(("gnu" . "http://elpa.gnu.org/packages/")
          ("melpa" . "http://melpa.milkbox.net/packages/")))
  (package-initialize)

it seems to be fixed (i.e. the same expressions just transposed).  With
other words, `package-archives' seemingly needs to be set before calling
`package-intialize' (@SK Kim, do you see the same?).

With the first version, after Emacs startup, `package-archive-contents'
only includes the "gnu" packages.  With the second version, it seems to
include "everything" (the list is too long to be printed in reasonable
time).  That variable is used to decide what packages are new.  That's
were the problem seems to come from.

I think the behavior is at least "surprising", a pitfall.


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Sun, 25 Sep 2016 02:45:02 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 24467 <at> debbugs.gnu.org, SK Kim <tttuuu888 <at> gmail.com>
Subject: Re: bug#24467: 25.1; package
Date: Sat, 24 Sep 2016 22:45:03 -0400
tags 24467 confirmed
severity 24467 minor
quit

Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
>>
>> I put the above as my init.el in a temporary HOME dir, when I run
>> package-list-packages melpa packages are all "available" for me.
>
> Maybe it is different on the first run?

Yes, if I close and reopen Emacs, then I see the "new" packages too.

>
> Hmm, anyway, I found out that with
>
>  (package-initialize)
>  (setq package-archives
>      '(("gnu" . "http://elpa.gnu.org/packages/")
>       ("melpa" . "http://melpa.milkbox.net/packages/")))
>
> in my init file I see the issue.  But with
>
>   (setq package-archives
>         '(("gnu" . "http://elpa.gnu.org/packages/")
>           ("melpa" . "http://melpa.milkbox.net/packages/")))
>   (package-initialize)
>
> it seems to be fixed (i.e. the same expressions just transposed).  With
> other words, `package-archives' seemingly needs to be set before calling
> `package-intialize' (@SK Kim, do you see the same?).

Ah, so the packages are "new" in the sense that they come from archives
added after package-initialize was called.

>
> With the first version, after Emacs startup, `package-archive-contents'
> only includes the "gnu" packages.  With the second version, it seems to
> include "everything" (the list is too long to be printed in reasonable
> time).  That variable is used to decide what packages are new.  That's
> were the problem seems to come from.
>
> I think the behavior is at least "surprising", a pitfall.

Would be nice to avoid it, indeed.





Added tag(s) confirmed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 25 Sep 2016 02:45:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 25 Sep 2016 02:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Sun, 25 Sep 2016 13:39:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: npostavs <at> users.sourceforge.net
Cc: 24467 <at> debbugs.gnu.org, SK Kim <tttuuu888 <at> gmail.com>
Subject: Re: bug#24467: 25.1; package
Date: Sun, 25 Sep 2016 15:38:30 +0200
npostavs <at> users.sourceforge.net writes:

> Ah, so the packages are "new" in the sense that they come from
> archives added after package-initialize was called.

I'm not sure whether this is by design and if we would break something
if we changed it.  I think the fix would be quite trivial: simply
speaking, we would change `package-read-all-archive-contents' to iterate
over "$package-user-dir/archives/*" instead of `package-archives'.


Michael.




Changed bug title to 'adding package archives after calling package-initialize lists all their packages as "new"' from '25.1; package' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 02 Apr 2017 06:09:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Sat, 03 Nov 2018 15:08:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 24467 <at> debbugs.gnu.org, SK Kim <tttuuu888 <at> gmail.com>,
 npostavs <at> users.sourceforge.net
Subject: Re: bug#24467: 25.1; package
Date: Sat, 03 Nov 2018 11:07:25 -0400
>> Ah, so the packages are "new" in the sense that they come from
>> archives added after package-initialize was called.
>
> I'm not sure whether this is by design and if we would break something
> if we changed it.  I think the fix would be quite trivial: simply
> speaking, we would change `package-read-all-archive-contents' to iterate
> over "$package-user-dir/archives/*" instead of `package-archives'.

It's clearly a bug, and it's made worse in Emacs-27 where
package-initialize is called automatically before reading ~/.emacs.

IOW, I think "this" needs to be fixed before Emacs-27.1.

The fix you propose might work (tho with unintended side effects), but
I don't see any reason why we need to package-read-all-archive-contents
so early on anyway.  More specifically, package-activate-all should be
changed so it doesn't end up running package-read-all-archive-contents:
it's already the case when a package-quickstart-file is found, but if
there's no such file we call package-initialize which ends up calling
package-read-all-archive-contents even though we're only interested in
the package-load-all-descriptors part, really.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Tue, 22 Jan 2019 22:57:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 24467 <at> debbugs.gnu.org, SK Kim <tttuuu888 <at> gmail.com>,
 npostavs <at> users.sourceforge.net
Subject: Re: bug#24467: 25.1; package
Date: Tue, 22 Jan 2019 17:56:31 -0500
> It's clearly a bug, and it's made worse in Emacs-27 where
> package-initialize is called automatically before reading ~/.emacs.
> IOW, I think "this" needs to be fixed before Emacs-27.1.

I just installed a patch which should reduce the impact of this problem
in Emacs-27.1: the problem still occurs if you setq package-archives
after calling package-initialize, but at least you can now setq
package-archives in your ~/.emacs rather than having to do it in your
early-init.el.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Mon, 16 Aug 2021 12:28:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 24467 <at> debbugs.gnu.org,
 SK Kim <tttuuu888 <at> gmail.com>, 21703 <at> debbugs.gnu.org,
 npostavs <at> users.sourceforge.net
Subject: Re: bug#21703: adding package archives after calling
 package-initialize lists all their packages as "new"
Date: Mon, 16 Aug 2021 14:26:40 +0200
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

>> It's clearly a bug, and it's made worse in Emacs-27 where
>> package-initialize is called automatically before reading ~/.emacs.
>> IOW, I think "this" needs to be fixed before Emacs-27.1.
>
> I just installed a patch which should reduce the impact of this problem
> in Emacs-27.1: the problem still occurs if you setq package-archives
> after calling package-initialize, but at least you can now setq
> package-archives in your ~/.emacs rather than having to do it in your
> early-init.el.

Is there more to be done here, or is this a sufficient solution to the
issue?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Aug 2021 12:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24467; Package emacs. (Tue, 17 Aug 2021 12:40:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 24467 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net,
 Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 21703 <at> debbugs.gnu.org,
 SK Kim <tttuuu888 <at> gmail.com>
Subject: Re: bug#21703: adding package archives after calling
 package-initialize lists all their packages as "new"
Date: Tue, 17 Aug 2021 14:39:29 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>
> >> It's clearly a bug, and it's made worse in Emacs-27 where
> >> package-initialize is called automatically before reading ~/.emacs.
> >> IOW, I think "this" needs to be fixed before Emacs-27.1.
> >
> > I just installed a patch which should reduce the impact of this problem
> > in Emacs-27.1: the problem still occurs if you setq package-archives
> > after calling package-initialize, but at least you can now setq
> > package-archives in your ~/.emacs rather than having to do it in your
> > early-init.el.
>
> Is there more to be done here, or is this a sufficient solution to the
> issue?

If nothing more was changed, then the originally reported problem is not
fixed.  That behavior might still annoy or confuse people then.

Michael.




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 18 Aug 2021 14:44:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 300 days ago.

Previous Next


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