Doom-emacs: [BUG] doom upgrade fails

Created on 9 Nov 2019  ยท  4Comments  ยท  Source: hlissner/doom-emacs

doom upgrade fails on macos with the latest changes.

โฏ ~/.emacs.d/bin/doom -d upgrade
DOOM Initializing package.el
DOOM Initializing straight
DOOM Initializing doom-packages
DOOM Ignoring built-in package so-long
DOOM [emacs/vc] Ignoring built-in package vc
DOOM [emacs/vc] Ignoring built-in package vc-annotate
DOOM [emacs/vc] Ignoring built-in package smerge-mode
DOOM [lang/emacs-lisp] Ignoring built-in package elisp-mode
DOOM [lang/web] Ignoring built-in package css-mode
DOOM [lang/web] Ignoring built-in package less-css-mode
> Preparing to upgrade Doom Emacs and its packages...

Debugger entered--Lisp error: (void-function doom-sh)
  (doom-sh "git" "status" "--porcelain" "-uno")
  (let* ((stdout (doom-sh "git" "status" "--porcelain" "-uno")) (success (if stdout (car-safe (prog1 stdout (setq stdout (cdr stdout)))) (signal (quote wrong-number-of-arguments) (list nil (length stdout)))))) (if (= 0 success) (string-match-p "[^ \011\n]" (buffer-string)) (error "Failed to check working tree in %s" dir)))
  doom--working-tree-dirty-p("/Users/tim/.emacs.d/")
  (if (doom--working-tree-dirty-p default-directory) (progn (if (not force-p) (user-error (doom--format (format "%s\n\n%s" (format "Refusing to upgrade because %S has been modified." (doom--format-class ... doom-emacs-dir)) "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes."))) (doom--format-print (doom--format (format (doom--format-class (quote info) "You have local modifications in Doom's source. Discarding them...")))) (doom-sh "git" "reset" "--hard" (format "origin/%s" branch)) (doom-sh "git" "clean" "-ffd"))))
  (let* ((branch (vc-git--symbolic-ref doom-emacs-dir)) (target-remote (format "%s/%s" doom-repo-remote branch))) (if branch nil (progn (if inhibit-message nil (doom--format-print (doom--format (format (doom--format-class ... ...))))) (setq doom-errors (cons (doom--format (format (doom--format-class ... ...))) doom-errors)))) (if (doom--working-tree-dirty-p default-directory) (progn (if (not force-p) (user-error (doom--format (format "%s\n\n%s" (format "Refusing to upgrade because %S has been modified." ...) "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes."))) (doom--format-print (doom--format (format (doom--format-class ... "You have local modifications in Doom's source. Discarding them...")))) (doom-sh "git" "reset" "--hard" (format "origin/%s" branch)) (doom-sh "git" "clean" "-ffd")))) (doom-sh "git" "remote" "remove" doom-repo-remote) (unwind-protect (progn (or (= 0 (car (doom-sh "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (doom-sh "git" "fetch" "--tags" doom-repo-remote branch))) (error "Failed to fetch from upstream")) (let ((this-rev (vc-git--rev-parse "HEAD")) (new-rev (vc-git--rev-parse target-remote))) (cond ((and (null this-rev) (null new-rev)) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--format-print (doom--format ...)) t) ((doom--format-print (doom--format ...)) (if (and ... ...) (progn ... ...)) (if (not ...) (ignore ...) (doom--format-print ...) (let ... ... ... ...) (doom-cli-execute "refresh" ...) (doom-cli-execute "update" ...) t) (doom--format-print (doom--format ...)))))) (condition-case nil (progn (doom-sh "git" "remote" "remove" doom-repo-remote)) (error nil))))
  (let ((default-directory doom-emacs-dir) process-file-side-effects) (doom--format-print (doom--format (format (doom--format-class (quote start) "Preparing to upgrade Doom Emacs and its packages...")))) (let* ((branch (vc-git--symbolic-ref doom-emacs-dir)) (target-remote (format "%s/%s" doom-repo-remote branch))) (if branch nil (progn (if inhibit-message nil (doom--format-print (doom--format (format ...)))) (setq doom-errors (cons (doom--format (format ...)) doom-errors)))) (if (doom--working-tree-dirty-p default-directory) (progn (if (not force-p) (user-error (doom--format (format "%s\n\n%s" ... "Either stash/undo your changes or run 'doom upgrade -f' to discard local changes."))) (doom--format-print (doom--format (format ...))) (doom-sh "git" "reset" "--hard" (format "origin/%s" branch)) (doom-sh "git" "clean" "-ffd")))) (doom-sh "git" "remote" "remove" doom-repo-remote) (unwind-protect (progn (or (= 0 (car (doom-sh "git" "remote" "add" doom-repo-remote doom-repo-url))) (error "Failed to add %s to remotes" doom-repo-remote)) (or (= 0 (car (doom-sh "git" "fetch" "--tags" doom-repo-remote branch))) (error "Failed to fetch from upstream")) (let ((this-rev (vc-git--rev-parse "HEAD")) (new-rev (vc-git--rev-parse target-remote))) (cond ((and ... ...) (error "Failed to get revisions for %s" target-remote)) ((equal this-rev new-rev) (doom--format-print ...) t) ((doom--format-print ...) (if ... ...) (if ... ... ... ... ... ... t) (doom--format-print ...))))) (condition-case nil (progn (doom-sh "git" "remote" "remove" doom-repo-remote)) (error nil)))))
  doom-cli-upgrade(nil nil)
  (and (doom-cli-upgrade doom-auto-accept force-p) (doom-cli-packages-update) (doom-cli-reload-package-autoloads (quote force-p)))
  (let ((force-p (cdr (assq (quote force-p) --alist--))) (args (cdr (assq (quote args) --alist--)))) (if doom-init-p nil (doom-initialize (quote force)) (doom-initialize-modules)) (and (doom-cli-upgrade doom-auto-accept force-p) (doom-cli-packages-update) (doom-cli-reload-package-autoloads (quote force-p))))
  (closure ((plist :group "Maintenance") (aliases up) (name . upgrade) t) (--alist--) (let ((force-p (cdr (assq (quote force-p) --alist--))) (args (cdr (assq (quote args) --alist--)))) (if doom-init-p nil (doom-initialize (quote force)) (doom-initialize-modules)) (and (doom-cli-upgrade doom-auto-accept force-p) (doom-cli-packages-update) (doom-cli-reload-package-autoloads (quote force-p)))))(nil)
  funcall((closure ((plist :group "Maintenance") (aliases up) (name . upgrade) t) (--alist--) (let ((force-p (cdr (assq (quote force-p) --alist--))) (args (cdr (assq (quote args) --alist--)))) (if doom-init-p nil (doom-initialize (quote force)) (doom-initialize-modules)) (and (doom-cli-upgrade doom-auto-accept force-p) (doom-cli-packages-update) (doom-cli-reload-package-autoloads (quote force-p))))) nil)
  (if cli (funcall (progn (or (and (memq (type-of cli) cl-struct-doom-cli-tags) t) (signal (quote wrong-type-argument) (list (quote doom-cli) cli))) (aref cli 7)) (doom--cli-process cli args)) (user-error "Couldn't find any %S command" command))
  (let* ((cli (and t (doom-cli-get command)))) (if cli (funcall (progn (or (and (memq (type-of cli) cl-struct-doom-cli-tags) t) (signal (quote wrong-type-argument) (list (quote doom-cli) cli))) (aref cli 7)) (doom--cli-process cli args)) (user-error "Couldn't find any %S command" command)))
  doom-cli-execute("upgrade" nil)
  (and (doom-cli-execute command args) (terpri) (print! (success "Finished! (%.4fs)") (float-time (time-subtract (current-time) start-time))))
  (let ((start-time (current-time))) (and (doom-cli-execute command args) (terpri) (print! (success "Finished! (%.4fs)") (float-time (time-subtract (current-time) start-time)))))
  (condition-case e (let ((start-time (current-time))) (and (doom-cli-execute command args) (terpri) (print! (success "Finished! (%.4fs)") (float-time (time-subtract (current-time) start-time))))) (user-error (print! (error "%s\n") (error-message-string e)) (print! (yellow "See 'doom help %s' for documentation on this command.") (car args))) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" (get (car e) (quote error-message)) (car e)) (let ((--dolist-tail-- (cdr e)) item) (while --dolist-tail-- (setq item (car --dolist-tail--)) (message "  %s" item) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if debug-on-error nil (message (concat "\nRun the command again with the -d (or --debug) option to enable debug\n" "mode and, hopefully, generate a stack trace. If you decide to file a bug\n" "report, please include it!\n\n" "Emacs outputs to standard error, so you'll need to redirect stderr to\n" "stdout to pipe this to a file or clipboard!\n\n" "  e.g. doom -d install 2>&1 | clipboard-program\n")) (signal (quote doom-error) e))))
  (cond ((not noninteractive) (print! "Doom launched out of %s (test mode)" (path user-emacs-directory)) (load! "init.el" user-emacs-directory) (doom-run-all-startup-hooks-h)) ((null command) (doom-cli-execute "help")) ((condition-case e (let ((start-time (current-time))) (and (doom-cli-execute command args) (terpri) (print! (success "Finished! (%.4fs)") (float-time (time-subtract ... start-time))))) (user-error (print! (error "%s\n") (error-message-string e)) (print! (yellow "See 'doom help %s' for documentation on this command.") (car args))) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" (get (car e) (quote error-message)) (car e)) (let ((--dolist-tail-- (cdr e)) item) (while --dolist-tail-- (setq item (car --dolist-tail--)) (message "  %s" item) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if debug-on-error nil (message (concat "\nRun the command again with the -d (or --debug) option to enable debug\n" "mode and, hopefully, generate a stack trace. If you decide to file a bug\n" "report, please include it!\n\n" "Emacs outputs to standard error, so you'll need to redirect stderr to\n" "stdout to pipe this to a file or clipboard!\n\n" "  e.g. doom -d install 2>&1 | clipboard-program\n")) (signal (quote doom-error) e))))))
  (let ((help-p (cdr (assq (quote help-p) --alist--))) (debug-p (cdr (assq (quote debug-p) --alist--))) (yes-p (cdr (assq (quote yes-p) --alist--))) (emacsdir (cdr (assq (quote emacsdir) --alist--))) (doomdir (cdr (assq (quote doomdir) --alist--))) (localdir (cdr (assq (quote localdir) --alist--))) (command (cdr (assq (quote command) --alist--))) (args (cdr (assq (quote args) --alist--)))) :bare t (if emacsdir (progn (setq user-emacs-directory (file-name-as-directory emacsdir)) (print! (info "EMACSDIR=%s") localdir))) (if doomdir (progn (setenv "DOOMDIR" doomdir) (print! (info "DOOMDIR=%s") localdir))) (if localdir (progn (setenv "DOOMLOCALDIR" localdir) (print! (info "DOOMLOCALDIR=%s") localdir))) (if debug-p (progn (setenv "DEBUG" "1") (setq doom-debug-mode t) (print! (info "Debug mode on")))) (if yes-p (progn (setenv "YES" "1") (setq doom-auto-accept t) (print! (info "Auto-yes on")))) (if help-p (progn (setq args (cons command args)) (setq command "help"))) (if (or emacsdir doomdir localdir) (progn (load! "core/core.el" user-emacs-directory))) (cond ((not noninteractive) (print! "Doom launched out of %s (test mode)" (path user-emacs-directory)) (load! "init.el" user-emacs-directory) (doom-run-all-startup-hooks-h)) ((null command) (doom-cli-execute "help")) ((condition-case e (let ((start-time (current-time))) (and (doom-cli-execute command args) (terpri) (print! (success "Finished! (%.4fs)") (float-time ...)))) (user-error (print! (error "%s\n") (error-message-string e)) (print! (yellow "See 'doom help %s' for documentation on this command.") (car args))) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" (get (car e) (quote error-message)) (car e)) (let ((--dolist-tail-- ...) item) (while --dolist-tail-- (setq item ...) (message "  %s" item) (setq --dolist-tail-- ...))) (if debug-on-error nil (message (concat "\nRun the command again with the -d (or --debug) option to enable debug\n" "mode and, hopefully, generate a stack trace. If you decide to file a bug\n" "report, please include it!\n\n" "Emacs outputs to standard error, so you'll need to redirect stderr to\n" "stdout to pipe this to a file or clipboard!\n\n" "  e.g. doom -d install 2>&1 | clipboard-program\n")) (signal (quote doom-error) e)))))))
  (lambda (--alist--) (let ((help-p (cdr (assq (quote help-p) --alist--))) (debug-p (cdr (assq (quote debug-p) --alist--))) (yes-p (cdr (assq (quote yes-p) --alist--))) (emacsdir (cdr (assq (quote emacsdir) --alist--))) (doomdir (cdr (assq (quote doomdir) --alist--))) (localdir (cdr (assq (quote localdir) --alist--))) (command (cdr (assq (quote command) --alist--))) (args (cdr (assq (quote args) --alist--)))) :bare t (if emacsdir (progn (setq user-emacs-directory (file-name-as-directory emacsdir)) (print! (info "EMACSDIR=%s") localdir))) (if doomdir (progn (setenv "DOOMDIR" doomdir) (print! (info "DOOMDIR=%s") localdir))) (if localdir (progn (setenv "DOOMLOCALDIR" localdir) (print! (info "DOOMLOCALDIR=%s") localdir))) (if debug-p (progn (setenv "DEBUG" "1") (setq doom-debug-mode t) (print! (info "Debug mode on")))) (if yes-p (progn (setenv "YES" "1") (setq doom-auto-accept t) (print! (info "Auto-yes on")))) (if help-p (progn (setq args (cons command args)) (setq command "help"))) (if (or emacsdir doomdir localdir) (progn (load! "core/core.el" user-emacs-directory))) (cond ((not noninteractive) (print! "Doom launched out of %s (test mode)" (path user-emacs-directory)) (load! "init.el" user-emacs-directory) (doom-run-all-startup-hooks-h)) ((null command) (doom-cli-execute "help")) ((condition-case e (let ((start-time ...)) (and (doom-cli-execute command args) (terpri) (print! ... ...))) (user-error (print! (error "%s\n") (error-message-string e)) (print! (yellow "See 'doom help %s' for documentation on this command.") (car args))) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" (get ... ...) (car e)) (let (... item) (while --dolist-tail-- ... ... ...)) (if debug-on-error nil (message ...) (signal ... e))))))))(((command . "upgrade")))
  funcall((lambda (--alist--) (let ((help-p (cdr (assq (quote help-p) --alist--))) (debug-p (cdr (assq (quote debug-p) --alist--))) (yes-p (cdr (assq (quote yes-p) --alist--))) (emacsdir (cdr (assq (quote emacsdir) --alist--))) (doomdir (cdr (assq (quote doomdir) --alist--))) (localdir (cdr (assq (quote localdir) --alist--))) (command (cdr (assq (quote command) --alist--))) (args (cdr (assq (quote args) --alist--)))) :bare t (if emacsdir (progn (setq user-emacs-directory (file-name-as-directory emacsdir)) (print! (info "EMACSDIR=%s") localdir))) (if doomdir (progn (setenv "DOOMDIR" doomdir) (print! (info "DOOMDIR=%s") localdir))) (if localdir (progn (setenv "DOOMLOCALDIR" localdir) (print! (info "DOOMLOCALDIR=%s") localdir))) (if debug-p (progn (setenv "DEBUG" "1") (setq doom-debug-mode t) (print! (info "Debug mode on")))) (if yes-p (progn (setenv "YES" "1") (setq doom-auto-accept t) (print! (info "Auto-yes on")))) (if help-p (progn (setq args (cons command args)) (setq command "help"))) (if (or emacsdir doomdir localdir) (progn (load! "core/core.el" user-emacs-directory))) (cond ((not noninteractive) (print! "Doom launched out of %s (test mode)" (path user-emacs-directory)) (load! "init.el" user-emacs-directory) (doom-run-all-startup-hooks-h)) ((null command) (doom-cli-execute "help")) ((condition-case e (let (...) (and ... ... ...)) (user-error (print! ... ...) (print! ... ...)) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" ... ...) (let ... ...) (if debug-on-error nil ... ...))))))) ((command . "upgrade")))
  (if cli (funcall (progn (or (and (memq (type-of cli) cl-struct-doom-cli-tags) t) (signal (quote wrong-type-argument) (list (quote doom-cli) cli))) (aref cli 7)) (doom--cli-process cli args)) (user-error "Couldn't find any %S command" command))
  (let* ((cli (and t (doom-cli-get command)))) (if cli (funcall (progn (or (and (memq (type-of cli) cl-struct-doom-cli-tags) t) (signal (quote wrong-type-argument) (list (quote doom-cli) cli))) (aref cli 7)) (doom--cli-process cli args)) (user-error "Couldn't find any %S command" command)))
  doom-cli-execute(:main ("upgrade"))
  (let* ((loaddir (file-name-directory (file-truename load-file-name))) (emacsdir (getenv "EMACSDIR")) (user-emacs-directory (or emacsdir (expand-file-name "../" loaddir))) (load-prefer-newer t)) (setq load-path (cons (expand-file-name "core" user-emacs-directory) load-path)) (require (quote core)) (require (quote core-cli)) (defcli! :main ((help-p ["-h" "--help"] "Same as help command") (debug-p ["-d" "--debug"] "Turns on doom-debug-mode (and debug-on-error)") (yes-p ["-y" "--yes"] "Auto-accept all confirmation prompts") (emacsdir ["--emacsdir" dir] "Use the emacs config at DIR (e.g. ~/.emacs.d)") (doomdir ["--doomdir" dir] "Use the private module at DIR (e.g. ~/.doom.d)") (localdir ["--localdir" dir] "Use DIR as your local storage directory") &optional command &rest args) "A command line interface for managing Doom Emacs.\n\nIncludes package management, diagnostics, unit tests, and byte-compilation.\n\nThis tool also makes it trivial to launch Emacs out of a different folder or\nwith a different private module." :bare t (if emacsdir (progn (setq user-emacs-directory (file-name-as-directory emacsdir)) (print! (info "EMACSDIR=%s") localdir))) (if doomdir (progn (setenv "DOOMDIR" doomdir) (print! (info "DOOMDIR=%s") localdir))) (if localdir (progn (setenv "DOOMLOCALDIR" localdir) (print! (info "DOOMLOCALDIR=%s") localdir))) (if debug-p (progn (setenv "DEBUG" "1") (setq doom-debug-mode t) (print! (info "Debug mode on")))) (if yes-p (progn (setenv "YES" "1") (setq doom-auto-accept t) (print! (info "Auto-yes on")))) (if help-p (progn (setq args (cons command args)) (setq command "help"))) (if (or emacsdir doomdir localdir) (progn (load! "core/core.el" user-emacs-directory))) (cond ((not noninteractive) (print! "Doom launched out of %s (test mode)" (path user-emacs-directory)) (load! "init.el" user-emacs-directory) (doom-run-all-startup-hooks-h)) ((null command) (doom-cli-execute "help")) ((condition-case e (let ((start-time ...)) (and (doom-cli-execute command args) (terpri) (print! ... ...))) (user-error (print! (error "%s\n") (error-message-string e)) (print! (yellow "See 'doom help %s' for documentation on this command.") (car args))) ((debug error) (message "--------------------------------------------------\n") (message "There was an unexpected error:") (message "  %s (%s)" (get ... ...) (car e)) (let (... item) (while --dolist-tail-- ... ... ...)) (if debug-on-error nil (message ...) (signal ... e))))))) (doom-cli-execute :main (cdr (member "--" argv))) (setq argv nil))
  eval-buffer(#<buffer  *load*> nil "/Users/tim/.emacs.d/bin/doom" nil t)  ; Reading at buffer position 4393
  load-with-code-conversion("/Users/tim/.emacs.d/bin/doom" "/Users/tim/.emacs.d/bin/doom" nil t)
  load("/Users/tim/.emacs.d/bin/doom" nil t t)
  command-line-1(("-scriptload" "/Users/tim/.emacs.d/bin/doom" "--" "upgrade"))
  command-line()
  normal-top-level()

bug bidoom resolved

Most helpful comment

As of a55b5a4 this should be resolved. Let me know if that isn't the case and I'll reopen this issue. Thanks for bringing it to my attention!

All 4 comments

As of a55b5a4 this should be resolved. Let me know if that isn't the case and I'll reopen this issue. Thanks for bringing it to my attention!

Works for me again! :)

Had the same issue, can confirm it's working again after manually pulling changes. Thank you!

@ZacJoffe thanks for mentioning manually pulling -- I'm new to doom-emacs, and didn't know to try that :)

After manually pulling and running doom -d upgrade (I presume the -d is just extra output), things are working again :+1:

Was this page helpful?
0 / 5 - 0 ratings