Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magit-status fails, initially with error regarding transient-switch-frame, then subsequently with cl-no-applicable-method regarding forge-get-repository, :known? #16647

Open
bryce-carson opened this issue Nov 8, 2024 · 14 comments

Comments

@bryce-carson
Copy link
Contributor

Description :octocat:

After updating Spacemacs and my packages November 7th 2024, I haven't been able to use magit at all.

Reproduction guide 🪲

  • Start Emacs
  • Navigate to a directory containing a git repository
  • Press SPC g s to run magit-status and select the current directory, which
    contains the repository. Observe the first quoted message.
  • Run magit-status again (SPC g s); observe the second quoted message.

Alternatively,

  • Start Emacs
  • Press SPC g s to run magit-status and select a directory containing a Git
    repository using the minibuffer. Observe the first quoted message.
  • Run magit-status again (SPC g s); observe the second quoted message.

Observed behaviour: 👀 💔
A differnet message is displayed after the first usage of magit-status and subsequent usages.

  1. First usage: Invalid slot name: "#<transient-prefix transient-prefix-8890634>", :transient-switch-frame.
  2. Subsequent usages: cl-no-applicable-method: No applicable method: forge-get-repository, :known?.

Expected behaviour: ❤️ 😄
Magit status buffer should open for the selected repository.

System Info 💻

  • OS: gnu/linux
  • Emacs: 29.4
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 60dcd8c)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(csv html sql windows-scripts
     (python :variables python-format-on-save t)
     meson yaml
     (auto-completion :variables auto-completion-idle-delay 0.7 auto-completion-minimum-prefix-length 0 auto-completion-enable-snippets-in-popup t auto-completion-enable-help-tooltip t)
     emacs-lisp common-lisp git themes-megapack helm
     (ess :variables ess-assign-key "\255" ess-r-backend nil)
     markdown info
     (java :variables java-backend 'lsp)
     (latex :variables latex-view-pdf-in-split-window t latex-refresh-preview t latex-build-engine 'luatex)
     org javascript
     (shell :variables shell-default-height 30 shell-default-position 'bottom shell-default-shell 'vterm)
     syntax-checking)
  • System configuration features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB

Backtrace 🐾

Debugger entered--Lisp error: (cl-no-applicable-method forge-get-pullreq :branch)
  signal(cl-no-applicable-method (forge-get-pullreq :branch))
  cl-no-applicable-method(#s(cl--generic :name forge-get-pullreq :dispatches nil :method-table nil :options nil) :branch)
  apply(cl-no-applicable-method #s(cl--generic :name forge-get-pullreq :dispatches nil :method-table nil :options nil) :branch)
  forge-get-pullreq(:branch)
  forge-topic-at-point()
  forge-repository-at-point()
  #f(compiled-function (demand &optional remote notatpt) "Return the current forge repository.\n\nFirst check if `forge-buffer-repository', or if that is nil, then\nthe repository for `forge-buffer-topic', satisfies DEMAND.  If so,\nthen return that repository.\n\nOtherwise return the repository for `default-directory', if that\nexists and satisfies DEMAND.  If that fails too, then return nil\nor signal an error, depending on DEMAND." #<bytecode -0x410bdbfbad0923c>)(:known?)
  apply(#f(compiled-function (demand &optional remote notatpt) "Return the current forge repository.\n\nFirst check if `forge-buffer-repository', or if that is nil, then\nthe repository for `forge-buffer-topic', satisfies DEMAND.  If so,\nthen return that repository.\n\nOtherwise return the repository for `default-directory', if that\nexists and satisfies DEMAND.  If that fails too, then return nil\nor signal an error, depending on DEMAND." #<bytecode -0x410bdbfbad0923c>) :known? nil)
  forge-get-repository(:known?)
  forge-set-buffer-repository()
  run-hooks(change-major-mode-after-body-hook special-mode-hook magit-section-mode-hook magit-mode-hook magit-status-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook special-mode-hook magit-section-mode-hook magit-mode-hook magit-status-mode-hook))
  run-mode-hooks(magit-status-mode-hook)
  magit-status-mode()
  magit-setup-buffer-internal(magit-status-mode nil ((magit-buffer-diff-args ("--no-ext-diff")) (magit-buffer-diff-files nil) (magit-buffer-log-args ("-n256" "--decorate")) (magit-buffer-log-files nil)))
  magit-status-setup-buffer("/home/bryce/src/c/TIC-80/")
  magit-status("/home/bryce/src/c/TIC-80/" ((8 . 12) (("/home/bryce/src/c/TIC-80/" forge-get-repository :known?)) (("/home/bryce/src/c/TIC-80/" "remote" "get-url" "origin") . "[email protected]:bryce-carson/TIC-80.git") (("/home/bryce/src/c/TIC-80/" . config) . #<hash-table equal 59/65 0x8dbbb39>) (("/home/bryce/src/c/TIC-80/" magit-gitdir) . "/home/bryce/src/c/TIC-80/.git/") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--git-dir") . ".git") (("/home/bryce/src/c/TIC-80/" . magit-toplevel) . "/home/bryce/src/c/TIC-80/") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--show-cdup") . "") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--show-toplevel") . "/home/bryce/Documents/src/c/TIC-80") (("/home/bryce/" "config" "--get-color" "" "reset") . "\33[m") (("/home/bryce/" . magit-toplevel)) (("/home/bryce/" "rev-parse" "--git-dir")) (("/home/bryce/" "rev-parse" "--show-toplevel"))))
  funcall-interactively(magit-status "/home/bryce/src/c/TIC-80/" ((8 . 12) (("/home/bryce/src/c/TIC-80/" forge-get-repository :known?)) (("/home/bryce/src/c/TIC-80/" "remote" "get-url" "origin") . "[email protected]:bryce-carson/TIC-80.git") (("/home/bryce/src/c/TIC-80/" . config) . #<hash-table equal 59/65 0x8dbbb39>) (("/home/bryce/src/c/TIC-80/" magit-gitdir) . "/home/bryce/src/c/TIC-80/.git/") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--git-dir") . ".git") (("/home/bryce/src/c/TIC-80/" . magit-toplevel) . "/home/bryce/src/c/TIC-80/") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--show-cdup") . "") (("/home/bryce/src/c/TIC-80/" "rev-parse" "--show-toplevel") . "/home/bryce/Documents/src/c/TIC-80") (("/home/bryce/" "config" "--get-color" "" "reset") . "\33[m") (("/home/bryce/" . magit-toplevel)) (("/home/bryce/" "rev-parse" "--git-dir")) (("/home/bryce/" "rev-parse" "--show-toplevel"))))
  command-execute(magit-status)
@bryce-carson
Copy link
Contributor Author

Limiting the git layer to the following packages allows magit to function as expected.

     (git :packages magit magit-section evil-collection evil-surround git-timemachine transient) ;; provides magit

@xu-shawn
Copy link
Contributor

xu-shawn commented Nov 9, 2024

Same issue, can confirm

@xu-shawn
Copy link
Contributor

xu-shawn commented Nov 9, 2024

Performing a package rollback & updating again seems to fix it somehow

@bryce-carson
Copy link
Contributor Author

Performing a package rollback & updating again seems to fix it somehow

That's interesting. A rollback did not work for me, regardless of how far back I went.

@xu-shawn
Copy link
Contributor

xu-shawn commented Nov 9, 2024

That's interesting. A rollback did not work for me, regardless of how far back I went.

Have you tried re-applying the updates after rolling back? IIRC rollbacks alone didn't fix it for me.

@fnussbaum
Copy link
Collaborator

fnussbaum commented Nov 10, 2024

@sunlin7 This might also be related to load-hints. I can reproduce the error, but setting dotspacemacs-enable-load-hints to nil solves the problem on my system.

@sunlin7
Copy link
Contributor

sunlin7 commented Nov 10, 2024 via email

@sunlin7
Copy link
Contributor

sunlin7 commented Nov 10, 2024

I tried reproduce this issue but it dose not happened on my local environment (Emacs-29.4, Ubuntu 20.04).
Turn off the load-hints first #16654; at same time I'm try my best to reproduce and find the root cause. Thanks

@sunlin7
Copy link
Contributor

sunlin7 commented Nov 12, 2024

@bryce-carson Dose the #16654 works for you? Thanks

@bryce-carson
Copy link
Contributor Author

@bryce-carson Dose the #16654 works for you? Thanks

I'll try that today.

@rgemulla
Copy link
Contributor

Quick fix: add add forge to dotspacemacs-excluded-packages

@bryce-carson
Copy link
Contributor Author

bryce-carson commented Dec 17, 2024

@bryce-carson Dose the #16654 works for you? Thanks

I apologize, I still have not tried #16654 to test if it resolves the issue. When I will try it I cannot say, nor would it be a perfect test of if the merged PR resolves this issue: I upgraded my Fedora installation and I have a newer Emacs now than I did then, and I don't have notes on what exact installation I had.

For situations like these I almost wish I used GUIX to manage my software rather than DNF, so I could install a different set of software and replicate the old environment without issue.

@fnussbaum
Copy link
Collaborator

I think such errors usually come from incorrect byte compilation, for example when an outdated version of a dependency was loaded before compiling another package depending on the updated dependency. We should investigate whether we can do something about this in Spacemacs, or if this needs to be fixed upstream in package.el.

In this specific case, M-x package-delete magit, forge (and perhaps magit-section for good measure), and reinstalling them by restarting should resolve the errors.

@rgemulla
Copy link
Contributor

Confirmed in my setup. Deleting and reinstalling magit-* and forge fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants