jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 261 forks source link

When using :ensure option hosts are connected to for every package #988

Closed cjohansson closed 1 year ago

cjohansson commented 2 years ago

Hello,

I have about 50 packages in my use-package configuration and I use the ensure option, my start-up time is very slow, several minutes because use-package connects to elpa.gnu.org and elpa.nongnu.org for every package.

Would it not be possible to just connect to a host once per startup and store every available package and version in some kind of variable?

doolio commented 2 years ago

hmm, I believe it only connects to the package archives if the package is not already on your load-path that is if it is not already installed.

Possibly, a duplicate of #977?

skangas commented 1 year ago

More information was requested but none was given within 14 days. I'm therefore closing this as a duplicate of #977. If this conclusion is incorrect, please report back with more details, and we can reopen.

Thanks.

cjohansson commented 1 year ago

hmm, I believe it only connects to the package archives if the package is not already on your load-path that is if it is not already installed.

I think that is the issue, when I for example disabled MELPA I have 20 packages that can't be installed and use-package will query elpa och non-GNU elpa for every one of them creating a startup time of several minutes

doolio commented 1 year ago

OK, but be aware that some packages are only available on MELPA so if you have removed your MELPA configuration but still have use-package forms referencing packages on MELPA then package.el (which I assume you are using) will try to install these packages if not already installed and query whichever package archives you have configured.

cjohansson commented 1 year ago

Yes I know, the only solution I found for the issue was to stop using use-package

skangas commented 1 year ago

Yes I know, the only solution I found for the issue was to stop using use-package

Maybe this is not relevant if you stopped using use-package, but: Do you have an example of an offending use-package declaration? Also, which version of Emacs are you using?

This might have been fixed in the upcoming Emacs 29 already, scheduled for release within a couple of months. See: https://github.com/jwiegley/use-package/issues/977#issuecomment-1328518675