radian-software / straight.el

🍀 Next-generation, purely functional package manager for the Emacs hacker.
MIT License
2.71k stars 150 forks source link

`straight-thaw-versions` causes `(wrong-type-argument sequencep consp)` #999

Open CyberShadow opened 2 years ago

CyberShadow commented 2 years ago

What's wrong

When I run straight-thaw-versions, it fails with:

Debugger entered--Lisp error: (wrong-type-argument sequencep consp)                                                                                                                                                                                                           
  straight--process-log(("git" ("rev-parse" "-q" "--verify" "9969207f60b69e42c573a63764faeb9caaccb2bf^{commit}") (wrong-type-argument consp nil) "/home/vladimir/.emacs.d/straight/repos/yaml-mode/") t)                                                                      
  straight--process-run("git" "rev-parse" "-q" "--verify" "9969207f60b69e42c573a63764faeb9caaccb2bf^{commit}")                                                                                                                                                                
  straight--process-run-p("git" "rev-parse" "-q" "--verify" "9969207f60b69e42c573a63764faeb9caaccb2bf^{commit}")                                                                                                                                                              
  straight-vc-git-commit-present-p("yaml-mode" "9969207f60b69e42c573a63764faeb9caaccb2bf")                                                                                                                                                                                    
  apply(straight-vc-git-commit-present-p ("yaml-mode" "9969207f60b69e42c573a63764faeb9caaccb2bf"))                                                                                                                                                                            
  straight-vc(commit-present-p git "yaml-mode" "9969207f60b69e42c573a63764faeb9caaccb2bf")                                                                                                                                                                                    
  straight-vc-commit-present-p((:type git :flavor melpa :host github :repo "yoshiki/yaml-mode" :package "yaml-mode" :local-repo "yaml-mode") "9969207f60b69e42c573a63764faeb9caaccb2bf")                                                                                      
  #f(compiled-function (package) #<bytecode 0x4170fe0345a021>)("yaml-mode")                                                                                                                                                                                                   
  straight--map-repos-interactively(#f(compiled-function (package) #<bytecode 0x4170fe0345a021>))                                                                                                                                                                             
  straight-thaw-versions()                                                                                                                                                                                                                                                    
  funcall-interactively(straight-thaw-versions)                                                                                                                                                                                                                               
  command-execute(straight-thaw-versions record)                                                                                                                                                                                                                              
  helm-M-x-execute-command(straight-thaw-versions)                                                                                                                                                                                                                            
  helm-execute-selection-action-1()                                                                                                                                                                                                                                           
  helm-execute-selection-action()                                                                                                                                                                                                                                             
  helm-internal((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x558fef8c388699d>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm$
  helm((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x558fef8c388699d>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-univ$
  helm(:sources (((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x558fef8c388699d>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm$
  helm-M-x-read-extended-command([## lsp-make-signature-help-options AND lsp:omnisharp-run-tests-in-class-request-column tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions projectile-get-project-directories lsp-watch-kind\? backquote-lis$
  helm-M-x(nil)                                                                                                                                                                                                                                                               
  funcall-interactively(helm-M-x nil)                                                                                                                                                                                                                                         
  command-execute(helm-M-x)                                                                                                                                                                                                                                                   

Directions to reproduce

I don't know how to get into the state that causes this bug to manifest, but I hope that the above stack trace will help.

Looking at the code, it looks like straight--process-call fails and returns an error object, but but that is then used in straight--process-with-result which is unprepared to deal with such values.

Version information

CyberShadow commented 2 years ago

OK, I found that (wrong-type-argument consp nil) is caused by something unrelated to straight.el (related to undo-tree which advises killing buffers). However, the (wrong-type-argument sequencep consp) error looks like a genuine bug in straight's error handling.