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

Upstream changes in magit-section require reinstallation of related packages #179

Closed
ZelphirKaltstahl opened this issue Jun 10, 2024 · 11 comments

Comments

@ZelphirKaltstahl
Copy link

I am using the following versions:

  • emacs: GNU Emacs 29.3 (using guix to install it)
  • magit: 20240510.1701
  • magit-todos: 1.7.2

I am loading magit and magit-todos as follows:

(use-package magit
  :ensure t)

(use-package magit-todos
  :after magit
  :config (magit-todos-mode 1))

When I press C-x g to call magit-status, I get an error:

error in process sentinel: slot-missing: Invalid slot name: "#<magit-section magit-section-17a4908>", :value
error in process sentinel: Invalid slot name: "#<magit-section magit-section-17a4908>", :value

I already tried to recompile packages using:

M-: (byte-recompile-directory package-user-dir nil 'force)

and then restart Emacs, but that did not change anything.

@alphapapa
Copy link
Owner

This is due to changes in upstream libraries. Reinstall them and this package, please.

@alphapapa alphapapa closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
@ZelphirKaltstahl
Copy link
Author

I am not quite sure which libraries that are. Can you be more specific?

@alphapapa
Copy link
Owner

magit/magit#5130

@alphapapa alphapapa changed the title Possible incompatibility, invalid slot name :value https://github.com/magit/magit/pull/5130 Jun 12, 2024
@alphapapa alphapapa pinned this issue Jun 12, 2024
@ZelphirKaltstahl
Copy link
Author

Thank you! What a complex issue!

@alphapapa
Copy link
Owner

Indeed. Painful, but hopefully worth it in the end.

@alphapapa alphapapa changed the title https://github.com/magit/magit/pull/5130 Upstream changes in magit-section require reinstallation of related packages Jun 12, 2024
@ZelphirKaltstahl
Copy link
Author

ZelphirKaltstahl commented Jun 19, 2024

Just to add some info here for people finding this in the future: If you have installed Emacs and Magit through GNU Guix, here is how to do this, assuming you use some combination of channels.scm, manifest.scm file, and guix shell invocation:

  • update GNU Guix channel with guix pull (This will get your Guix to track a newer commit, which references the newer versions of emacs-magit and emacs-magit-status that you need.)
  • write updated channels.scm file using guix describe --format=channels > channels.scm
  • remove/comment out Magit things from your manifest.scm, if you use one
  • remove ~/.emacs.d/elpa/magit*
  • remove/comment out any require or use-package expressions for Magit things in your init.el or similar configuration file
  • start Emacs
  • assert: You should not have any Magit in your Emacs now. If you still have Magit somehow, then that means you are installing it via other means somewhere.
  • close Emacs
  • uncomment Magit things from your manifest.scm, if you use one
  • uncomment any require or use-package expressions for Magit things in your init.el or similar configuration file
  • start Emacs

Now the error should be gone.

@alphapapa
Copy link
Owner

@ZelphirKaltstahl I'm far from a Guix expert, but I do use it some, and I'd be surprised if it were necessary to mess with channel and manifest files to fix this. Simply removing the Magit-related packages through Guix, and then doing the other Emacs-specific steps listed here, will probably be enough. Are you sure it's necessary to do those things?

@ZelphirKaltstahl
Copy link
Author

ZelphirKaltstahl commented Jun 20, 2024

@alphapapa Ah, I am also far from an expert. I only wanted to be sure, that all magit related things are gone, so I commented out the magit packages in my manifest.scm file, that I use for a guix shell running Emacs. Then I was able to see, that Emacs has no more magit and does not know what magit is, ergo should be clean. Then I added magit again. Basically a sledgehammer method :D

I still have not gotten around to really getting guix profiles to work in the way I want, so currently I am using guix time-machine and guix shell as follows:

#!/usr/bin/env bash

set -Eeuxo pipefail

if [ -z "${1:-}" ] ; then 
    ADDITIONAL_EMACS_ARGS=""
else
    ADDITIONAL_EMACS_ARGS="${1:-}"
fi

EMACS_ARGS="--maximized --debug-init"

GUIX_ENV_DIR="${GUIX_EXTRA_PROFILES}/emacs-env"

guix time-machine \
     --channels="${GUIX_ENV_DIR}/channels.scm" -- \
     shell \
     --manifest="${GUIX_ENV_DIR}/manifest.scm" \
     --cores=8 -- \
     emacs ${EMACS_ARGS} ${ADDITIONAL_EMACS_ARGS}

Emacs is not in my main profile. It is all separated into this temporary shell thing. This might not be ideal, as it needs to be rebuilt, when I garbage collect guix gc. But maybe that is sometimes also a good thing.

Offtopic, but how do you use guix to run Emacs? Do you?

@alphapapa
Copy link
Owner

I don't know why you'd need to use time-machine and shell to run Emacs in Guix. I would guess you'd only need to do that if you had a specific reason to run an obsolete version of Emacs for testing compatibility.

I run Guix on top of Debian as a foreign distro. I guix install emacs and then run emacs. Other than a recently discovered change in their packaging, I have no problems with it (and that issue may or may not matter to you).

@ZelphirKaltstahl
Copy link
Author

Ah, I do that with time-machine, to have a reproducible setup of exactly using some specific versions of things. If at any time something breaks, I can go back to my previous channels.scm file and should have the previous setup.

I also want to have a separate thing in Guix package manager for Emacs, so that I can update it independently from any other packages I install with Guix. This might be a good use-case for profiles, but I have not gotten into that yet. Previous attempts with Guix profiles I failed to do what I wanted to do. I should look into profiles at some point again. At least I think, that that could do what I need (reproducible, portable setup, that only updates when I want to update Emacs or its packages).

I often update my channels.scm, but only when I feel like I can spend time on it. If I had my Emacs in Guix in the main profile, I would not be able to update it independently from other packages.

@alphapapa
Copy link
Owner

I see. Yes, this is one of the less convenient parts of Guix, and some of these newer features seem to be not quite mature yet. I look forward to their continued progress on it. I'd like to be able to do things similar to what you describe without having to write channels and manifests and packages in Scheme files.

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

2 participants