In recent weeks, (require 'package) takes minutes. This only happens on Windows, not on macOS or GNU/Linux. What is going on? emacs-version is GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-11-15.

Resolution (see below): It turned out not to be a problem with Emacs at all.

  • That's not a great question for this site, though you might luck out and get a helpful answer. Do you see the problem also when you start Emacs using emacs -Q (no init file)? If not, recursively bisect your init file to find the culprit. If yes, consider filing an Emacs bug: M-x report-emacs-bug. – Drew Mar 31 '17 at 13:34
  • @Drew If I start without .emacs the startup is instantaneous. So I went through the .emacs sexp-by-sexp. It was (require 'package) very close to the top of the file that was taking a lot of time, and it never used to. I didn't make any recent changes that would be a natural first thing to undo. I've been a happy Emacs user for 30+ years on many platforms, but suddenly startup time on Windows got ridiculous. – gknauth Mar 31 '17 at 13:40
  • 2
    So it sounds like your recipe to repro this is to (1) start Emacs with emacs -Q and then (2) do M-: (require 'package). Is that right? If so, please consider reporting that recipe to Emacs: M-x report-emacs-bug. – Drew Mar 31 '17 at 13:41
  • 1
    Try M-x toggle-debug-on-quit and hitting C-g while it's evaluating. Include the resulting backtrace in your report. – npostavs Mar 31 '17 at 14:22
  • 2
    Okay, so it looks like it's something to do with gpg, can you edit the backtrace into your question and/or add it to the bug report so we can read it properly? – npostavs Mar 31 '17 at 15:06

I followed @npostavs's guidance and it turned out, in the stack trace, that MinGHC (a Haskell environment) had a gpg.exe that was on the PATH that was causing problems. @npostavs noticed that the MinGHC project is dead, and along with the notice of MinGHC project death was a suggestion to use Stack. (I actually have Stack on the Windows computer involved as well.) I removed MinGHC from the Windows computer and the problem I reported went away completely. So this was not an Emacs problem at all, but a problem with something on the PATH that got in the way as (require 'package) was trying to do its job.

Thank you Emacs community for your help and suggestions.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.