Commit Graph

97 Commits

Author SHA1 Message Date
57c0863854 Fix aggressive native recompilation of packages
On `doom sync`
2020-07-28 01:48:09 -04:00
b9b987e1ab Optimize straight build step
Constant `(require 'comp nil t)` checks are quite slow on systems where the library isn't available, so only do it once.
2020-07-28 01:34:33 -04:00
d8af5c3cad Support native compilation of packages 2020-07-28 15:25:34 +10:00
9ec5428441 Set core.autocrlf = true in repos on Windows #2637
Line encoding issues can plague repos with dirty worktree prompts
updating packages or "Local variables entry is missing the suffix"
errors when installing them.
2020-07-24 01:49:59 -04:00
15a58d5b81 Prevent 'doom sync' rebuilding all packages, each time 2020-05-25 18:17:38 -04:00
0bc3f8ea87 doom/purge: refactor & optimize
Reduce how much work it had to do.
2020-05-25 15:55:29 -04:00
e6c88e4384 Refactor autoloads generator & reduce to one generated file
We no longer need two separate autoloads files, so I merged them and
optimized its generation logic.

Other changes
- Doom will refuse to start up (with a helpful error) if it's in an
  incomplete state. This should hopefully reduce the number of bug
  reports from folks that have done something weird, e.g.
  1. You've changed Emacs versions without running 'doom sync -b'.
  2. You've updated Doom outside of `doom upgrade` and didn't run `doom
     sync -u`.
  3. You've forgotten to run 'doom sync' in the first place!
  4. If a previous 'doom ...' command was aborted midway without running
     'doom sync' afterwards.
- 'doom sync' will emit reminders that you need to reload/restart Emacs
- Autoloads API now uses the `doom-autoloads-` prefix, intead of
  'doom-cli-autoloads-', as will be the new convention in the coming
  rewrite.
- Errors from within the package autoloads should be easier to invoke
  the debugger on.
- `doom-modules` is now stored in your autoloads file. Your module list
  will soon be frozen between calls to 'doom sync' to allow for our new,
  atomic CLI I'm working on. This will also means the `doom!` block
  won't cost anything in interactive sessions.
2020-05-25 15:55:29 -04:00
3a38fc633c Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
6241ba2faa Emit fetch output when updating recipe repos 2020-05-17 06:14:37 -04:00
0e851ace9b 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-15 01:33:52 -04:00
ca74996d1b Complain if repo is invalid on 'doom update' 2020-03-01 13:25:47 -05:00
3ecff5777b Fix overaggressive recloning when updating packages 2020-03-01 13:23:39 -05:00
71e5a5513b Fix #2556 (hopefully): exec format error on Windows 2020-02-19 17:54:50 -05:00
0a463673c9 make doom purge -g more aggressive
Reflog keeps the history of every reset, so expiring it allows us to
remove more older commits. git gc by default only cleans for 2 week old
objects, so I made it more aggressive
2020-02-10 20:23:09 -05:00
0dc173a631 Polish progress output during 'doom update' 2020-02-01 02:07:24 -05:00
9a0e029135 Fix output truncation & indentation on 'doom update' 2020-01-30 18:38:18 -05:00
35364f1dd1 Fix hash-table-p errors on 'doom build' 2020-01-30 15:31:30 -05:00
097972bd9d Refactor package pinning
- Make doom/info package details more concise
- Removed doom-pinned-packages variable (pin info now stored in
  doom-packages metadata)
- Fix unpin! not actually unpinning some packages
2020-01-28 20:47:45 -05:00
4dc01912f1 Fix 'doom update' reporting that a successful fetch failed 2020-01-28 14:06:20 -05:00
471be76ba5 Fix typo causing void-function error 2020-01-27 02:05:14 -05:00
5056c74688 Fix some packages failing to fetch on 'doom update' 2020-01-27 01:44:30 -05:00
99fc55f75c General, minor refactors in doom core 2020-01-27 00:51:32 -05:00
dadd54604b Refactor package update logic
Still needs more work.
2020-01-26 21:21:06 -05:00
a9402cfb55 Fix #2373: bring back package pinning
This needs some serious refactoring...
2020-01-25 19:02:00 -05:00
453e20534f Temporarily disable pinning #2373
I'm swamped today and tomorrow so this will have to do for now
2020-01-15 11:19:32 -05:00
dc4df47842 Don't fetch/checkout packages that are up-to-date 2020-01-14 22:47:38 -05:00
f3a9d0c03c Resolve pinned packages based on overridden recipes
And rearrange "Checking out ..." message during 'doom upgrade' to
display package first, then commit (and abbreviated), rather than the
other around. It's easier to read.
2020-01-14 21:57:58 -05:00
b8b0f73edc Resolve packages to repo for pinned packages
- Allow :pin SHA's to be abbreviated.
- Print out the repo being updated, rather than the package.
2020-01-14 21:18:59 -05:00
0c9f1b1a9c Minor refactors & comment revision 2020-01-11 17:27:04 -05:00
f6852a2c9f Add --discard switch to 'doom upgrade' #2224
Also rewrites straight prompt-in-batch-Emacs hack, and move it to
core-cli.el.
2020-01-09 03:36:00 -05:00
b7dc9c644e Don't use find if find can't be found 2020-01-08 22:09:42 -05:00
f78f71a74c Minor refactors & comment revision 2020-01-01 23:52:02 -05:00
7a348f8784 Refactor how we indent straight's progress output
More work up front, less work in the trenches.
2020-01-01 19:34:30 -05:00
4f676bd218 Refactor autoload generator bootstrappers 2020-01-01 13:31:40 -05:00
a4653f475b Print filename instead of absolute paths for purged ELPA packages 2019-12-30 17:28:31 -05:00
908bd4b945 Remove FORCE-P argument for doom-cli-reload-autoloads
We weren't using them anyway.
2019-12-30 06:44:16 -05:00
f8ff50565e Refactor autoload generator
- Halves LOC
- Adopts functional paradigm where possible.
- Reduces the filesize of autoloads files by ~10-20%
- Speeds up autoloads generation by ~20%
2019-12-29 22:20:48 -05:00
8d3954257e Refactor 'doom purge' & fix elpa purging
Wasn't picking up ELPA packages.
2019-12-28 14:02:07 -05:00
6396cbf6cd Refactor 'doom build' 2019-12-28 14:01:36 -05:00
2f540f8c45 Remove vestigial references to doom--finalize-straight 2019-12-27 03:30:03 -05:00
550c9bda74 cli/packages: implement commit pinning support
This is step 2 toward version pinning and rollback.

Next step is to actually pin packages.

Step 1 was 125561eb0
2019-12-25 14:02:43 -05:00
8dd647b9bd Make 'doom update' Skip local packages
i.e. packages with a user-specified :local-repo
2019-12-14 20:50:16 -05:00
886fa36ac8 Improve 'doom purge' progress output 2019-11-25 02:18:01 -05:00
d37ebee2f8 Print progress to same line on 'doom update'
Experimental.
2019-11-24 16:50:46 -05:00
4351474bf3 Add "X updated" notice after package is updated
To make it clearer what package was just updated after spewing a lot of
git log output.
2019-11-22 16:15:06 -05:00
3896b994b5 Remove double-negative filesize from 'doom purge' 2019-11-08 17:30:21 -05:00
873fc5c0db 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-08 16:02:06 -05:00
45240699e0 Remove doom-elpa-dir variable
And just use package-user-dir. No need for two variable when one will
do.
2019-09-26 14:26:47 -04:00
f03eb67314 Fix 'doom rebuild' generating broken autoloads
Causes errors about being unable to find general.el
2019-09-20 01:23:58 -04:00
18329fdeaf Add switch docs in update & purge commands 2019-09-12 17:25:54 -04:00