Doom CLI fails with "(file-missing "Cannot open load file" "No such file or directory" "pkg-info")"

What happened?

doom cli commands such as up, sync, install, --help, etc. fails while unable to find pkg-info

What did you expect to happen?

Those commands should run without the error.

Steps to reproduce

  1. doom --force up from c44bc81a05f3758ceaa28921dd9c830b9c571e61 to 4efdf51ca56820696bf8b237c3725d5fb1eeb229
  2. (doom-cli--straight-recommended-option-p "In repository \"consult-dash\", remote \"origin\" has URL\n \"\"\nbut recipe specifies a UR... (the log file was gone). I deleted ~/.config/emacs/.local/straight/repos/consult-dash.
  3. doom up again => Message: Error with packages Details: ("debbugs" (file-missing "Cannot open load file" "No such file or directory" "pkg-info"))

System information

Loading data dump...

Other info

I have deleted pkg-info's repos and build-29.0.50 directory, but doom sync/install can’t install it again.

Sometimes it’s another package to be reported with the file-missing error such as org-ref.

Workaround (this works for me for unknown reasons):

  • Manually add pkg-info to $DOOMDIR/packages.el
  • doom sync
  • Optionally remove the added line from packages.el and doom sync/up

Please produce a backtrace from the error, as I cannot reproduce it.

Side-note: I highly recommend not using Emacs 29, and downgrading to 28, as 29 is in a very unstable period – which is why Doom does not officially support it yet.

As a comment on emacs 29 - or if you really want it (presumably for pgtk), stick to a commit that seems to work and don’t change it.

1 Like

My .error & .log files (couldn’t upload in this comment because the error file is 703K) cli.doom.220907113750.40645.error.el · GitHub.

to reproduce, I did a doom install, then enabled notmuch mail reader and a doom sync.

> Synchronizing "default" profile...
  > Regenerating envvars file
    ✓ Generated ~/.config/emacs/.local/env
  > Installing packages...
    > Updating recipe repos...
    > Cloning consult-notmuch...csmirror-mirror...
    - Checked out consult-notmuch: 4138855cddee0ef126cff6a5fc5ca9c49fd2682d
    > Building consult-notmuch...
    - Checked out compat: cc1924fd8b3f9b75b26bf93f084ea938c06f9615
    > Building consult-notmuch > Building compat...
    x There was an unexpected runtime error
      Message: Error with packages
      Details: ("consult-notmuch" (file-missing "Cannot open load file" "No such file or directory" "dash"))
        (signal doom-package-error ("consult-notmuch" (file-missing "Cannot open load file" "No such file or directory" "dash")))
        (condition-case e (let ((straight-use-package-pre-build-functions (cons #'(lambda (pkg &rest _) (let* ((commit (and t (cdr (assoc pkg pinned))))) (if commit (doo...
        (progn (if (file-directory-p (straight--repos-dir local-repo)) nil (doom-packages--cli-recipes-update)) (condition-case e (let ((straight-use-package-pre-build-f...
        (let* ((--cl-rest-- (append (list :recipe recipe) recipe)) (recipe (car (cdr (plist-member --cl-rest-- ':recipe)))) (package (car (cdr (plist-member --cl-rest-- ...
        (cl-destructuring-bind (&key recipe package type local-repo &allow-other-keys) (append (list :recipe recipe) recipe) (if (file-directory-p (straight--repos-dir l...
        (straight--with-plist (append (list :recipe recipe) recipe) (recipe package type local-repo) (if (file-directory-p (straight--repos-dir local-repo)) nil (doom-pa...
        (let ((recipe (car --dolist-tail--))) (straight--with-plist (append (list :recipe recipe) recipe) (recipe package type local-repo) (if (file-directory-p (straigh...
        (while --dolist-tail-- (let ((recipe (car --dolist-tail--))) (straight--with-plist (append (list :recipe recipe) recipe) (recipe package type local-repo) (if (fi...
        (let ((--dolist-tail-- recipes)) (while --dolist-tail-- (let ((recipe (car --dolist-tail--))) (straight--with-plist (append (list :recipe recipe) recipe) (recipe...
        (let* ((recipes (doom-package-recipe-list)) (built nil) (straight-use-package-pre-build-functions (cons #'(lambda (pkg &rest _) (setq built (if (member pkg built...
        (and t (let* ((recipes (doom-package-recipe-list)) (built nil) (straight-use-package-pre-build-functions (cons #'(lambda (pkg &rest _) (setq built (if (member pk...
        (let* ((built (and t (let* ((recipes (doom-package-recipe-list)) (built nil) (straight-use-package-pre-build-functions (cons #'(lambda (pkg &rest _) (setq built ...
      ! Wrote extended backtrace to ~/.config/emacs/.local/logs/cli.doom.220907081242.3911280.error
    ! Script was abruptly aborted, leaving Doom in an incomplete state!
    - Run 'doom sync' to repair it.

Can you try putting (package! dash) in packages.el (maybe after rm -rf ~/.config/emacs/.local/straight/*/dash) and running doom sync again?

The only thing that works is if I rm -rf straight. do a doom sync. then it all works. running a doom sync after that gives errors on dash or f being missing.

1 Like

It looks like an issue with some transitive dependencies. This is what I did: for every single error message, I added the package name to packages.el. For me, the first one was about dash.el, so I’ve added (package! dash), then I ran doom sync again, this time it complained about f, I’ve added (package! f), repeated, and so on.


I’m also on emacs 29 and seeing this on the latest doom. Going back to doom commit c44bc81a05f3758ceaa28921dd9c830b9c571e61 makes things work again.

I have not done bi-secting, so it’s entirely sure that things are still working with some of the later commits, but this one is definitely OK.

Edit: of course it doesn’t do much to help troubleshoot the breakage in the recent changes, but at least it confirms that it’s due to a recent doom change.

By adding the following to my packages.el I was ok.

(package! f)
(package! dash)
(package! pkg-info)
(package! epl)

As it turns out, this issue has to do with a breaking change to loaddefs upstream, in Emacs 29, and the fact that straight.el uses it if it is available. I’ve monkey patched the problem in:

So update Doom and the issue should be resolved.

That said, you may need to update Doom manually to get past this error, so here is how to do so:

$ cd ~/.emacs.d
$ git pull
$ doom sync -u
1 Like

I think that may be only a partial solution to the loaddefs issue:

Sep 11 21:48:28 midge emacs/todo[203589]: WARNING: No org-loaddefs.el file could be found from where org.el is loaded.
Sep 11 21:48:31 midge emacs/todo[203589]: You need to run "make" or "make autoloads" from Org lisp directory
Sep 11 21:48:36 midge emacs/todo[203589]: Starting Emacs daemon.
Sep 11 21:48:36 midge systemd[3536]: Started Emacs - todo.
Sep 11 21:48:37 midge emacs/todo[203589]: Doom loaded 352 packages across 69 modules in 13.591s
Sep 11 21:48:44 midge emacs/todo[203589]: error in process sentinel: Symbol’s function definition is void: org-element--cache-active-p

Emacs will keep spamming the last line.

I’d like to point out that on latest master (emacs 29 and doom), there is still an issue with org and loaddefs:

❯ doom sync              
> Synchronizing "default" profile...
  > Installing packages...          
    - Checked out org: 00adad9357b9123a7b11ecf12c148a5196debcb7
    > Building org...                 
    ✓ Installed 1 packages                         
  > (Re)building packages...                                                                             
    - No packages need rebuilding
  > Purging orphaned packages (for the emperor)...
    - No builds to purge    
    - Skipping elpa packages
    - Skipping repos                                                                                     
    - Skipping regrafting            
    - Skipping native bytecode
  > (Re)building profile in /home/peter/.cache/doom/etc/@/...
    > Deleting old init files...
    > Generating 4 init files...
      Package autoload is deprecated
    > Byte-compiling ~/.cache/doom/etc/@init.29.el...
      WARNING: No org-loaddefs.el file could be found from where org.el is loaded.
      You need to run "make" or "make autoloads" from Org lisp directory
    ✓ Built init.29.elc 
  - Restart Emacs or use 'M-x doom/reload' for changes to take effect
✓ Finished in 21.47991s

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.