Skip to content

Commit

Permalink
fix(cli): rewrite 'doom sync'; deprecate 'doom build'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hlissner committed Mar 24, 2024
1 parent 1fa8d3a commit cff0919
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 216 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ commands you should know about:
+ `doom env` to dump a snapshot of your shell environment to a file that Doom
will load at startup. This allows Emacs to inherit your `PATH`, among other
things.
+ `doom build` to recompile all installed packages (use this if you up/downgrade
Emacs).


# Roadmap
Expand Down
1 change: 0 additions & 1 deletion bin/doom
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ SEE ALSO:
;; (load! "nuke" dir)
;; (load! "package" dir)
;; (load! "profile" dir)
;; (defcli-obsolete! ((build b)) (sync "--rebuild") "v3.0.0")
)

(defcli-group! "Diagnostics"
Expand Down
7 changes: 3 additions & 4 deletions docs/faq.org
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,13 @@ This command is never needed for changes to =$DOOMDIR/config.el=.

** Copy or sync my config to another system?
*Short answer:* it is safe to sync =$DOOMDIR= across systems, but not
=$EMACSDIR=. Once moved, use ~$ doom sync && doom build~ to ensure everything is
set up correctly.
=$EMACSDIR=. Once moved, use ~$ doom sync~ to ensure everything is set up
correctly.

*Long answer:* packages can contain baked-in absolute paths and non-portable
byte-code. It is never a good idea to mirror it across multiple systems, unless
they are all the same (same OS, same version of Emacs, same paths). Most issues
should be solved by running ~$ doom sync && doom build~ on the other end, once
moved.
should be solved by running ~$ doom sync~ on the other end, once moved.

** Start over, in case something went terribly wrong?
Delete =$EMACSDIR/.local/straight= and run ~$ doom sync~.
Expand Down
Loading

0 comments on commit cff0919

Please sign in to comment.