feat(cli): add --aot option

Allow ahead-of-time native-compilation during CLI operations that
install or update packages. This will not retroactively native-compile
already-installed packages, you'll need to use --rebuild to do so.

(This is a stop-gap solution until the v3.0 release)

Fix: #6811
This commit is contained in:
Henrik Lissner 2024-08-07 13:42:14 -04:00
parent 2c17f71965
commit e3fdfee1c5
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 19 additions and 3 deletions

View file

@ -15,7 +15,8 @@
;;; Commands
(defcli! ((install i))
(&flags
((aot? ("--aot") "Enable ahead-of-time native-compilation (if available)")
&flags
(config? ("--config" :yes) "Create `$DOOMDIR' or dummy files therein?")
(envfile? ("--env" :yes) "(Re)generate an envvars file? (see `$ doom help env`)")
(install? ("--install" :yes) "Auto-install packages?")
@ -91,6 +92,10 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
(when (or yes? (y-or-n-p "Generate an envvar file? (see `doom help env` for details)"))
(call! '(env)))))
(when aot?
(after! straight
(setq straight--native-comp-available t)))
;; Install Doom packages
(if (eq install? :no)
(print! (warn "Not installing plugins, as requested"))