magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.32k stars 117 forks source link

Can't load Forge in most recent Emacs (invalid-slot-name "#<magit--git-variable magit--git-variable-...) #561

Closed weipe closed 1 year ago

weipe commented 1 year ago

I am trying out Forge in the most recent Emacs (built from emacs git master).

When I load it, an error occurs.

Here are the versions:

This is how one can reproduce the errors:

  1. make sure the packages magit and forge have been installed (I assume magit is a prerequisite for forge)
  2. run emacs --batch -Q -u $USER --eval "(progn (setq debug-on-error 1)(require 'magit)(require 'forge))"

Stacktrace:

Debugger entered--Lisp error: (invalid-slot-name "#<magit--git-variable magit--git-variable-1588c0e8..." :default)
  signal(invalid-slot-name ("#<magit--git-variable magit--git-variable-1588c0e8..." :default))
  #f(compiled-function (object slot-name operation &optional new-value) #<bytecode 0x981adde9e0172a1>)(#<magit--git-variable magit--git-variable-1588c0e8c548> :default oset (closure (t) nil (number-to-string ghub-graphql-items-per-request)))
  apply(#f(compiled-function (object slot-name operation &optional new-value) #<bytecode 0x981adde9e0172a1>) #<magit--git-variable magit--git-variable-1588c0e8c548> (:default oset (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  slot-missing(#<magit--git-variable magit--git-variable-1588c0e8c548> :default oset (closure (t) nil (number-to-string ghub-graphql-items-per-request)))
  #f(compiled-function (obj slots) "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine." #<bytecode 0x1b26b67c9ea63bbf>)(#<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  apply(#f(compiled-function (obj slots) "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine." #<bytecode 0x1b26b67c9ea63bbf>) #<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  shared-initialize(#<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  #f(compiled-function (this &optional args) "Construct the new object THIS based on ARGS.\nARGS is a property list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the `initialize-instance', there you will need to\ncall `shared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically.  If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from ARGS." #<bytecode -0x6cb3ed684ec7584>)(#<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  apply(#f(compiled-function (this &optional args) "Construct the new object THIS based on ARGS.\nARGS is a property list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the `initialize-instance', there you will need to\ncall `shared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically.  If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from ARGS." #<bytecode -0x6cb3ed684ec7584>) #<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  initialize-instance(#<magit--git-variable magit--git-variable-1588c0e8c548> (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  #f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode -0x19b4430069d8eb23>)(magit--git-variable :command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request)))
  apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode -0x19b4430069d8eb23>) magit--git-variable (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  make-instance(magit--git-variable :command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request)))
  apply(make-instance magit--git-variable (:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request))))
  magit--git-variable(:command forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader read-string :default (closure (t) nil (number-to-string ghub-graphql-items-per-request)))
  (put 'forge-forge.graphqlItemLimit 'transient--suffix (magit--git-variable :command 'forge-forge.graphqlItemLimit :variable "forge.graphqlItemLimit" :reader #'read-string :default #'(lambda nil (number-to-string ghub-graphql-items-per-request))))
  eval-buffer(#<buffer  *load*-456645> nil "/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." nil t)  ; Reading at buffer position 40039
  load-with-code-conversion("/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." "/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." nil t)
  require(forge-commands)
  eval-buffer(#<buffer  *load*> nil "/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." nil t)  ; Reading at buffer position 1744
  load-with-code-conversion("/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." "/home/weipe/.emacs.d/elpa/forge-20230410.1927/forg..." nil t)
  require(forge)
  (progn (setq debug-on-error 1) (require 'magit) (require 'forge))
  eval((progn (setq debug-on-error 1) (require 'magit) (require 'forge)) t)
  command-line-1(("--eval" "(progn (setq debug-on-error 1)(require 'magit)(req..."))
  command-line()
  normal-top-level()
tarsius commented 1 year ago

Uninstall forge, closql and all emacsql* packages. Restart Emacs. Install forge again.

weipe commented 1 year ago

Thanks, now it works.

The process turned into kind of a hassle actually - simply removing the involved packages was not enough. For some reason, magit seemed to be entangled, so I ended up with the error described in https://github.com/magit/forge/issues/556

The solution was to delete ~/.emacs.d/elpa/ all together and install every package from scratch.