Commit graph

130 commits

Author SHA1 Message Date
Henrik Lissner
1a5ff08da4
fix(cli): doom install: bootstrap other profiles if present
Like 'doom sync', have 'doom install' set up the profiles bootloader.
2024-09-04 15:04:32 -04:00
Henrik Lissner
42df7cb9fd
docs(cli): doom install: reformat output
Also simplifies the first-timer "things you should know" snippet after
running 'doom install'.
2024-09-04 15:04:32 -04:00
Henrik Lissner
559e5b6a96
docs(cli): doom gc: corrections
To reflect changes made to this command when it was renamed 'doom gc'
(from 'doom purge').
2024-09-03 04:04:29 -04:00
Henrik Lissner
5c7f6f5c41
fix(cli): don't native-comp site-files without --aot
Amend: e3fdfee1c5
Ref: #6811
2024-09-03 04:04:22 -04:00
Henrik Lissner
3bced4dbbe
refactor(cli): separate cli bootstrap from lib
Eventually, I want to autoload some of this stuff, so that users in
interactive sessions can safely load it without side effects (useful
when writing their own CLIs or editing Doom's source).
2024-09-01 14:45:52 -04:00
Henrik Lissner
069ea9e02f
fix(cli): straight: highlight 'Reset "*" to "*"' option 2024-08-31 21:50:08 -04:00
Henrik Lissner
79910fba42
fix(cli): wrong-number-of-args error from mapconcat
On Emacs <=28.2, mapconcat's third argument isn't optional.

Amend: 7f175ab6d9
Ref: #8024
2024-08-30 04:57:29 -04:00
Henrik Lissner
7f175ab6d9
fix(cli): inconsistent system hash between sessions
sxhash doesn't guarantee hashes are consistent across Emacs sessions, so
use md5 instead. Also simplifies what's getting hashed;
`system-configuration` is a sufficient substitute for both `system-type`
and what I wanted to glean from changes in
`system-configuration-features`.

Amend: 80e9263b85
Close: #8030
Ref: #8024
Co-authored-by: yaaama <yaaama@users.noreply.github.com>
2024-08-29 15:44:29 -04:00
Henrik Lissner
6077b6f0d8
fix: correct version string in obsoletion calls 2024-08-26 18:07:47 -04:00
Henrik Lissner
80e9263b85
fix(cli): doom sync: heuristic for total rebuilds
Fix: #8024
2024-08-26 02:16:03 -04:00
Henrik Lissner
e21e01d4c2
fix(cli): doom env: blacklist $WAYLAND_DISPLAY 2024-08-23 02:50:19 -04:00
Henrik Lissner
c901f5806e
fix(cli): straight ignoring native-comp-jit-compilation-deny-list
Turns out native-comp doesn't respect
`native-comp-jit-compilation-deny-list` if called explicitly (instead of
from deferred compilation).

Fix: #5592
Fix: #6283
Fix: #3655
2024-08-23 02:50:19 -04:00
Henrik Lissner
1912571c9c
docs: minor revisions of docstrings across core+cli 2024-08-15 23:24:56 -04:00
Henrik Lissner
3a2c234b1c
fix(cli): don't AOT native-comp if disabled 2024-08-15 15:46:47 -04:00
Henrik Lissner
4fcf332749
refactor: generalize fd/ripgrep vars & options
I intend to eventually replace projectile with project.el, so these
doom-projectile-* variables need to be generalized, starting with the
fd/ripgrep executable paths.

ALong with that, this refactors Doom's projectile-generic-command to
lean more on built-in fd support in projectile, where possible (fewer
wheels reinvented).

Ref: doomemacs/core#1
2024-08-09 21:03:37 -04:00
Henrik Lissner
e3fdfee1c5
feat(cli): add --aot option
Allow ahead-of-time native-compilation during CLI operations that
install or update packages. This will not retroactively native-compile
already-installed packages, you'll need to use --rebuild to do so.

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

Fix: #6811
2024-08-08 17:26:54 -04:00
Ilya Gladyshev
2c17f71965
fix(cli): don't prompt to rebuild if --rebuild is given
When running `doom sync --rebuild` after emacs upgrade the user is
prompted with "Installed packages must be rebuilt. Do so now?", even
though doom was explicitly instructed to rebuild. This PR removes this
prompt when the `--rebuild` option is provided
2024-08-06 13:02:13 -04:00
Henrik Lissner
b163c21fe5
fix(cli): --force: handle more straight prompts
Fix: #7906
2024-07-28 15:21:13 -04:00
Henrik Lissner
54a084fed7
fix(cli): some package files not being byte-compiled
Fix: #7707
Ref: radian-software/straight.el#1132
2024-07-26 04:46:54 -04:00
Henrik Lissner
5852b2ecf5
fix(cli): properly overwrite last line of output
Before this, text that extended past the new line's length would
persist, causing garbled output like this:

  > Ensuring packages are installed and built...
    > Updating recipe repos...
    > Cloning org-appear...r emacsmirror-mirror...
    - No packages need attention

Which might lead you to believe org-appear is being cloned from
emacsmirror-mirror, but the full output is actually:

  > Ensuring packages are installed and built...
    > Updating recipe repos...
      > Updating recipes for melpa...
      > Updating recipes for nongnu-elpa...
      > Updating recipes for gnu-elpa-mirror...
      > Updating recipes for el-get...
      > Updating recipes for emacsmirror-mirror...
    > Cloning org-appear...
    - No packages need attention
2024-07-26 04:46:54 -04:00
Henrik Lissner
98a3cad54d
docs: minor docstring revisions
For clarity only. These do not reflect any recent changes.
2024-07-18 22:38:59 -04:00
Henrik Lissner
378d0b8db6
fix(cli): doom env: omit XDG_BACKEND & DOOMLOCALDIR 2024-07-14 00:45:42 -04:00
Henrik Lissner
1cc83dce35
fix(cli): wrong-number-of-args error on choosing 'abort'
Fix: #7917
2024-07-06 20:13:38 -04:00
Henrik Lissner
25d0b4065f
dev: format CODEOWNERS with more whitespace
Affects the result of 'doom make codeowners'
2024-07-01 03:35:35 -04:00
Henrik Lissner
83aa40797e
fix(cli): suppress secondary prompts from straight on -!/--force
The -!/--force flags suppress straight's 'how to proceed' prompts, but
not the secondary ones like 'Really delete remote "origin"?'. This fixes
that.

Fix: #7906
2024-06-28 17:00:58 -04:00
StrawberryTea
2729a3f7e3 fix: obey the comp namespace change
Some of the comp functions were declared private.
2024-06-03 15:57:56 -04:00
Levin Du
ede616fdd7
fix(cli): doom-packages-ensure: ensure local packages are built
If the package is local, the local-repo has absolute local file path,
and straight-modified-dir will return as it is, which always exists.

Fix it by passing package only to straight-modified-dir.
2024-04-16 03:00:56 -04:00
Henrik Lissner
2debe85a8a
fix(cli): doom upgrade: void-variable num
Fix: #7791
2024-04-03 19:21:14 -04:00
Henrik Lissner
c6fc0e5bc0
fix(cli): don't delete repos beyond $DOOMLOCALDIR
Doom makes multiple attempts to re-clone repos if they failed the first
time, however, if a user provides a :local-repo and that location isn't
a git repo, Doom assumes this it is the result of a failed clone, and so
deletes it to "try" again (which will fail). This can result in lost
work.

This prevents this from happening to packages/repos outside of
$DOOMLOCALDIR (all packages under $DOOMLOCALDIR must be git repos).

Fix: #7785
Amend: 3643c4dadd
Amend: 1fa8d3a4b9
2024-04-01 19:43:39 -04:00
Henrik Lissner
3643c4dadd
fix(cli): void-function directory-empty-p error
directory-empty-p was introduced in 28.1, but Doom still supports 27.1,
so 27.x users would see this error when running any bin/doom command
that clones packages.

Fix: #7779
Amend: 1fa8d3a4b9
2024-03-30 11:50:57 -04:00
Henrik Lissner
b01e496405
fix(cli): doom sync: rebuild-all loop
Addresses an edge case where 'doom sync' could fall into an inescapable
'rebuild all packages' loop.

Fix: #7775
2024-03-29 23:41:12 -04:00
Henrik Lissner
65240e9b92
fix(cli): suppress 'checked out X' when X = nil 2024-03-29 12:32:12 -04:00
Henrik Lissner
544e579c44
fix(cli): doom upgrade: ensure upgrade remote is deleted
It seems the temporary branch that 'doom upgrade' creates is sometimes
left over after a 'doom upgrade', preventing the next 'git fetch' from
completing.

Ref: #7771
2024-03-28 09:43:43 -04:00
Henrik Lissner
b443371981
fix(cli): doom install: $DOOMDIR templates (part 2)
Caused by a regression originally introduced in b6b755d, but incorrectly
fixed in 89c56a3. Don't code while sleep deprived, kids.

Amend: 89c56a3393
Amend: b6b755dea4
2024-03-28 00:23:17 -04:00
Henrik Lissner
89c56a3393
fix(cli): doom install: $DOOMDIR templates
Caused by a regression introduced in b6b755d.

Amend: b6b755dea4
2024-03-27 17:15:43 -04:00
Henrik Lissner
3f966f49d8
fix(cli): doom upgrade: remove doom-compile-clean call
This function was removed in 63c470b.

Amend: 63c470bff3
2024-03-27 10:27:44 -04:00
Henrik Lissner
d6a3450917
fix(cli): shell-quote-argument: wrong-number-of-args error
shell-quote-argument's second argument was introduced in 29.1. Users on
older versions of Emacs will get an error.

Amend: d5bad5b430
2024-03-27 10:27:05 -04:00
Henrik Lissner
b6b755dea4
fix(cli): doom install: $DOOMDIR paths in output
Close: #7768
Co-authored-by: plajjan <plajjan@users.noreply.github.com>
2024-03-27 09:39:05 -04:00
Henrik Lissner
201051c368
fix(cli): doom sync: suppress rebuild prompt when upgrading
12a765c introduced suppression of package-rebuilding prompts on 'doom
upgrade', but inadvertently reversed the check. This fixes that (and
refactors the if/or tree into a `cond`).

Amend: 12a765c509
2024-03-27 00:26:18 -04:00
Henrik Lissner
aef2b12100
feat(cli): doom upgrade: add -B option
To mirror doom sync's -B option.
2024-03-27 00:26:18 -04:00
Henrik Lissner
d5bad5b430
fix(cli): straight: regurgitate type errors as connection errors
See included comment for explanation.
2024-03-26 22:58:56 -04:00
Henrik Lissner
12a765c509
feat(cli): doom sync: change -B to suppress rebuilding
Prior to this, -B would suppress the prompt for package rebuilding if
your Emacs version or hostname changed. Now, it fully inhibits
rebuilding in either case.

Fix: #7760
Ref: cff091982e
2024-03-26 21:36:14 -04:00
Henrik Lissner
286be1b249
fix(cli): void-variable doom-profile-env-file-name error
This variable ref snuck into cff0919, but hasn't been introduced yet.

Fix: #7755
Amend: cff091982e
2024-03-24 18:55:43 -04:00
Henrik Lissner
6d682eef85
fix(cli): void-function doom-packages-install error
Function was renamed to doom-packages-ensure in cff0919.

Fix: #7755
Amend: cff091982e
2024-03-24 18:38:18 -04:00
Henrik Lissner
77df11af11
refactor(cli): remove unused cli/help.el
This file was "renamed" to meta.el at some point, but the old file was
forgotten (and unused).
2024-03-24 18:03:13 -04:00
Henrik Lissner
2591201aa1
refactor(cli): rename 'doom purge' -> 'doom gc'
'doom purge' is now deprecated.

Also changes 'doom sync's -p option to --gc. Since GCing causes the loss
of historical data, I'd rather it be a long option to make it a little
harder to do accidentally.
2024-03-24 18:03:13 -04:00
Henrik Lissner
cff091982e
fix(cli): rewrite 'doom sync'; deprecate 'doom build'
This changes 'doom sync' to be smarter about responding to changed
package recipes/pins, changes in Emacs version, or instances where the user
has copied a config to a new system.

In all these cases, the user would formerly have to know about a
specific combination of 'doom sync -u' and 'doom build' to ensure Doom
is in a good state. With this change, 'doom sync' handles all these
cases.

Also, 'doom build' is now deprecated (and 'doom sync' now has a
--rebuild option to mimic its old behavior).

Also also, sometimes, a package may silently fail when cloned (which
used to result in an empty repo). Now, if this is detected, cloning will
be re-attempted up to 3 times before aborting with much more visible
error.

Note: these are stopgap solutions, until v3 is finished.
2024-03-24 18:03:12 -04:00
Henrik Lissner
1fa8d3a4b9
fix(cli): retry on failure to clone packages (or abort)
Something often reported are file-missing errors when a package that
should be present isn't. This can easily happen if, say, during a 'doom
sync' or 'doom upgrade' a package fails to clone correctly and the user
misses the errors, then tries to carry on as normal. What's worse is
that Straight leaves behind an empty directory, which it treats as a
sign that the package has been cloned correctly, so it doesn't raise any
fuss over them.

With this change, 'doom sync' (and 'doom upgrade') will now try again,
if the clone process fails the first time (up to 3 times) before
aborting the whole process altogether, which should be loud enough for
users not to miss. Note that these failures at 99.99% because of
network (or upstream downtime) issues.

For now, this does leave Doom in an incomplete state (until you try
again when the connection issue is resolved), but a rollback step will
be added in v3 to prevent this, as well as better error messages (as
well as @doomelpa mirror for packages on less reliable hosts, like
codeberg, savannah, etc).
2024-03-24 18:03:12 -04:00
Henrik Lissner
63c470bff3
refactor!(cli): remove compile and clean commands
BREAKING CHANGE: This removes the 'doom compile' and 'doom clean'
commands, and offers no immediate replacement for them (and no plan to
include one). In the future, byte-compilation of Doom's internals will
be baked into 'doom sync', but until then, Doom is not optimized to take
advantage of byte-compilation, and forcing it provides no benefit.
2024-03-24 18:03:12 -04:00
TEC
7984cd8e0f tweak(cli): use fancier string-dist suggestion alg
To improve the quality of "did you mean?"-style suggestions, shift from
using Ratcliff-Obershelp similarity to the Restricted
Damerau-Levenshtein string distance (also known as Optimal String
Alignment).

This code is a translation of a Julia implementation that I wrote a
while ago:
https://github.com/tecosaur/DataToolkitBase.jl/blob/v0.4.1/src/model/utils.jl#L40-L107

See https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance
and https://en.wikipedia.org/wiki/Gestalt_pattern_matching for more
information on these algorithms.
2024-02-16 02:06:24 -05:00