Giter VIP home page Giter VIP logo

Comments (21)

qezz avatar qezz commented on May 29, 2024 6

As a short-term solution, it's possible to have the seq-keep definition in init.el

(defun seq-keep (function sequence)
  "Apply FUNCTION to SEQUENCE and return the list of all the non-nil results."
  (delq nil (seq-map function sequence)))

(from https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/seq.el)

After this, magit works fine.

from magit.

tarsius avatar tarsius commented on May 29, 2024 5

I've installed the mentioned kludge.

from magit.

mmarx avatar mmarx commented on May 29, 2024 2

I ran into this issue again on magit version 20231112.914. I'm installing emacs and dependencies via nix, so manually side-loading seq isn't an option. But I thought it also wouldn't be required anymore in this version?

Do you have by chance a workaround for a Nix based config?

This is what I'm currently using:

  overrides = self: super: {
    elpaPackages =
      super.elpaPackages
      // {
        seq = self.callPackage ({
          elpaBuild,
          fetchurl,
          lib,
        }:
          elpaBuild rec {
            pname = "seq";
            ename = "seq";
            version = "2.24";
            src = fetchurl {
              url = "https://elpa.gnu.org/packages/seq-2.24.tar";
              sha256 = "1w2cysad3qwnzdabhq9xipbslsjm528fcxkwnslhlkh8v07karml";
            };
            packageRequires = [];
            meta = {
              homepage = "https://elpa.gnu.org/packages/seq.html";
              license = lib.licenses.free;
            };
            # tests take a _long_ time to byte-compile, skip them
            postInstall = ''rm -r $out/share/emacs/site-lisp/elpa/${pname}-${version}/tests'';
          }) {};
      };
  };

emacsPackage =
    ((pkgs.emacsPackagesFor pkgs.emacs29-gtk3).overrideScope' overrides).emacsWithPackages;`

from magit.

jroimartin avatar jroimartin commented on May 29, 2024 1

As a workaround I installed seq-2.24 manually and added (require 'seq-25) to my init file. I guess this has to do with the builtin seq package (v2.23 in my case) being loaded first. I'm adding this comment here just in case it helps on debugging the issue.

from magit.

makohoek avatar makohoek commented on May 29, 2024 1

@jroimartin thank you for opening this. I confirm your work-around works for me as well. I'm also on emacs 28.2.

I've made a similar hack in my spacemacs config here:
makohoek/dotfiles@c7868f9

from magit.

tarsius avatar tarsius commented on May 29, 2024 1

@doolio You should probably report that to Straight's maintainers.

from magit.

tarsius avatar tarsius commented on May 29, 2024 1

But I thought it also wouldn't be required anymore in this version?

Magit now works around deficits of package.el, but that doesn't change the fact that it depends on seq v2.24, which means that that package has to be installed independently when using an Emacs release that does not include that version yet.

I ran into this issue again on magit version 20231112.914. I'm installing emacs and dependencies via nix, so manually side-loading seq isn't an option.

That's a bug in how magit is packages in nix then. Please report this to the maintainer of magit in nix. Thanks!

from magit.

tarsius avatar tarsius commented on May 29, 2024

Last night I started using seq-keep in forge but did not add seq-2.24 as a dependency. It is possible you updated packages at this point. I then noticed the issue thanks to CI and fixed it for forge. I then went on to using seq-keep in magit as well. I did add the dependency this time around.

So it is likely that just updating packages again would also have fixed this issue; the fact that you had to manually install seq-2.24 speaks for that. If not -- if an older version of seq is being loaded, despite of the package-installed 2.24 being on the load-path -- then it is most likely an issue with package or something internal to the seq backport package itself.

from magit.

tarsius avatar tarsius commented on May 29, 2024

You should not have to manually require seq-25 because that's what the package-installed seq.el does:

[snip]
;;; Code:

(if (version< emacs-version "25")
    (require 'seq-24)
  (require 'seq-25))

(provide 'seq)
;;; seq.el ends here

from magit.

jroimartin avatar jroimartin commented on May 29, 2024

I think I found the issue.

GNU Emacs 28.2 comes with seq-2.23 built in and it does not upgrade built-in packages automatically. Thus, I had to install seq-2.24 manually. Also, the function seq-keep used by magit is not autoloaded, which requires to explicitly load the library.

Long story short, my current workaround is:

  1. Install seq-2.24 manually.
  2. Add (load "seq") to the init file.

Does it make sense?

from magit.

jroimartin avatar jroimartin commented on May 29, 2024

Information about upgrading built-in packages in GNU Emacs 29: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS.29#n1714

from magit.

tarsius avatar tarsius commented on May 29, 2024

I've added an explicit require.

(You shouldn't use load. It is almost always better to use require.)

I'll have to look into those news. I don't use package myself, and assume(d) that it does not silently ignore explicitly specified dependency versions (by default, or ever).

from magit.

jroimartin avatar jroimartin commented on May 29, 2024

However, I cannot use (require 'seq) because it seems the feature seq is already provided by /usr/share/emacs/28.2/lisp/emacs-lisp/seq.elc (instead of ~/.emacs.d/elpa/seq-2.24/seq.el) by the time it is called from my init file. So require is ignored.

from magit.

tarsius avatar tarsius commented on May 29, 2024

I see. That probably means that something loads seq before package-initialize is called. Across Emacs releases, there are big difference in how and when that is automatically called for you, if at all, how you can call it explicitly instead, and what the recommended way of doing that is. It could be that this defaults to being broken, but it could also could be that you do something that results in this behavior (possibly because it at one point was recommended that you do that).

In other words I will have to investigate. Meanwhile, other users running into this, should first try to update, and if that alone doesn't work add (require 'seq) explicitly early on (but after package-initialize, if that can be found in early-init.el or init.el), and only if that also doesn't work, fall back to (load 'seq).

If this is indeed a bug causes by the default configuration of some Emacs releases, or a common misconfiguration, then I might have to require seq like so:

(when (and (featurep' seq)
          (not (fboundp 'seq-keep)))
  (unload-feature 'seq 'force))
(require 'seq)

from magit.

RastaDill avatar RastaDill commented on May 29, 2024

Hello. Does anyone know how to install the previous version of the package?
Why used rolling release?

from magit.

doolio avatar doolio commented on May 29, 2024

Just ran into this issue. Uninstalling magit and its dependencies and re-installing doesn't install the latest version of the seq package. I use straight.el rather than package.el if that matters and am still on Emacs 27.1. The workaround mentioned here is working for me though.

from magit.

tarsius avatar tarsius commented on May 29, 2024

Straight does not update dependencies and even ignores the specified minimal versions. See radian-software/straight.el#1083.

from magit.

doolio avatar doolio commented on May 29, 2024

Straight does not update dependencies and even ignores the specified minimal versions.

The latest commit on straight's develop branch fixes this issue wrt magit at least.

from magit.

spacekookie avatar spacekookie commented on May 29, 2024

I ran into this issue again on magit version 20231112.914. I'm installing emacs and dependencies via nix, so manually side-loading seq isn't an option. But I thought it also wouldn't be required anymore in this version?

from magit.

Nebucatnetzer avatar Nebucatnetzer commented on May 29, 2024

I ran into this issue again on magit version 20231112.914. I'm installing emacs and dependencies via nix, so manually side-loading seq isn't an option. But I thought it also wouldn't be required anymore in this version?

Do you have by chance a workaround for a Nix based config?
Edit: I installed the package from melpa for the moment until the package gets fixed in Nix or there is a known workaround.

from magit.

crawford avatar crawford commented on May 29, 2024

Thanks for the hint @mmarx. I've adapted it for Home Manager in case anyone is looking for that as well:

{
  programs = {
    emacs = {
      overrides = self: super: rec {
        # Taken from https://github.com/magit/magit/issues/5011#issuecomment-1838598138
        seq = self.callPackage ({ elpaBuild, fetchurl, lib }:
          elpaBuild rec {
            pname = "seq";
            ename = "seq";
            version = "2.24";
            src = fetchurl {
              url = "https://elpa.gnu.org/packages/seq-2.24.tar";
              sha256 = "1w2cysad3qwnzdabhq9xipbslsjm528fcxkwnslhlkh8v07karml";
            };
            packageRequires = [];
            meta = {
              homepage = "https://elpa.gnu.org/packages/seq.html";
              license = lib.licenses.free;
            };
            # tests take a _long_ time to byte-compile, skip them
            postInstall = ''rm -r $out/share/emacs/site-lisp/elpa/${pname}-${version}/tests'';
          }) {};
      };
    };
  };
}

from magit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.