2018-09-07 21:49:49 -04:00
|
|
|
;; -*- no-byte-compile: t; -*-
|
|
|
|
;;; core/cli/packages.el
|
|
|
|
|
2020-08-06 22:24:41 -04:00
|
|
|
(defcli! (update u) (&rest _)
|
|
|
|
"This command was removed."
|
|
|
|
:hidden t
|
|
|
|
(print! (error "This command has been removed.\n"))
|
|
|
|
(print-group!
|
|
|
|
(print! "To update Doom run 'doom upgrade'. To only update packages run 'doom sync -u'."))
|
|
|
|
nil)
|
2019-07-21 15:39:45 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defcli! (build b)
|
|
|
|
((rebuild-p ["-r"] "Only rebuild packages that need rebuilding"))
|
|
|
|
"Byte-compiles & symlinks installed packages.
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
This ensures that all needed files are symlinked from their package repo and
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
their elisp files are byte-compiled. This is especially necessary if you upgrade
|
|
|
|
Emacs (as byte-code is generally not forward-compatible)."
|
|
|
|
(when (doom-cli-packages-build (not rebuild-p))
|
2020-05-25 03:36:38 -04:00
|
|
|
(doom-autoloads-reload))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
t)
|
|
|
|
|
|
|
|
(defcli! (purge p)
|
2021-01-31 04:29:54 -05:00
|
|
|
((nobuilds-p ["-b" "--no-builds"] "Don't purge unneeded (built) packages")
|
|
|
|
(noelpa-p ["-p" "--no-elpa"] "Don't purge ELPA packages")
|
|
|
|
(norepos-p ["-r" "--no-repos"] "Don't purge unused straight repos")
|
|
|
|
(noeln-p ["-e" "--no-eln"] "Don't purge old ELN bytecode")
|
|
|
|
(noregraft-p ["-g" "--no-regraft"] "Regraft git repos (ie. compact them)"))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
"Deletes orphaned packages & repos, and compacts them.
|
|
|
|
|
|
|
|
Purges all installed ELPA packages (as they are considered temporary). Purges
|
|
|
|
all orphaned package repos and builds. If -g/--regraft is supplied, the git
|
|
|
|
repos among them will be regrafted and compacted to ensure they are as small as
|
|
|
|
possible.
|
|
|
|
|
|
|
|
It is a good idea to occasionally run this doom purge -g to ensure your package
|
|
|
|
list remains lean."
|
|
|
|
(straight-check-all)
|
|
|
|
(when (doom-cli-packages-purge
|
|
|
|
(not noelpa-p)
|
|
|
|
(not norepos-p)
|
|
|
|
(not nobuilds-p)
|
2021-01-31 04:29:54 -05:00
|
|
|
(not noregraft-p)
|
2021-01-31 04:27:41 -05:00
|
|
|
(not noeln-p))
|
2020-05-25 03:36:38 -04:00
|
|
|
(doom-autoloads-reload))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
t)
|
|
|
|
|
|
|
|
;; (defcli! rollback () ; TODO doom rollback
|
2019-07-21 15:39:45 +02:00
|
|
|
;; "<Not implemented yet>"
|
|
|
|
;; (user-error "Not implemented yet, sorry!"))
|
2019-06-16 23:01:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Library
|
2018-09-07 21:49:49 -04:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(defun doom--same-commit-p (abbrev-ref ref)
|
|
|
|
(and (stringp abbrev-ref)
|
|
|
|
(stringp ref)
|
|
|
|
(string-match-p (concat "^" (regexp-quote abbrev-ref))
|
|
|
|
ref)))
|
2020-01-25 03:49:42 -05:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(defun doom--abbrev-commit (commit &optional full)
|
|
|
|
(if full commit (substring commit 0 7)))
|
|
|
|
|
|
|
|
(defun doom--commit-log-between (start-ref end-ref)
|
2021-04-29 15:07:13 -04:00
|
|
|
(straight--process-with-result
|
|
|
|
(straight--process-run
|
|
|
|
"git" "log" "--oneline" "--no-merges"
|
|
|
|
"-n" "26" end-ref (concat "^" (regexp-quote start-ref)))
|
|
|
|
(if success
|
2021-05-23 21:48:38 -04:00
|
|
|
(let* ((output (string-trim-right (or stdout "")))
|
2021-04-29 15:07:13 -04:00
|
|
|
(lines (split-string output "\n")))
|
|
|
|
(if (> (length lines) 25)
|
|
|
|
(concat (string-join (butlast lines 1) "\n") "\n[...]")
|
|
|
|
output))
|
|
|
|
(format "ERROR: Couldn't collect commit list because: %s" stderr))))
|
|
|
|
|
|
|
|
(defmacro doom--straight-with (form &rest body)
|
|
|
|
(declare (indent 1))
|
|
|
|
`(let-alist
|
|
|
|
(let* ((buffer (straight--process-buffer))
|
|
|
|
(start (with-current-buffer buffer (point-max)))
|
|
|
|
(retval ,form)
|
|
|
|
(output (with-current-buffer buffer (buffer-substring start (point-max)))))
|
|
|
|
(save-match-data
|
|
|
|
(list (cons 'it retval)
|
|
|
|
(cons 'stdout (substring-no-properties output))
|
|
|
|
(cons 'success (if (string-match "\n+\\[Return code: \\([0-9-]+\\)\\]\n+" output)
|
|
|
|
(string-to-number (match-string 1 output))))
|
|
|
|
(cons 'output (string-trim output
|
|
|
|
"^\\(\\$ [^\n]+\n\\)*\n+"
|
|
|
|
"\n+\\[Return code: [0-9-]+\\]\n+")))))
|
|
|
|
,@body))
|
2019-12-25 13:34:36 -05:00
|
|
|
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(defun doom--barf-if-incomplete-packages ()
|
|
|
|
(let ((straight-safe-mode t))
|
|
|
|
(condition-case _ (straight-check-all)
|
|
|
|
(error (user-error "Package state is incomplete. Run 'doom sync' first")))))
|
|
|
|
|
|
|
|
(defmacro doom--with-package-recipes (recipes binds &rest body)
|
|
|
|
(declare (indent 2))
|
|
|
|
(let ((recipe-var (make-symbol "recipe"))
|
|
|
|
(recipes-var (make-symbol "recipes")))
|
|
|
|
`(let* ((,recipes-var ,recipes)
|
|
|
|
(built ())
|
|
|
|
(straight-use-package-pre-build-functions
|
|
|
|
(cons (lambda (pkg &rest _) (cl-pushnew pkg built :test #'equal))
|
|
|
|
straight-use-package-pre-build-functions)))
|
|
|
|
(dolist (,recipe-var ,recipes-var (nreverse built))
|
|
|
|
(cl-block nil
|
|
|
|
(straight--with-plist (append (list :recipe ,recipe-var) ,recipe-var)
|
|
|
|
,(doom-enlist binds)
|
|
|
|
,@body))))))
|
|
|
|
|
|
|
|
(defvar doom--cli-updated-recipes nil)
|
|
|
|
(defun doom--cli-recipes-update ()
|
|
|
|
"Updates straight and recipe repos."
|
|
|
|
(unless doom--cli-updated-recipes
|
|
|
|
(straight--make-build-cache-available)
|
|
|
|
(print! (start "Updating recipe repos..."))
|
|
|
|
(print-group!
|
|
|
|
(doom--with-package-recipes
|
2021-04-29 15:07:13 -04:00
|
|
|
(delq
|
|
|
|
nil (mapcar (doom-rpartial #'gethash straight--repo-cache)
|
|
|
|
(mapcar #'symbol-name straight-recipe-repositories)))
|
|
|
|
(recipe package type local-repo)
|
|
|
|
(let ((esc (unless doom-debug-p "\033[1A"))
|
|
|
|
(ref (straight-vc-get-commit type local-repo))
|
|
|
|
newref output)
|
|
|
|
(print! (start "\033[KUpdating recipes for %s...%s") package esc)
|
|
|
|
(doom--straight-with (straight-vc-fetch-from-remote recipe)
|
|
|
|
(when .it
|
|
|
|
(setq output .output)
|
|
|
|
(straight-merge-package package)
|
|
|
|
(unless (equal ref (setq newref (straight-vc-get-commit type local-repo)))
|
|
|
|
(print! (success "\033[K%s updated (%s -> %s)")
|
|
|
|
package
|
|
|
|
(doom--abbrev-commit ref)
|
|
|
|
(doom--abbrev-commit newref))
|
|
|
|
(unless (string-empty-p output)
|
|
|
|
(print-group! (print! (info "%s" output))))))))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(setq straight--recipe-lookup-cache (make-hash-table :test #'eq)
|
|
|
|
doom--cli-updated-recipes t)))
|
|
|
|
|
2020-10-07 22:23:51 +10:00
|
|
|
(defvar doom--eln-output-expected nil)
|
|
|
|
|
2021-05-08 18:56:25 -04:00
|
|
|
(defvar doom--eln-output-path (car (bound-and-true-p native-comp-eln-load-path)))
|
2020-10-07 22:23:51 +10:00
|
|
|
|
|
|
|
(defun doom--eln-file-name (file)
|
|
|
|
"Return the short .eln file name corresponding to `file'."
|
|
|
|
(concat comp-native-version-dir "/"
|
|
|
|
(file-name-nondirectory
|
|
|
|
(comp-el-to-eln-filename file))))
|
|
|
|
|
|
|
|
(defun doom--eln-output-file (eln-name)
|
|
|
|
"Return the expected .eln file corresponding to `eln-name'."
|
|
|
|
(concat doom--eln-output-path eln-name))
|
|
|
|
|
|
|
|
(defun doom--eln-error-file (eln-name)
|
|
|
|
"Return the expected .error file corresponding to `eln-name'."
|
|
|
|
(concat doom--eln-output-path eln-name ".error"))
|
|
|
|
|
|
|
|
(defun doom--find-eln-file (eln-name)
|
2021-05-08 18:56:25 -04:00
|
|
|
"Find `eln-name' on the `native-comp-eln-load-path'."
|
2020-10-07 22:23:51 +10:00
|
|
|
(cl-some (lambda (eln-path)
|
|
|
|
(let ((file (concat eln-path eln-name)))
|
|
|
|
(when (file-exists-p file)
|
|
|
|
file)))
|
2021-05-08 18:56:25 -04:00
|
|
|
native-comp-eln-load-path))
|
2020-04-17 17:11:34 +10:00
|
|
|
|
|
|
|
(defun doom--elc-file-outdated-p (file)
|
2020-10-07 22:23:51 +10:00
|
|
|
"Check whether the corresponding .elc for `file' is outdated."
|
2020-04-17 17:11:34 +10:00
|
|
|
(let ((elc-file (byte-compile-dest-file file)))
|
|
|
|
;; NOTE Ignore missing elc files, they could be missing due to
|
|
|
|
;; `no-byte-compile'. Rebuilding unnecessarily is expensive.
|
|
|
|
(when (and (file-exists-p elc-file)
|
|
|
|
(file-newer-than-file-p file elc-file))
|
|
|
|
(doom-log "%s is newer than %s" file elc-file)
|
|
|
|
t)))
|
|
|
|
|
|
|
|
(defun doom--eln-file-outdated-p (file)
|
2020-10-07 22:23:51 +10:00
|
|
|
"Check whether the corresponding .eln for `file' is outdated."
|
|
|
|
(let* ((eln-name (doom--eln-file-name file))
|
|
|
|
(eln-file (doom--find-eln-file eln-name))
|
|
|
|
(error-file (doom--eln-error-file eln-name)))
|
|
|
|
(cond (eln-file
|
2020-04-17 17:11:34 +10:00
|
|
|
(when (file-newer-than-file-p file eln-file)
|
|
|
|
(doom-log "%s is newer than %s" file eln-file)
|
|
|
|
t))
|
|
|
|
((file-exists-p error-file)
|
|
|
|
(when (file-newer-than-file-p file error-file)
|
|
|
|
(doom-log "%s is newer than %s" file error-file)
|
|
|
|
t))
|
|
|
|
(t
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom-log "%s doesn't exist" eln-name)
|
2020-04-17 17:11:34 +10:00
|
|
|
t))))
|
|
|
|
|
|
|
|
(defun doom--native-compile-done-h (file)
|
2020-10-07 22:23:51 +10:00
|
|
|
"Callback fired when an item has finished async compilation."
|
|
|
|
(when file
|
|
|
|
(let* ((eln-name (doom--eln-file-name file))
|
|
|
|
(eln-file (doom--eln-output-file eln-name))
|
|
|
|
(error-file (doom--eln-error-file eln-name)))
|
|
|
|
(if (file-exists-p eln-file)
|
|
|
|
(doom-log "Compiled %s" eln-file)
|
|
|
|
(make-directory (file-name-directory error-file) 'parents)
|
|
|
|
(write-region "" nil error-file)
|
|
|
|
(doom-log "Wrote %s" error-file)))))
|
2020-04-17 17:11:34 +10:00
|
|
|
|
|
|
|
(defun doom--native-compile-jobs ()
|
|
|
|
"How many async native compilation jobs are queued or in-progress."
|
2020-11-16 13:58:38 +10:00
|
|
|
(if (featurep 'comp)
|
2020-04-17 17:11:34 +10:00
|
|
|
(+ (length comp-files-queue)
|
|
|
|
(comp-async-runnings))
|
|
|
|
0))
|
|
|
|
|
|
|
|
(defun doom--wait-for-compile-jobs ()
|
|
|
|
"Wait for all pending async native compilation jobs."
|
|
|
|
(cl-loop for pending = (doom--native-compile-jobs)
|
|
|
|
with previous = 0
|
|
|
|
while (not (zerop pending))
|
2020-10-07 22:23:51 +10:00
|
|
|
if (/= previous pending) do
|
2021-05-23 21:40:01 -04:00
|
|
|
(print! (start "\033[KNatively compiling %d files...\033[1A" pending))
|
2020-04-17 17:11:34 +10:00
|
|
|
(setq previous pending)
|
|
|
|
else do
|
|
|
|
(let ((inhibit-message t))
|
2020-10-07 22:23:51 +10:00
|
|
|
(sleep-for 0.1))))
|
|
|
|
|
|
|
|
(defun doom--write-missing-eln-errors ()
|
|
|
|
"Write .error files for any expected .eln files that are missing."
|
|
|
|
(cl-loop for file in doom--eln-output-expected
|
|
|
|
for eln-name = (doom--eln-file-name file)
|
|
|
|
for eln-file = (doom--eln-output-file eln-name)
|
|
|
|
for error-file = (doom--eln-error-file eln-name)
|
2020-04-17 17:11:34 +10:00
|
|
|
unless (or (file-exists-p eln-file)
|
2020-10-07 22:23:51 +10:00
|
|
|
(file-newer-than-file-p error-file file))
|
|
|
|
do (make-directory (file-name-directory error-file) 'parents)
|
|
|
|
(write-region "" nil error-file)
|
|
|
|
(doom-log "Wrote %s" error-file))
|
|
|
|
(setq doom--eln-output-expected nil))
|
|
|
|
|
|
|
|
(defun doom--compile-site-packages ()
|
|
|
|
"Queue async compilation for all non-doom Elisp files."
|
2020-11-16 13:58:38 +10:00
|
|
|
(when (featurep 'comp)
|
2020-10-07 22:23:51 +10:00
|
|
|
(cl-loop with paths = (cl-loop for path in load-path
|
2020-10-22 16:11:31 -04:00
|
|
|
unless (string-prefix-p doom-local-dir path)
|
2020-10-07 22:23:51 +10:00
|
|
|
collect path)
|
2020-10-22 16:11:31 -04:00
|
|
|
for file in (doom-files-in paths :match "\\.el\\(?:\\.gz\\)?$")
|
2020-10-07 22:23:51 +10:00
|
|
|
if (and (file-exists-p (byte-compile-dest-file file))
|
2020-11-24 10:09:20 +10:00
|
|
|
(not (doom--find-eln-file (doom--eln-file-name file)))
|
|
|
|
(not (cl-some (lambda (re)
|
|
|
|
(string-match-p re file))
|
2021-05-12 00:49:59 -04:00
|
|
|
native-comp-deferred-compilation-deny-list))) do
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom-log "Compiling %s" file)
|
2020-11-24 10:09:20 +10:00
|
|
|
(native-compile-async file))))
|
2020-04-17 17:11:34 +10:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-install ()
|
2019-06-16 23:01:17 +02:00
|
|
|
"Installs missing packages.
|
|
|
|
|
|
|
|
This function will install any primary package (i.e. a package with a `package!'
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
declaration) or dependency thereof that hasn't already been."
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(doom-initialize-packages)
|
2020-01-25 03:49:42 -05:00
|
|
|
(print! (start "Installing packages..."))
|
2020-01-28 17:54:51 -05:00
|
|
|
(let ((pinned (doom-package-pinned-list)))
|
|
|
|
(print-group!
|
2021-05-08 14:56:30 -04:00
|
|
|
(add-hook 'native-comp-async-cu-done-functions #'doom--native-compile-done-h)
|
2020-01-28 17:54:51 -05:00
|
|
|
(if-let (built
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(doom--with-package-recipes (doom-package-recipe-list)
|
2020-01-28 17:54:51 -05:00
|
|
|
(recipe package type local-repo)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(unless (file-directory-p (straight--repos-dir local-repo))
|
|
|
|
(doom--cli-recipes-update))
|
2020-01-28 17:54:51 -05:00
|
|
|
(condition-case-unless-debug e
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(let ((straight-use-package-pre-build-functions
|
|
|
|
(cons (lambda (pkg &rest _)
|
|
|
|
(when-let (commit (cdr (assoc pkg pinned)))
|
2020-10-18 17:12:21 -04:00
|
|
|
(print! (info "Checked out %s: %s") pkg commit)))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
straight-use-package-pre-build-functions)))
|
2020-07-24 00:48:05 -04:00
|
|
|
(straight-use-package (intern package))
|
|
|
|
;; HACK Line encoding issues can plague repos with dirty
|
|
|
|
;; worktree prompts when updating packages or "Local
|
|
|
|
;; variables entry is missing the suffix" errors when
|
|
|
|
;; installing them (see hlissner/doom-emacs#2637), so
|
|
|
|
;; have git handle conversion by force.
|
|
|
|
(when (and IS-WINDOWS (stringp local-repo))
|
|
|
|
(let ((default-directory (straight--repos-dir local-repo)))
|
|
|
|
(when (file-in-directory-p default-directory straight-base-dir)
|
2021-04-30 17:08:31 -07:00
|
|
|
(straight--process-run "git" "config" "core.autocrlf" "true")))))
|
2020-01-28 17:54:51 -05:00
|
|
|
(error
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(signal 'doom-package-error (list package e))))))
|
2020-04-17 17:11:34 +10:00
|
|
|
(progn
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom--compile-site-packages)
|
2020-04-17 17:11:34 +10:00
|
|
|
(doom--wait-for-compile-jobs)
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom--write-missing-eln-errors)
|
2020-11-16 13:58:38 +10:00
|
|
|
(print! (success "\033[KInstalled %d packages") (length built)))
|
2020-01-28 17:54:51 -05:00
|
|
|
(print! (info "No packages need to be installed"))
|
|
|
|
nil))))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-build (&optional force-p)
|
2019-07-21 15:39:45 +02:00
|
|
|
"(Re)build all packages."
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(doom-initialize-packages)
|
2020-01-01 23:52:02 -05:00
|
|
|
(print! (start "(Re)building %spackages...") (if force-p "all " ""))
|
2019-07-21 15:39:45 +02:00
|
|
|
(print-group!
|
2020-01-25 03:49:42 -05:00
|
|
|
(let ((straight-check-for-modifications
|
|
|
|
(when (file-directory-p (straight--modified-dir))
|
|
|
|
'(find-when-checking)))
|
|
|
|
(straight--allow-find
|
|
|
|
(and straight-check-for-modifications
|
|
|
|
(executable-find straight-find-executable)
|
|
|
|
t))
|
|
|
|
(straight--packages-not-to-rebuild
|
|
|
|
(or straight--packages-not-to-rebuild (make-hash-table :test #'equal)))
|
|
|
|
(straight--packages-to-rebuild
|
|
|
|
(or (if force-p :all straight--packages-to-rebuild)
|
2020-01-28 17:54:51 -05:00
|
|
|
(make-hash-table :test #'equal)))
|
|
|
|
(recipes (doom-package-recipe-list)))
|
2021-05-08 14:56:30 -04:00
|
|
|
(add-hook 'native-comp-async-cu-done-functions #'doom--native-compile-done-h)
|
2020-01-01 14:29:40 -05:00
|
|
|
(unless force-p
|
2020-02-19 17:52:05 -05:00
|
|
|
(straight--make-build-cache-available))
|
2020-01-25 03:49:42 -05:00
|
|
|
(if-let (built
|
2020-05-25 17:14:56 -04:00
|
|
|
(doom--with-package-recipes recipes (package local-repo recipe)
|
2020-01-30 15:31:30 -05:00
|
|
|
(unless force-p
|
|
|
|
;; Ensure packages with outdated files/bytecode are rebuilt
|
2021-01-08 23:56:27 -05:00
|
|
|
(let* ((build-dir (straight--build-dir package))
|
|
|
|
(repo-dir (straight--repos-dir local-repo))
|
2021-01-31 00:23:36 -05:00
|
|
|
(build (if (plist-member recipe :build)
|
|
|
|
(plist-get recipe :build)
|
2021-02-01 02:31:22 -05:00
|
|
|
t))
|
2021-01-08 23:56:27 -05:00
|
|
|
(want-byte-compile
|
|
|
|
(or (eq build t)
|
|
|
|
(memq 'compile build)))
|
|
|
|
(want-native-compile
|
2021-01-27 02:59:36 -05:00
|
|
|
(or (eq build t)
|
|
|
|
(memq 'native-compile build))))
|
2021-05-23 21:41:32 -04:00
|
|
|
(and (eq (car-safe build) :not)
|
|
|
|
(setq want-byte-compile (not want-byte-compile)
|
|
|
|
want-native-compile (not want-native-compile)))
|
|
|
|
(or (and (require 'comp nil t)
|
|
|
|
(ignore-errors (native-comp-available-p)))
|
|
|
|
(setq want-native-compile nil))
|
2021-01-08 23:56:27 -05:00
|
|
|
(and (or want-byte-compile want-native-compile)
|
2020-07-28 01:34:33 -04:00
|
|
|
(or (file-newer-than-file-p repo-dir build-dir)
|
2020-02-19 17:52:05 -05:00
|
|
|
(file-exists-p (straight--modified-dir (or local-repo package)))
|
2021-01-08 23:56:27 -05:00
|
|
|
(cl-loop with outdated = nil
|
2020-07-28 01:34:33 -04:00
|
|
|
for file in (doom-files-in build-dir :match "\\.el$" :full t)
|
2021-01-08 23:56:27 -05:00
|
|
|
if (or (if want-byte-compile (doom--elc-file-outdated-p file))
|
|
|
|
(if want-native-compile (doom--eln-file-outdated-p file)))
|
2020-07-28 01:48:09 -04:00
|
|
|
do (setq outdated t)
|
2021-01-27 01:08:47 -06:00
|
|
|
(when want-native-compile
|
2020-10-07 22:23:51 +10:00
|
|
|
(push file doom--eln-output-expected))
|
2020-07-28 01:48:09 -04:00
|
|
|
finally return outdated))
|
2020-01-30 15:31:30 -05:00
|
|
|
(puthash package t straight--packages-to-rebuild))))
|
2020-01-25 03:49:42 -05:00
|
|
|
(straight-use-package (intern package))))
|
2020-04-17 17:11:34 +10:00
|
|
|
(progn
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom--compile-site-packages)
|
2020-04-17 17:11:34 +10:00
|
|
|
(doom--wait-for-compile-jobs)
|
2020-10-07 22:23:51 +10:00
|
|
|
(doom--write-missing-eln-errors)
|
|
|
|
(print! (success "\033[KRebuilt %d package(s)") (length built)))
|
2021-01-31 05:14:45 -05:00
|
|
|
(print! (info "No packages need rebuilding"))
|
2020-01-25 03:49:42 -05:00
|
|
|
nil))))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
2018-09-07 21:49:49 -04:00
|
|
|
|
2020-07-28 01:34:33 -04:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-update ()
|
|
|
|
"Updates packages."
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(doom-initialize-packages)
|
|
|
|
(doom--barf-if-incomplete-packages)
|
2020-01-27 00:51:12 -05:00
|
|
|
(let* ((repo-dir (straight--repos-dir))
|
2020-01-28 17:54:51 -05:00
|
|
|
(pinned (doom-package-pinned-list))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(recipes (doom-package-recipe-list))
|
2020-01-26 21:21:06 -05:00
|
|
|
(packages-to-rebuild (make-hash-table :test 'equal))
|
|
|
|
(repos-to-rebuild (make-hash-table :test 'equal))
|
2020-01-25 03:49:42 -05:00
|
|
|
(total (length recipes))
|
2020-05-25 02:58:07 -04:00
|
|
|
(esc (unless doom-debug-p "\033[1A"))
|
2020-01-25 03:49:42 -05:00
|
|
|
(i 0)
|
|
|
|
errors)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(when recipes
|
|
|
|
(doom--cli-recipes-update))
|
|
|
|
(print! (start "Updating packages (this may take a while)..."))
|
|
|
|
(doom--with-package-recipes recipes (recipe package type local-repo)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-incf i)
|
|
|
|
(print-group!
|
|
|
|
(unless (straight--repository-is-available-p recipe)
|
2020-01-27 00:51:12 -05:00
|
|
|
(print! (error "(%d/%d) Couldn't find local repo for %s") i total package)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
2020-01-26 21:21:06 -05:00
|
|
|
(when (gethash local-repo repos-to-rebuild)
|
|
|
|
(puthash package t packages-to-rebuild)
|
|
|
|
(print! (success "(%d/%d) %s was updated indirectly (with %s)") i total package local-repo)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
2020-01-26 21:21:06 -05:00
|
|
|
(let ((default-directory (straight--repos-dir local-repo)))
|
2020-01-27 00:51:12 -05:00
|
|
|
(unless (file-in-directory-p default-directory repo-dir)
|
2020-01-26 21:21:06 -05:00
|
|
|
(print! (warn "(%d/%d) Skipping %s because it is local") i total package)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
2020-03-01 13:24:17 -05:00
|
|
|
(when (eq type 'git)
|
|
|
|
(unless (file-exists-p ".git")
|
|
|
|
(error "%S is not a valid repository" package)))
|
2020-01-25 03:49:42 -05:00
|
|
|
(condition-case-unless-debug e
|
2020-01-26 21:21:06 -05:00
|
|
|
(let ((ref (straight-vc-get-commit type local-repo))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(target-ref
|
|
|
|
(cdr (or (assoc local-repo pinned)
|
|
|
|
(assoc package pinned))))
|
2020-01-26 21:21:06 -05:00
|
|
|
output)
|
|
|
|
(or (cond
|
|
|
|
((not (stringp target-ref))
|
|
|
|
(print! (start "\033[K(%d/%d) Fetching %s...%s") i total package esc)
|
2021-04-29 15:07:13 -04:00
|
|
|
(doom--straight-with (straight-vc-fetch-from-remote recipe)
|
|
|
|
(when .it
|
|
|
|
(setq output .output)
|
|
|
|
(straight-merge-package package)
|
|
|
|
(setq target-ref (straight-vc-get-commit type local-repo))
|
|
|
|
(or (not (doom--same-commit-p target-ref ref))
|
|
|
|
(cl-return)))))
|
2020-01-26 21:21:06 -05:00
|
|
|
|
|
|
|
((doom--same-commit-p target-ref ref)
|
2020-01-27 00:51:12 -05:00
|
|
|
(print! (info "\033[K(%d/%d) %s is up-to-date...%s") i total package esc)
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-return))
|
|
|
|
|
2020-03-01 13:23:39 -05:00
|
|
|
((if (straight-vc-commit-present-p recipe target-ref)
|
|
|
|
(print! (start "\033[K(%d/%d) Checking out %s (%s)...%s")
|
|
|
|
i total package (doom--abbrev-commit target-ref) esc)
|
|
|
|
(print! (start "\033[K(%d/%d) Fetching %s...%s") i total package esc)
|
|
|
|
(and (straight-vc-fetch-from-remote recipe)
|
|
|
|
(straight-vc-commit-present-p recipe target-ref)))
|
2020-01-26 21:21:06 -05:00
|
|
|
(straight-vc-check-out-commit recipe target-ref)
|
|
|
|
(or (not (eq type 'git))
|
|
|
|
(setq output (doom--commit-log-between ref target-ref)))
|
|
|
|
(doom--same-commit-p target-ref (straight-vc-get-commit type local-repo)))
|
|
|
|
|
2020-02-01 02:07:24 -05:00
|
|
|
((print! (start "\033[K(%d/%d) Re-cloning %s...") i total local-repo esc)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(let ((repo (straight--repos-dir local-repo))
|
|
|
|
(straight-vc-git-default-clone-depth 'full))
|
|
|
|
(delete-directory repo 'recursive)
|
2020-01-27 01:44:30 -05:00
|
|
|
(print-group!
|
|
|
|
(straight-use-package (intern package) nil 'no-build))
|
|
|
|
(prog1 (file-directory-p repo)
|
|
|
|
(or (not (eq type 'git))
|
|
|
|
(setq output (doom--commit-log-between ref target-ref)))))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(progn
|
2020-01-27 01:44:30 -05:00
|
|
|
(print! (warn "\033[K(%d/%d) Failed to fetch %s")
|
|
|
|
i total local-repo)
|
|
|
|
(unless (string-empty-p output)
|
|
|
|
(print-group! (print! (info "%s" output))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-return)))
|
|
|
|
(puthash local-repo t repos-to-rebuild)
|
|
|
|
(puthash package t packages-to-rebuild)
|
2020-01-30 18:37:48 -05:00
|
|
|
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
|
2020-01-26 21:21:06 -05:00
|
|
|
i total local-repo
|
|
|
|
(doom--abbrev-commit ref)
|
2020-10-06 13:41:58 -04:00
|
|
|
(doom--abbrev-commit target-ref))
|
|
|
|
(unless (string-empty-p output)
|
|
|
|
(print-group! (print! "%s" (indent 2 output)))))
|
2020-01-25 03:49:42 -05:00
|
|
|
(user-error
|
|
|
|
(signal 'user-error (error-message-string e)))
|
|
|
|
(error
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(signal 'doom-package-error (list package e)))))))
|
|
|
|
(print-group!
|
|
|
|
(princ "\033[K")
|
|
|
|
(if (hash-table-empty-p packages-to-rebuild)
|
|
|
|
(ignore (print! (success "All %d packages are up-to-date") total))
|
|
|
|
(straight--transaction-finalize)
|
|
|
|
(let ((default-directory (straight--build-dir)))
|
|
|
|
(mapc (doom-rpartial #'delete-directory 'recursive)
|
|
|
|
(hash-table-keys packages-to-rebuild)))
|
|
|
|
(print! (success "Updated %d package(s)")
|
|
|
|
(hash-table-count packages-to-rebuild))
|
|
|
|
(doom-cli-packages-build)
|
|
|
|
t))))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
|
2019-07-29 21:04:58 +02:00
|
|
|
;;; PURGE (for the emperor)
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-build (build)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((build-dir (straight--build-dir build)))
|
2019-07-29 21:18:49 +02:00
|
|
|
(delete-directory build-dir 'recursive)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (file-directory-p build-dir)
|
|
|
|
(ignore (print! (error "Failed to purg build/%s" build)))
|
|
|
|
(print! (success "Purged build/%s" build))
|
|
|
|
t)))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-builds (builds)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not builds)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(prog1 0
|
|
|
|
(print! (info "No builds to purge")))
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging straight builds..." (length builds)))
|
|
|
|
(print-group!
|
|
|
|
(length
|
|
|
|
(delq nil (mapcar #'doom--cli-packages-purge-build builds))))))
|
2019-07-29 21:04:58 +02:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-defun doom--cli-packages-regraft-repo (repo)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((default-directory (straight--repos-dir repo)))
|
2020-01-26 21:21:06 -05:00
|
|
|
(unless (file-directory-p ".git")
|
|
|
|
(print! (warn "\033[Krepos/%s is not a git repo, skipping" repo))
|
|
|
|
(cl-return))
|
|
|
|
(unless (file-in-directory-p default-directory straight-base-dir)
|
|
|
|
(print! (warn "\033[KSkipping repos/%s because it is local" repo))
|
|
|
|
(cl-return))
|
|
|
|
(let ((before-size (doom-directory-size default-directory)))
|
2021-04-29 15:07:13 -04:00
|
|
|
(doom-call-process "git" "reset" "--hard")
|
|
|
|
(doom-call-process "git" "clean" "-ffd")
|
|
|
|
(if (not (zerop (car (doom-call-process "git" "replace" "--graft" "HEAD"))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(print! (info "\033[Krepos/%s is already compact\033[1A" repo))
|
2021-04-29 15:07:13 -04:00
|
|
|
(doom-call-process "git" "reflog" "expire" "--expire=all" "--all")
|
|
|
|
(doom-call-process "git" "gc" "--prune=now")
|
|
|
|
(let ((after-size (doom-directory-size default-directory)))
|
|
|
|
(if (equal after-size before-size)
|
|
|
|
(print! (success "\033[Krepos/%s cannot be compacted further" repo))
|
|
|
|
(print! (success "\033[KRegrafted repos/%s (from %0.1fKB to %0.1fKB)")
|
|
|
|
repo before-size after-size)))))
|
|
|
|
t))
|
2019-07-29 21:04:58 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-regraft-repos (repos)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not repos)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(prog1 0
|
|
|
|
(print! (info "No repos to regraft")))
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Regrafting %d repos..." (length repos)))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(let ((before-size (doom-directory-size (straight--repos-dir))))
|
2019-11-25 02:14:58 -05:00
|
|
|
(print-group!
|
|
|
|
(prog1 (delq nil (mapcar #'doom--cli-packages-regraft-repo repos))
|
|
|
|
(princ "\033[K")
|
|
|
|
(let ((after-size (doom-directory-size (straight--repos-dir))))
|
|
|
|
(print! (success "Finished regrafting. Size before: %0.1fKB and after: %0.1fKB (%0.1fKB)")
|
|
|
|
before-size after-size
|
|
|
|
(- after-size before-size))))))))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
|
|
|
(defun doom--cli-packages-purge-repo (repo)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((repo-dir (straight--repos-dir repo)))
|
|
|
|
(delete-directory repo-dir 'recursive)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(delete-file (straight--modified-file repo))
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (file-directory-p repo-dir)
|
|
|
|
(ignore (print! (error "Failed to purge repos/%s" repo)))
|
|
|
|
(print! (success "Purged repos/%s" repo))
|
|
|
|
t)))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-repos (repos)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not repos)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(prog1 0
|
|
|
|
(print! (info "No repos to purge")))
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging straight repositories..."))
|
|
|
|
(print-group!
|
|
|
|
(length
|
|
|
|
(delq nil (mapcar #'doom--cli-packages-purge-repo repos))))))
|
2019-07-29 21:04:58 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-elpa ()
|
2019-12-28 14:02:07 -05:00
|
|
|
(require 'core-packages)
|
|
|
|
(let ((dirs (doom-files-in package-user-dir :type t :depth 0)))
|
|
|
|
(if (not dirs)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(prog1 0
|
|
|
|
(print! (info "No ELPA packages to purge")))
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging ELPA packages..."))
|
|
|
|
(dolist (path dirs (length dirs))
|
|
|
|
(condition-case e
|
|
|
|
(print-group!
|
|
|
|
(if (file-directory-p path)
|
|
|
|
(delete-directory path 'recursive)
|
|
|
|
(delete-file path))
|
2019-12-30 17:28:31 -05:00
|
|
|
(print! (success "Deleted %s") (filename path)))
|
2019-12-28 14:02:07 -05:00
|
|
|
(error
|
|
|
|
(print! (error "Failed to delete %s because: %s")
|
2019-12-30 17:28:31 -05:00
|
|
|
(filename path)
|
|
|
|
e)))))))
|
2019-07-25 18:46:18 +02:00
|
|
|
|
2021-01-31 04:27:41 -05:00
|
|
|
(defun doom--cli-packages-purge-eln ()
|
|
|
|
(if-let (dirs
|
|
|
|
(cl-delete (expand-file-name comp-native-version-dir doom--eln-output-path)
|
|
|
|
(directory-files doom--eln-output-path t "^[^.]" t)
|
|
|
|
:test #'file-equal-p))
|
|
|
|
(progn
|
|
|
|
(print! (start "Purging old native bytecode..."))
|
|
|
|
(print-group!
|
|
|
|
(dolist (dir dirs)
|
|
|
|
(print! (info "Deleting %S") (relpath dir doom--eln-output-path))
|
|
|
|
(delete-directory dir 'recursive))
|
|
|
|
(print! (success "Purged %d directory(ies)" (length dirs))))
|
|
|
|
(length dirs))
|
|
|
|
(print! (info "No ELN directories to purge"))
|
|
|
|
0))
|
|
|
|
|
|
|
|
(defun doom-cli-packages-purge (&optional elpa-p builds-p repos-p regraft-repos-p eln-p)
|
2019-07-21 15:39:45 +02:00
|
|
|
"Auto-removes orphaned packages and repos.
|
2019-06-16 23:01:17 +02:00
|
|
|
|
|
|
|
An orphaned package is a package that isn't a primary package (i.e. doesn't have
|
|
|
|
a `package!' declaration) or isn't depended on by another primary package.
|
|
|
|
|
2019-07-25 18:46:18 +02:00
|
|
|
If BUILDS-P, include straight package builds.
|
|
|
|
If REPOS-P, include straight repos.
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
If ELPA-P, include packages installed with package.el (M-x package-install)."
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(doom-initialize-packages)
|
|
|
|
(doom--barf-if-incomplete-packages)
|
2019-12-29 21:25:40 -05:00
|
|
|
(print! (start "Purging orphaned packages (for the emperor)..."))
|
2019-07-29 21:04:58 +02:00
|
|
|
(cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft)
|
2020-05-25 15:53:09 -04:00
|
|
|
(let ((rdirs
|
|
|
|
(and (or repos-p regraft-repos-p)
|
|
|
|
(straight--directory-files (straight--repos-dir) nil nil 'sort))))
|
|
|
|
(list (when builds-p
|
2020-09-19 14:43:53 -04:00
|
|
|
(let ((default-directory (straight--build-dir)))
|
|
|
|
(seq-filter #'file-directory-p
|
|
|
|
(seq-remove (doom-rpartial #'gethash straight--profile-cache)
|
|
|
|
(straight--directory-files default-directory nil nil 'sort)))))
|
2020-05-25 15:53:09 -04:00
|
|
|
(when repos-p
|
|
|
|
(seq-remove (doom-rpartial #'straight--checkhash straight--repo-cache)
|
|
|
|
rdirs))
|
|
|
|
(when regraft-repos-p
|
|
|
|
(seq-filter (doom-rpartial #'straight--checkhash straight--repo-cache)
|
|
|
|
rdirs))))
|
|
|
|
(print-group!
|
|
|
|
(delq
|
|
|
|
nil (list
|
|
|
|
(if (not builds-p)
|
|
|
|
(ignore (print! (info "Skipping builds")))
|
|
|
|
(and (/= 0 (doom--cli-packages-purge-builds builds-to-purge))
|
|
|
|
(straight-prune-build-cache)))
|
|
|
|
(if (not elpa-p)
|
|
|
|
(ignore (print! (info "Skipping elpa packages")))
|
|
|
|
(/= 0 (doom--cli-packages-purge-elpa)))
|
|
|
|
(if (not repos-p)
|
|
|
|
(ignore (print! (info "Skipping repos")))
|
|
|
|
(/= 0 (doom--cli-packages-purge-repos repos-to-purge)))
|
|
|
|
(if (not regraft-repos-p)
|
|
|
|
(ignore (print! (info "Skipping regrafting")))
|
2021-01-31 04:27:41 -05:00
|
|
|
(doom--cli-packages-regraft-repos repos-to-regraft))
|
|
|
|
(when (require 'comp nil t)
|
|
|
|
(if (not eln-p)
|
|
|
|
(ignore (print! (info "Skipping native bytecode")))
|
2021-01-31 05:14:45 -05:00
|
|
|
(doom--cli-packages-purge-eln))))))))
|