2

Not sure what's going on, but suddenly Emacs just started byte-compiling native-compiling everything, all Elisp files. No idea how to get it to stop or what caused this. It's doing all the packages too. The laptop I'm on just can't handle this.

How can I prevent this from happening?

Updates:

setting (setq-default no-native-compile t) does not work, not sure if that's a bug in emacs or if that variable is meant for something else.

an alpine dev updated their emacs compilation to include the NATIVE_FULL_AOT=1 flag, which ships a precompiled aot tree in /usr/lib/emacs... but this also does not prevent native compile of everything in /usr/share/emacs/lisp

10
  • 2
    Are you perhaps using Emacs 28 (or 29) with the native-compilation feature enabled? Byte compilation is unlikely to cause you any dramas even on a low-spec machine. Native compilation is another story. If it's that, then you should install or compile Emacs without native compilation (noting also that a default build will not include this feature).
    – phils
    Apr 11, 2022 at 5:43
  • That said, native compilation may prove to be a boon to you on a low-spec machine once everything has been compiled. (But don't then make a habit of updating lots of ELPA packages at once.)
    – phils
    Apr 11, 2022 at 5:45
  • 1
    I know nothing about Alpine, but I don't think any OS should be only building Emacs with-native-compilation -- it should definitely be optional. Check to see if they've provided an alternative package and, if not, raise an upstream issue with them.
    – phils
    Apr 11, 2022 at 10:21
  • 1
    thanks for the responses @phils, i got in touch with folks on their irc, and ended up filing an issue on their gitlab. will try to set that variable and see if it works for this scenario
    – tbny
    Apr 11, 2022 at 11:29
  • 1
    i can confirm that setting no-native-compile does not work for this circumstance of avoiding compiling everything in /usr/share/emacs/28.1/lisp, but the devs on alpine are talking about compiling with NATIVE_FULL_AOT=1, which should ship with /usr/share compiled
    – tbny
    Apr 11, 2022 at 19:53

2 Answers 2

2

After filing an issue with the distro's git repo and discussing it with a dev, the emacs build is no longer being compiled and shipped with the --with-native-compilation flag. It seems so far that this is the only way to prevent the issue from happening.

update:

another user in the repo issue i filed brought up that we should be able to use (setq comp-deferred-compilation nil) to prevent native compiling of everything under /usr/share/emacs/28.1/lisp, but i have not tested if this actually works

2
  • I do think it would be great for OS package maintainers to introduce new native-compilation packages for Emacs as alternatives to the traditional builds. If they're not already considering that, I'd try suggesting it (on the basis that users with higher-spec hardware may find it a desirable option).
    – phils
    Apr 14, 2022 at 5:19
  • 1
    as of today, i can see the alpine-linux devs are providing separate builds with native compilation enabled. very thankful for their support. thanks for helping out with the initial befuddlement i experienced with the transition to emacs 28.1
    – tbny
    Apr 15, 2022 at 9:00
0

This answer is a little late, perhaps, since the package maintainers have separated out native-comp and non-native-comp builds. But you should be able to prevent all native compilation by adding this to the beginning of early-init.el:

(setq native-comp-speed -1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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