unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
@ 2020-08-31 15:48 Pierre Langlois
  2020-08-31 20:34 ` Mark H Weaver
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Langlois @ 2020-08-31 15:48 UTC (permalink / raw)
  To: 43138

Hello Guix!

Since switching to emacs 27 I've been having issues starting it, seeing
lots of errors like 'Lisp nesting exceeds ‘max-lisp-eval-depth’' when
loading various packages such as magit, ivy, ...etc.

After quite a bit of troubleshooting I reduced it to the `emacs-seq`
package. So if you create an environment with both `emacs-seq` and say
`magit`:

```
$ guix environment --pure --ad-hoc emacs emacs-magit emacs-seq
[env] $ emacs -Q --debug-init --eval "(require 'magit)"
```

Then you get the stack overflow.

Doing some digging, I found this comment from `doom-emacs` that
describes what is happening: https://github.com/hlissner/doom-emacs/issues/1990#issuecomment-549140718

I'm not familiar with emacs' autoloading, so I'm not sure I understand
what's going on fully. However, it mentions that `emacs-seq` has been
included in emacs proper for a while.

So, what would be the best fix for this? Should we remove `emacs-seq`
entirely or try and patch it? Since we don't support previous versions
of emacs I don't know if we need it.

Thanks,
Pierre







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
  2020-08-31 15:48 bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq Pierre Langlois
@ 2020-08-31 20:34 ` Mark H Weaver
  2020-08-31 21:20   ` Pierre Langlois
  0 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2020-08-31 20:34 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 43138

Hi Pierre,

Pierre Langlois <pierre.langlois@gmx.com> writes:

> [...] However, it mentions that `emacs-seq` has been
> included in emacs proper for a while.
>
> So, what would be the best fix for this? Should we remove `emacs-seq`
> entirely or try and patch it? Since we don't support previous versions
> of emacs I don't know if we need it.

If 'emacs-seq' is included in Emacs 27, it seems to me that we should
just delete it, unless there's something I'm missing.

Thanks for investigating!

      Mark




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
  2020-08-31 20:34 ` Mark H Weaver
@ 2020-08-31 21:20   ` Pierre Langlois
  2020-08-31 22:51     ` Mark H Weaver
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Langlois @ 2020-08-31 21:20 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 43138

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

Hi Mark,

Mark H Weaver writes:

> Hi Pierre,
>
> Pierre Langlois <pierre.langlois@gmx.com> writes:
>
>> [...] However, it mentions that `emacs-seq` has been
>> included in emacs proper for a while.
>>
>> So, what would be the best fix for this? Should we remove `emacs-seq`
>> entirely or try and patch it? Since we don't support previous versions
>> of emacs I don't know if we need it.
>
> If 'emacs-seq' is included in Emacs 27, it seems to me that we should
> just delete it, unless there's something I'm missing.

Agreed, I was curious if there was another reason for needing it, since
I /believe/ it's been in emacs proper since 25, but emacs-seq was added
in to guix after that. I suspect it it's still listed as a dependency
for packages, even though it's not actually needed.

Anyways, I've reconfigured my system with the following patch to fix the
issue, let me know if that looks OK! The packages that depended on it
build just fine, although I don't use them directly -- I was pulling
emacs-seq from emacs-org-roam which depends on emacs-biblio, but I'm not
using this feature.

Oh, another thing, I wanted to warn potential users of emacs-seq with a
deprecation warning using (guix deprecation), like:

    ;; seq.el is included into emacs.
    (define-deprecated emacs-seq emacs)

It would be good to do that so somebody isn't tempted to re-add it when
it's listed a dependency.  But that triggers errors:

    error: emacs: unbound variable
    hint: Did you forget a `use-modules' form?

Am I using it wrong? The (gnu packages emacs) module is included of
course.

Thanks,
Pierre


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Remove-emacs-seq-package.patch --]
[-- Type: text/x-patch, Size: 4072 bytes --]

From 1d4fc30d13df916a0800dfcf2f993a1c2a95add8 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Mon, 31 Aug 2020 17:05:58 +0100
Subject: [PATCH] gnu: Remove emacs-seq package.

It is included with emacs and installing it alongisde emacs 27 causes issues.

Fixes <https://bugs.gnu.org/43138>.

* gnu/packages/emacs-xyz.scm (emacs-bugs-hunter)[propagated-inputs]: Remove.
(emacs-erc-status-sidebar)[propagated-inputs]: Remove.
(emacs-psc-ide)[propagated-inputs]: Remove emacs-seq.
(emacs-biblio)[propagated-inputs]: Remove emacs-seq.
(emacs-seq): Delete variable.
(emacs-flycheck-haskell)[propagated-inputs]: Remove emacs-seq.
---
 gnu/packages/emacs-xyz.scm | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 3036004cee..151718dd6e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1312,8 +1312,6 @@ regexp-like arguments to @code{skip-chars-forward} and
           (base32
            "134fj493sdn93pyyac8rpz1fzahzmayvphsrmqp3wvgysmfqm38l"))))
       (build-system emacs-build-system)
-      (propagated-inputs
-       `(("emacs-seq" ,emacs-seq)))
       (home-page "https://github.com/Malabarba/elisp-bug-hunter")
       (synopsis "Hunt down errors by bisecting elisp files")
       (description
@@ -3506,7 +3504,6 @@ IRC bouncer with ERC.")
          (sha256
           (base32 "1hwlhzgx03z8891sblz56zdp8zj0izh72kxykgcnz5rrkyc3vfi3"))))
       (build-system emacs-build-system)
-      (propagated-inputs `(("emacs-seq" ,emacs-seq)))
       (home-page "https://github.com/drewbarbs/erc-status-sidebar")
       (synopsis "Hexchat-like activity overview for ERC channels")
       (description
@@ -13560,8 +13557,7 @@ and can be consulted and modified.")
          ("emacs-dash" ,emacs-dash)
          ("emacs-flycheck" ,emacs-flycheck)
          ("emacs-let-alist" ,emacs-let-alist)
-         ("emacs-s" ,emacs-s)
-         ("emacs-seq" ,emacs-seq)))
+         ("emacs-s" ,emacs-s)))
       (home-page "https://github.com/purescript-emacs/psc-ide-emacs")
       (synopsis "Emacs integration for PureScript's psc-ide tool")
       (description
@@ -14321,8 +14317,7 @@ with (La)TeX mode, Org mode and other Emacs editing modes.")
         (base32 "1gxjind6r235az59dr8liv03d8994mqb8a7m28j3c12q7p70aziz"))))
     (build-system emacs-build-system)
     (propagated-inputs
-     `(("emacs-seq" ,emacs-seq)
-       ("emacs-dash" ,emacs-dash)
+     `(("emacs-dash" ,emacs-dash)
        ("emacs-let-alist" ,emacs-let-alist)))
     (home-page "https://github.com/cpitclaudel/biblio.el")
     (synopsis "Browse and import bibliographic references")
@@ -14730,24 +14725,6 @@ timestamps and date-time format strings library for Emacs.")
      "@code{npm-mode} provides a minor mode to work with @code{npm} projects.")
     (license license:gpl3+)))

-(define-public emacs-seq
-  (package
-    (name "emacs-seq")
-    (version "2.20")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://elpa.gnu.org/packages/seq-" version ".tar"))
-       (sha256
-        (base32
-         "0vrpx6nnyjb0gsypknzagimlhvcvi5y1rcdkpxyqr42415zr8d0n"))))
-    (build-system emacs-build-system)
-    (home-page "https://elpa.gnu.org/packages/seq.html")
-    (synopsis "Sequence manipulation functions")
-    (description "Sequence-manipulation functions that complement basic
-functions provided by @file{subr.el}.")
-    (license license:gpl3+)))
-
 (define-public emacs-itail
   (let ((commit "6e43c20da03be3b9c6ece93b7dc3495975ec1888")
         (revision "1"))
@@ -20448,7 +20425,6 @@ unescaping of quotes.")
       (build-system emacs-build-system)
       (propagated-inputs
        `(("emacs-dash" ,emacs-dash)
-         ("emacs-seq" ,emacs-seq)
          ("emacs-flycheck" ,emacs-flycheck)
          ("emacs-haskell-mode" ,emacs-haskell-mode)
          ("emacs-let-alist" ,emacs-let-alist)))
--
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
  2020-08-31 21:20   ` Pierre Langlois
@ 2020-08-31 22:51     ` Mark H Weaver
  2020-09-04 11:30       ` Pierre Langlois
  0 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2020-08-31 22:51 UTC (permalink / raw)
  To: Pierre Langlois

Hi Pierre,

Pierre Langlois <pierre.langlois@gmx.com> writes:

> Mark H Weaver writes:
>
>> If 'emacs-seq' is included in Emacs 27, it seems to me that we should
>> just delete it, unless there's something I'm missing.
>
> Agreed, I was curious if there was another reason for needing it, since
> I /believe/ it's been in emacs proper since 25, but emacs-seq was added
> in to guix after that. I suspect it it's still listed as a dependency
> for packages, even though it's not actually needed.

It might be that the copy of 'emacs-seq' in Emacs 26 was relatively old,
and that some users and other emacs packages wanted a newer version.  I
guess that's the rationale for 'emacs-org', and I vaguely recall that we
might have had an updated Gnus package in the past as well, for the same
reason.

Hopefully the version of 'emacs-seq' bundled with Emacs 27 is now
sufficiently up-to-date.

> Anyways, I've reconfigured my system with the following patch to fix the
> issue, let me know if that looks OK!

Except for a minor typo in the commit log "alongisde", looks good to me.

Thank you!  I think you should go ahead and push it to 'master', since
things are currently broken and this is certainly an improvement.  If
there are remaining issues, they can be addressed in future commits.

> Oh, another thing, I wanted to warn potential users of emacs-seq with a
> deprecation warning using (guix deprecation), like:
>
>     ;; seq.el is included into emacs.
>     (define-deprecated emacs-seq emacs)

It's a good thought, but I'm not sure if 'define-deprecated' is the
right thing here.  This might be a question for Ludovic.

> It would be good to do that so somebody isn't tempted to re-add it when
> it's listed a dependency.  But that triggers errors:
>
>     error: emacs: unbound variable
>     hint: Did you forget a `use-modules' form?
>
> Am I using it wrong? The (gnu packages emacs) module is included of
> course.

I guess that this is most likely caused by a cyclic dependency between
the (gnu packages emacs) and (gnu packages emacs-xyz) modules.  When
there's a cyclic dependency between modules, Guile cannot ensure that
the definitions of imported modules are evaluated first.

In this case, I guess that (define-deprecated emacs-seq emacs) is
evaluated before the definition of 'emacs' is evaluated, and that it
fails to cope with that.

I wish that we didn't have any cyclic module dependencies, but at this
point it would require a *major* reorganization of our package modules
to avoid it.

     Thanks,
       Mark




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
  2020-08-31 22:51     ` Mark H Weaver
@ 2020-09-04 11:30       ` Pierre Langlois
  2020-09-04 13:23         ` Mark H Weaver
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Langlois @ 2020-09-04 11:30 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 43138-done

[-- Attachment #1: Type: text/plain, Size: 3054 bytes --]

Hi Mark,

Replying with the bug on CC, I didn't realise your last email didn't
include it. I assume that was a mistake?

Mark H Weaver writes:

> Hi Pierre,
>
> Pierre Langlois <pierre.langlois@gmx.com> writes:
>
>> Mark H Weaver writes:
>>
>>> If 'emacs-seq' is included in Emacs 27, it seems to me that we should
>>> just delete it, unless there's something I'm missing.
>>
>> Agreed, I was curious if there was another reason for needing it, since
>> I /believe/ it's been in emacs proper since 25, but emacs-seq was added
>> in to guix after that. I suspect it it's still listed as a dependency
>> for packages, even though it's not actually needed.
>
> It might be that the copy of 'emacs-seq' in Emacs 26 was relatively old,
> and that some users and other emacs packages wanted a newer version.  I
> guess that's the rationale for 'emacs-org', and I vaguely recall that we
> might have had an updated Gnus package in the past as well, for the same
> reason.
>
> Hopefully the version of 'emacs-seq' bundled with Emacs 27 is now
> sufficiently up-to-date.
>
>> Anyways, I've reconfigured my system with the following patch to fix the
>> issue, let me know if that looks OK!
>
> Except for a minor typo in the commit log "alongisde", looks good to me.
>
> Thank you!  I think you should go ahead and push it to 'master', since
> things are currently broken and this is certainly an improvement.  If
> there are remaining issues, they can be addressed in future commits.

OK, pushed to master with 852ae64e11ef9107afabbdb307770f946376addd ,
I'll close the bug as well, I suppose we can open new ones in case
problems arise later.

>
>> Oh, another thing, I wanted to warn potential users of emacs-seq with a
>> deprecation warning using (guix deprecation), like:
>>
>>     ;; seq.el is included into emacs.
>>     (define-deprecated emacs-seq emacs)
>
> It's a good thought, but I'm not sure if 'define-deprecated' is the
> right thing here.  This might be a question for Ludovic.
>
>> It would be good to do that so somebody isn't tempted to re-add it when
>> it's listed a dependency.  But that triggers errors:
>>
>>     error: emacs: unbound variable
>>     hint: Did you forget a `use-modules' form?
>>
>> Am I using it wrong? The (gnu packages emacs) module is included of
>> course.
>
> I guess that this is most likely caused by a cyclic dependency between
> the (gnu packages emacs) and (gnu packages emacs-xyz) modules.  When
> there's a cyclic dependency between modules, Guile cannot ensure that
> the definitions of imported modules are evaluated first.
>
> In this case, I guess that (define-deprecated emacs-seq emacs) is
> evaluated before the definition of 'emacs' is evaluated, and that it
> fails to cope with that.
>
> I wish that we didn't have any cyclic module dependencies, but at this
> point it would require a *major* reorganization of our package modules
> to avoid it.

Ouch, yeah that seems like the problem, I'll see if I can get it to work
as a follow-up, but it seems not really worth the effort :-).

Thanks!
Pierre

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq
  2020-09-04 11:30       ` Pierre Langlois
@ 2020-09-04 13:23         ` Mark H Weaver
  0 siblings, 0 replies; 6+ messages in thread
From: Mark H Weaver @ 2020-09-04 13:23 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 43138

Pierre Langlois <pierre.langlois@gmx.com> writes:
> Replying with the bug on CC, I didn't realise your last email didn't
> include it. I assume that was a mistake?

Indeed, my mistake.  I just resent my previous email to complete the
record for this bug.

> OK, pushed to master with 852ae64e11ef9107afabbdb307770f946376addd ,
> I'll close the bug as well, I suppose we can open new ones in case
> problems arise later.

Sounds good.  Thanks for taking care of this, Pierre!

      Mark




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-04 13:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 15:48 bug#43138: Stack overflow in emacs 27 because of preloading emacs-seq Pierre Langlois
2020-08-31 20:34 ` Mark H Weaver
2020-08-31 21:20   ` Pierre Langlois
2020-08-31 22:51     ` Mark H Weaver
2020-09-04 11:30       ` Pierre Langlois
2020-09-04 13:23         ` Mark H Weaver

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).