I'm using emacs 27.2 and magit version 20231109.935. When I'm inside a directory and try to run magit-status or magit-init I get the error message in the title: cl--generic-build-combined-method: Cyclic definition: %S: loadhist-unload-element. What is causing this error and how do I resolve it?

I get the following debug message when I put debug-on-entry on loadhist-unload-element:

Debugger entered--entering a function:
* loadhist-unload-element((defun . seq-doseq))
  mapc(loadhist-unload-element ((defun . seq-doseq) (defun . seq--pcase-macroexpander) (define-symbol-props (pcase-macroexpander seq) (edebug-form-spec seq--pcase-macroexpander)) (defun . seq-let) (defun . seq-elt) (cl-defmethod seq-elt nil t t) (defun . \(setf\ seq-elt\)) (cl-defmethod \(setf\ seq-elt\) nil t array t) (cl-defmethod \(setf\ seq-elt\) nil t cons t) (defun . seq-length) (cl-defmethod seq-length nil t) (defun . seq-first) (defun . seq-rest) (defun . seq-do) (cl-defmethod seq-do nil t t) (defun . seq-each) (defun . seq-do-indexed) (defun . seqp) (cl-defmethod seqp nil t) (defun . seq-copy) (cl-defmethod seq-copy nil t) (defun . seq-subseq) (cl-defmethod seq-subseq nil t t) (defun . seq-map) (cl-defmethod seq-map nil t t) (defun . seq-map-indexed) (cl-defmethod seq-map nil t sequence) (defun . seq-mapn) (cl-defmethod seq-mapn nil t t) (defun . seq-drop) (cl-defmethod seq-drop nil t t) (t . seq-take) (defun . seq-take) (cl-defmethod seq-take nil t t) (defun . seq-drop-while) (cl-defmethod seq-drop-while nil t t) (defun . seq-take-while) (cl-defmethod seq-take-while nil t t) (defun . seq-empty-p) (cl-defmethod seq-empty-p nil t) (defun . seq-sort) (cl-defmethod seq-sort nil t t) (cl-defmethod seq-sort nil t list) (t . seq-sort-by) (defun . seq-sort-by) (defun . seq-reverse) (cl-defmethod seq-reverse nil t) (cl-defmethod seq-reverse nil sequence) (t . seq-concatenate) (defun . seq-concatenate) ...))
  unload-feature(seq force)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307!\203%\0\310\311!\204%\0\312\307\313\"\210\300\307!\210\300\314!\210\300\315!\210\316..." [require cl-lib compat dash eieio subr-x featurep seq fboundp seq-keep unload-feature force crm magit-section custom-declare-variable magit-completing-read-function funcall function #f(compiled-function () #<bytecode 0x1ff80f05b339>) "Function to be called when requesting input from t..." :group magit-essentials :type (radio (function-item magit-builtin-completing-read) (function-item magit-ido-completing-read) (function-item ivy-completing-read) (function-item helm--completing-read-default) (function :tag "Other function")) magit-dwim-selection #f(compiled-function () #<bytecode 0x1ff80f05b345>) "When not to offer alternatives and ask for confirm..." :package-version (magit . "2.12.0") magit-commands (repeat (list (symbol :tag "Command") (choice (const :tag "for all prompts" nil) (regexp :tag "for prompts matching regexp")) (choice (const :tag "offer other choices" nil) (const :tag "require confirmation" ask) (const :tag "use default without confirmation" t))))] 10)
  byte-code("\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306!\210\301\307!\210\301\310!\210\10\204=\0\311 \203=\0\31210\0\301\313!0\202<\0\314\20..." [magit-inhibit-libgit require magit-base magit-git magit-mode magit-margin magit-process magit-transient magit-autorevert magit--libgit-available-p (error) magit-libgit error message "Error while loading `magit-libgit': %S" "That is not fatal.  The `libegit2' module just won..." custom-declare-group magit nil "Controlling Git from Emacs." :link (url-link "https://magit.vc") (info-link "(magit)FAQ") (info-link "(magit)") :group tools magit-essentials "Options that every Magit user should briefly think..." (info-link "(magit)Essential Settings") magit-miscellaneous "Miscellaneous Magit options." magit-commands "Options controlling behavior of certain commands." magit-modes "Modes used or provided by Magit." magit-buffers "Options concerning Magit buffers." (info-link "(magit)Modes and Buffers") magit-refresh "Options controlling how Magit buffers are refreshe..." (info-link "(magit)Automatic Refreshing of Magit Buffers") magit-faces "Faces used by Magit." faces custom-add-to-group diff-refine-added custom-face diff-refine-removed magit-extensions "Extensions to Magit." ...] 18)
  eval-buffer(#<buffer  *load*-461736> nil "/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." nil t)  ; Reading at buffer position 2446
  load-with-code-conversion("/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." "/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." nil t)
  eval-buffer(#<buffer  *load*> nil "/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." nil t)  ; Reading at buffer position 992
  load-with-code-conversion("/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." "/Users/aberk/.emacs.d/elpa/magit-20231109.935/magi..." nil t)
  autoload-do-load((autoload "magit-status" "Show the status of the current Git repository in a..." t nil) magit-status)

Update: I think this error is caused by transient.el, a dependency of magit. Trying to update magit gave me the error

Compiling file ~/.emacs.d/elpa/transient-20231112.923/transient.el at Thu Nov 16 19:18:53 2023
Entering directory ‘~/.emacs.d/elpa/transient-20231112.923/’
transient.el:61:1:Error: Cyclic definition: %S: loadhist-unload-element

This error still has not been resolved. Could it be a backward compatibility issue with Emacs 27.2? Could it be something wrong with transient?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.