GNU bug report logs - #43277
emacs-next is broke, "seq" missing

Previous Next

Package: guix;

Reported by: Martin Becze <mjbecze <at> riseup.net>

Date: Tue, 8 Sep 2020 12:14:01 UTC

Severity: important

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43277 in the body.
You can then email your comments to 43277 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 08 Sep 2020 12:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martin Becze <mjbecze <at> riseup.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 08 Sep 2020 12:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Martin Becze <mjbecze <at> riseup.net>
To: bug-guix <at> gnu.org
Subject: emacs-next is broke, "seq" missing
Date: Tue, 8 Sep 2020 07:13:42 -0500
[Message part 1 (text/plain, inline)]
emacs-next recently broke. It now has this error on start up.

"require: Cannot open load file: No such file or directory, seq"

I think this must have happened relatively recently (with the last 3
weeks) since it was working fine earlier.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 08 Sep 2020 12:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Malte Gerdes <malte.f.gerdes <at> gmail.com>
To: Martin Becze <mjbecze <at> riseup.net>
Cc: 43277 <at> debbugs.gnu.org
Subject: Re: bug#43277: emacs-next is broke, "seq" missing
Date: Tue, 8 Sep 2020 14:40:26 +0200
[Message part 1 (text/plain, inline)]
Hi,

I had a similar error yesterday, with emacs27. Turned out I had to reload
my environment because some variables still pointed to emacs 26.3
directories which didn't exist anymore.

Malte

On Tue, 8 Sep 2020, 14:25 Martin Becze, <mjbecze <at> riseup.net> wrote:

> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"
>
> I think this must have happened relatively recently (with the last 3
> weeks) since it was working fine earlier.
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 08 Sep 2020 13:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Martin Becze <mjbecze <at> riseup.net>
To: Malte Gerdes <malte.f.gerdes <at> gmail.com>
Cc: 43277 <at> debbugs.gnu.org
Subject: Re: bug#43277: emacs-next is broke, "seq" missing
Date: Tue, 8 Sep 2020 08:17:33 -0500
[Message part 1 (text/plain, inline)]
I just tried out emacs27 and what replicated Malte's experience. But
even after reloading my environment emacs28 doesn't work.

On 9/8/20 7:40 AM, Malte Gerdes wrote:
> Hi,
> 
> I had a similar error yesterday, with emacs27. Turned out I had to
> reload my environment because some variables still pointed to emacs 26.3
> directories which didn't exist anymore.
> 
> Malte
> 
> On Tue, 8 Sep 2020, 14:25 Martin Becze, <mjbecze <at> riseup.net
> <mailto:mjbecze <at> riseup.net>> wrote:
> 
>     emacs-next recently broke. It now has this error on start up.
> 
>     "require: Cannot open load file: No such file or directory, seq"
> 
>     I think this must have happened relatively recently (with the last 3
>     weeks) since it was working fine earlier.
> 

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 08 Sep 2020 14:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Michael Rohleder <mike <at> rohleder.de>
To: Martin Becze <mjbecze <at> riseup.net>
Cc: 43277 <at> debbugs.gnu.org
Subject: Re: bug#43277: emacs-next is broke, "seq" missing
Date: Tue, 08 Sep 2020 16:01:44 +0200
[Message part 1 (text/plain, inline)]
Hi Martin,

Martin Becze <mjbecze <at> riseup.net> writes:
> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"

Maybe it's possible to find where this is coming from?
(starting emacs with "--debug-init" might help or starting with a
minimal .emacs.el etc)

-- 
Alle anziehenden Leute sind immer im Kern verdorben.
Darin liegt das Geheimnis ihrer sympathischen Kraft.
      Oskar Wilde
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 08 Sep 2020 15:08:02 GMT) Full text and rfc822 format available.

Message #17 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Martin Becze <mjbecze <at> riseup.net>
To: Michael Rohleder <mike <at> rohleder.de>
Cc: 43277 <at> debbugs.gnu.org
Subject: Re: bug#43277: emacs-next is broke, "seq" missing
Date: Tue, 8 Sep 2020 10:07:41 -0500
[Message part 1 (text/plain, inline)]
--debug-init doesn't help and we don't seem to be loading the init file.

On 9/8/20 9:01 AM, Michael Rohleder wrote:
> Hi Martin,
> 
> Martin Becze <mjbecze <at> riseup.net> writes:
>> emacs-next recently broke. It now has this error on start up.
>>
>> "require: Cannot open load file: No such file or directory, seq"
> 
> Maybe it's possible to find where this is coming from?
> (starting emacs with "--debug-init" might help or starting with a
> minimal .emacs.el etc)
> 

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Fri, 11 Sep 2020 20:10:01 GMT) Full text and rfc822 format available.

Message #20 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Langlois <pierre.langlois <at> gmx.com>
To: Martin Becze <mjbecze <at> riseup.net>
Cc: bug-guix <at> gnu.org, 43277 <at> debbugs.gnu.org
Subject: Re: bug#43277: emacs-next is broke, "seq" missing
Date: Fri, 11 Sep 2020 21:09:41 +0100
[Message part 1 (text/plain, inline)]
Hi Martin,

Sorry this not working for you :-/

Martin Becze writes:

> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"
>
> I think this must have happened relatively recently (with the last 3
> weeks) since it was working fine earlier.

I submitted a patch a few weeks ago that entirely removed the seq
package from guix, it's included in emacs itself so it shouldn't be
needed anymore, and actually, installing it along with emacs27 causes
stack overflows.

Testing emacs-next, I can see that seq.el is included as well:

    $ ls $(guix build emacs-next)/share/emacs/28.0.50/lisp/emacs-lisp/seq.el.gz

Then inside a clean environment it's able to (require 'seq):

    $ guix environment --ad-hoc emacs-next -- emacs -Q --eval "(require 'seq)"

Using the -Q flag to make sure it's not loading any config.

Can you share some of your emacs config and how you're installing emacs
packages? I assume they're not installed with guix, unless there's a way
to replace each package's input with emacs-next automatically.

Thanks,
Pierre

   

[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Fri, 11 Sep 2020 20:11:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Mon, 14 Sep 2020 22:09:01 GMT) Full text and rfc822 format available.

Message #26 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: 43277 <at> debbugs.gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>, pierre.langlois <at> gmx.com,
 mike <at> rohleder.de, malte.f.gerdes <at> gmail.com, mjbecze <at> riseup.net
Subject: [PATCH] gnu: emacs-next: Fix load path and version
Date: Mon, 14 Sep 2020 18:08:19 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* gnu/packages/emacs.scm (emacs):
[strip-double-wrap] Modify to work with emacs-next

* gnu/packages/emacs.scm (emacs-next):
[version] Change version from 28.0.50.1 to 28.0.50
[arguments] Removed field
[native-search-paths] New field
---

The problem turned out to be that EMACSLOADPATH wasn't being set
properly.  This patch fixes that.



 gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 03c28ee7a7..b3d099257d 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -196,11 +196,12 @@
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
              ;; twice.  This also fixes a minor issue, where WMs would not be
-             ;; able to track emacs back to emacs.desktop.
+             ;; able to track emacs back to emacs.desktop.  It's done using
+             ;; this-package so emacs-next can reuse it
              (with-directory-excursion (assoc-ref outputs "out")
                (copy-file (string-append
                            "bin/emacs-"
-                           ,(version-major+minor (package-version emacs)))
+                           ,(car (string-split (package-version this-package) #\-)))
                           "bin/emacs")
                #t)))
          (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
@@ -279,11 +280,10 @@ languages.")
 
 (define-public emacs-next
   (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
-        (revision "0")
-        (emacs-version "28.0.50.1"))
+        (revision "0"))
     (package/inherit emacs
       (name "emacs-next")
-      (version (git-version emacs-version revision commit))
+      (version (git-version "28.0.50" revision commit))
       (source
        (origin
          (inherit (package-source emacs))
@@ -295,24 +295,19 @@ languages.")
          (sha256
           (base32
            "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
-      (arguments
-       (substitute-keyword-arguments (package-arguments emacs)
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (replace 'strip-double-wrap
-               (lambda* (#:key outputs #:allow-other-keys)
-                 ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
-                 ;; twice.  This also fixes a minor issue, where WMs would not be
-                 ;; able to track emacs back to emacs.desktop.
-                 (with-directory-excursion (assoc-ref outputs "out")
-                   (copy-file (string-append
-                               "bin/emacs-"
-                               ,(version-major+minor+point (package-version emacs-next)))
-                              "bin/emacs")
-                   #t)))))))
       (native-inputs
        `(("autoconf" ,autoconf)
-         ,@(package-native-inputs emacs))))))
+         ,@(package-native-inputs emacs)))
+
+      (native-search-paths
+       (list (search-path-specification
+              (variable "EMACSLOADPATH")
+              ;; The versioned entry is for the Emacs' builtin libraries.
+              (files (list "share/emacs/site-lisp"
+                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
+             (search-path-specification
+              (variable "INFOPATH")
+              (files '("share/info"))))))))
 
 (define-public emacs-minimal
   ;; This is the version that you should use as an input to packages that just
-- 
2.28.0





Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 22 Sep 2020 13:07:01 GMT) Full text and rfc822 format available.

Message #29 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
To: guix-devel <at> gnu.org
Cc: pierre.langlois <at> gmx.com, mike <at> rohleder.de, malte.f.gerdes <at> gmail.com,
 43277 <at> debbugs.gnu.org, mjbecze <at> riseup.net
Subject: Re: bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
Date: Tue, 22 Sep 2020 09:05:51 -0400
Hello guix-devel,

I fear this patch may get lost (as it has not received feedback since I
posted it on Sept 14th (ok maybe I'm just being impatient but I'd like
to think emacs-next is an important package)) so I've decided to post it
in guix-devel. While I'm here I might as well add some much needed
information.

The emacs-next package has been broken since it was re-added on August
31st. It was added by me so this my fault. It's broken because the
EMACSLOADPATH environment variable only contains the lisp location for
your user profile and doesn't include the lisp bundled with
emacs-next. If you have emacs and emacs-next installed at the same time,
emacs-next appears to work as expected because it's using the lisp
installed with emacs. I'm not sure if there is a way to make sure people
only install emacs or emacs-next, but you should only install one.

I created the below patch on Sept 14th, and have been using it daily
since then with no issues.

The version goes from 28.0.50.1 to 28.0.50. The "1" is the build number
which gets incremented every time you run "make" (so not actually part
of the version). Also it's important to get the version correct as I use
it to refer to the binary.

When we copy the binary in 'string-double-wrap, I've decided to just
string split on #\-. This is remove the end of the git-version string so
we're left with just 28.0.50.

I need to copy the native-search-paths section from emacs and place it
into emacs-next. It would be cooler if the native-search-paths sections
was thunked so I could pull the this-package trick again to get the
right version, but I think this is the only way.

Thanks,

Morgan

Morgan.J.Smith <at> outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
>
> * gnu/packages/emacs.scm (emacs):
> [strip-double-wrap] Modify to work with emacs-next
>
> * gnu/packages/emacs.scm (emacs-next):
> [version] Change version from 28.0.50.1 to 28.0.50
> [arguments] Removed field
> [native-search-paths] New field
> ---
>
> The problem turned out to be that EMACSLOADPATH wasn't being set
> properly.  This patch fixes that.
>
>
>
>  gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
>  1 file changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 03c28ee7a7..b3d099257d 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -196,11 +196,12 @@
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
>               ;; twice.  This also fixes a minor issue, where WMs would not be
> -             ;; able to track emacs back to emacs.desktop.
> +             ;; able to track emacs back to emacs.desktop.  It's done using
> +             ;; this-package so emacs-next can reuse it
>               (with-directory-excursion (assoc-ref outputs "out")
>                 (copy-file (string-append
>                             "bin/emacs-"
> -                           ,(version-major+minor (package-version emacs)))
> +                           ,(car (string-split (package-version this-package) #\-)))
>                            "bin/emacs")
>                 #t)))
>           (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
> @@ -279,11 +280,10 @@ languages.")
>  
>  (define-public emacs-next
>    (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
> -        (revision "0")
> -        (emacs-version "28.0.50.1"))
> +        (revision "0"))
>      (package/inherit emacs
>        (name "emacs-next")
> -      (version (git-version emacs-version revision commit))
> +      (version (git-version "28.0.50" revision commit))
>        (source
>         (origin
>           (inherit (package-source emacs))
> @@ -295,24 +295,19 @@ languages.")
>           (sha256
>            (base32
>             "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
> -      (arguments
> -       (substitute-keyword-arguments (package-arguments emacs)
> -         ((#:phases phases)
> -          `(modify-phases ,phases
> -             (replace 'strip-double-wrap
> -               (lambda* (#:key outputs #:allow-other-keys)
> -                 ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> -                 ;; twice.  This also fixes a minor issue, where WMs would not be
> -                 ;; able to track emacs back to emacs.desktop.
> -                 (with-directory-excursion (assoc-ref outputs "out")
> -                   (copy-file (string-append
> -                               "bin/emacs-"
> -                               ,(version-major+minor+point (package-version emacs-next)))
> -                              "bin/emacs")
> -                   #t)))))))
>        (native-inputs
>         `(("autoconf" ,autoconf)
> -         ,@(package-native-inputs emacs))))))
> +         ,@(package-native-inputs emacs)))
> +
> +      (native-search-paths
> +       (list (search-path-specification
> +              (variable "EMACSLOADPATH")
> +              ;; The versioned entry is for the Emacs' builtin libraries.
> +              (files (list "share/emacs/site-lisp"
> +                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
> +             (search-path-specification
> +              (variable "INFOPATH")
> +              (files '("share/info"))))))))
>  
>  (define-public emacs-minimal
>    ;; This is the version that you should use as an input to packages that just




Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Tue, 22 Sep 2020 18:36:01 GMT) Full text and rfc822 format available.

Message #32 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Langlois <pierre.langlois <at> gmx.com>
To: Morgan.J.Smith <at> outlook.com
Cc: pierre.langlois <at> gmx.com, mike <at> rohleder.de, malte.f.gerdes <at> gmail.com,
 43277 <at> debbugs.gnu.org, mjbecze <at> riseup.net
Subject: Re: [PATCH] gnu: emacs-next: Fix load path and version
Date: Tue, 22 Sep 2020 19:35:34 +0100
[Message part 1 (text/plain, inline)]
Hi Morgan,

Morgan.J.Smith <at> outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
>
> * gnu/packages/emacs.scm (emacs):
> [strip-double-wrap] Modify to work with emacs-next
>
> * gnu/packages/emacs.scm (emacs-next):
> [version] Change version from 28.0.50.1 to 28.0.50
> [arguments] Removed field
> [native-search-paths] New field
> ---
>
> The problem turned out to be that EMACSLOADPATH wasn't being set
> properly.  This patch fixes that.

Nice catch!

This patch looks good to me overall, I'm not a maintainer but I can
review it. See my couple of comments inline.

>
>
>
>  gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
>  1 file changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 03c28ee7a7..b3d099257d 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -196,11 +196,12 @@
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
>               ;; twice.  This also fixes a minor issue, where WMs would not be
> -             ;; able to track emacs back to emacs.desktop.
> +             ;; able to track emacs back to emacs.desktop.  It's done using
> +             ;; this-package so emacs-next can reuse it
>               (with-directory-excursion (assoc-ref outputs "out")
>                 (copy-file (string-append
>                             "bin/emacs-"
> -                           ,(version-major+minor (package-version emacs)))
> +                           ,(car (string-split (package-version this-package) #\-)))

I agree in general it's good to reuse code, however in this particular
case it's probably better to keep the phases duplicated.  For example,
in the future one could update the emacs-next package to not require a
revision number anymore, and it's likely they'd forget to update the
emacs package since it'll still work.

Does that make sense? It might be just a matter of taste, I don't have a
super strong opinion on this.

>                            "bin/emacs")
>                 #t)))
>           (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
> @@ -279,11 +280,10 @@ languages.")
>  
>  (define-public emacs-next
>    (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
> -        (revision "0")
> -        (emacs-version "28.0.50.1"))
> +        (revision "0"))
>      (package/inherit emacs
>        (name "emacs-next")
> -      (version (git-version emacs-version revision commit))
> +      (version (git-version "28.0.50" revision commit))
>        (source
>         (origin
>           (inherit (package-source emacs))
> @@ -295,24 +295,19 @@ languages.")
>           (sha256
>            (base32
>             "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
> -      (arguments
> -       (substitute-keyword-arguments (package-arguments emacs)
> -         ((#:phases phases)
> -          `(modify-phases ,phases
> -             (replace 'strip-double-wrap
> -               (lambda* (#:key outputs #:allow-other-keys)
> -                 ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> -                 ;; twice.  This also fixes a minor issue, where WMs would not be
> -                 ;; able to track emacs back to emacs.desktop.
> -                 (with-directory-excursion (assoc-ref outputs "out")
> -                   (copy-file (string-append
> -                               "bin/emacs-"
> -                               ,(version-major+minor+point (package-version emacs-next)))
> -                              "bin/emacs")
> -                   #t)))))))
>        (native-inputs
>         `(("autoconf" ,autoconf)
> -         ,@(package-native-inputs emacs))))))
> +         ,@(package-native-inputs emacs)))
> +
> +      (native-search-paths
> +       (list (search-path-specification
> +              (variable "EMACSLOADPATH")
> +              ;; The versioned entry is for the Emacs' builtin libraries.
> +              (files (list "share/emacs/site-lisp"
> +                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))

nit: This line seems to be a bit long.

> +             (search-path-specification
> +              (variable "INFOPATH")
> +              (files '("share/info"))))))))
>  
>  (define-public emacs-minimal
>    ;; This is the version that you should use as an input to packages that just


Thanks!
Pierre
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#43277; Package guix. (Sat, 26 Sep 2020 12:09:02 GMT) Full text and rfc822 format available.

Message #35 received at 43277 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
To: Pierre Langlois <pierre.langlois <at> gmx.com>
Cc: malte.f.gerdes <at> gmail.com, mike <at> rohleder.de, 43277 <at> debbugs.gnu.org,
 mjbecze <at> riseup.net
Subject: [PATCH] gnu: emacs-next: Fix load path and version
Date: Sat, 26 Sep 2020 08:08:23 -0400
Hi Pierre,

Thanks for the feedback!

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

> I agree in general it's good to reuse code, however in this particular
> case it's probably better to keep the phases duplicated.  For example,
> in the future one could update the emacs-next package to not require a
> revision number anymore, and it's likely they'd forget to update the
> emacs package since it'll still work.
>
> Does that make sense? It might be just a matter of taste, I don't have a
> super strong opinion on this.

It's important to realize that this is what caused the current problem
to begin with so in a way I agree. However, I think there is a big
difference between code that fails silently, and code that fails
loudly. The native search paths failed "silently" since the package
still built and even appeared to work (since the normal emacs with in my
path). copy-file, thankfully, fails very loudly since the package simply
won't build if it can't find the file to move. Plus the error message is
quite good (It can't find the file). For this reason, it's likely a good
thing that the native search paths code is duplicated, but I think the
stip-double-wrap phase should be reused.

Thanks,

Morgan




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 01 Oct 2020 12:38:02 GMT) Full text and rfc822 format available.

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Thu, 01 Oct 2020 15:05:02 GMT) Full text and rfc822 format available.

Notification sent to Martin Becze <mjbecze <at> riseup.net>:
bug acknowledged by developer. (Thu, 01 Oct 2020 15:05:02 GMT) Full text and rfc822 format available.

Message #42 received at 43277-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Pierre Langlois <pierre.langlois <at> gmx.com>
Cc: Morgan.J.Smith <at> outlook.com, malte.f.gerdes <at> gmail.com, mike <at> rohleder.de,
 43277-done <at> debbugs.gnu.org, mjbecze <at> riseup.net
Subject: Re: bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
Date: Thu, 01 Oct 2020 11:05:46 -0400
Hello!

[...]

>>  gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
>>  1 file changed, 16 insertions(+), 21 deletions(-)
>>
>> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
>> index 03c28ee7a7..b3d099257d 100644
>> --- a/gnu/packages/emacs.scm
>> +++ b/gnu/packages/emacs.scm
>> @@ -196,11 +196,12 @@
>>             (lambda* (#:key outputs #:allow-other-keys)
>>               ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
>>               ;; twice.  This also fixes a minor issue, where WMs would not be
>> -             ;; able to track emacs back to emacs.desktop.
>> +             ;; able to track emacs back to emacs.desktop.  It's done using
>> +             ;; this-package so emacs-next can reuse it
>>               (with-directory-excursion (assoc-ref outputs "out")
>>                 (copy-file (string-append
>>                             "bin/emacs-"
>> -                           ,(version-major+minor (package-version emacs)))
>> +                           ,(car (string-split (package-version this-package) #\-)))
>
> I agree in general it's good to reuse code, however in this particular
> case it's probably better to keep the phases duplicated.  For example,
> in the future one could update the emacs-next package to not require a
> revision number anymore, and it's likely they'd forget to update the
> emacs package since it'll still work.

It's unlikely the emacs-next package would be pegged against a stable
version, but in the event it would, the above code would still work.

[...]

>>         `(("autoconf" ,autoconf)
>> -         ,@(package-native-inputs emacs))))))
>> +         ,@(package-native-inputs emacs)))
>> +
>> +      (native-search-paths
>> +       (list (search-path-specification
>> +              (variable "EMACSLOADPATH")
>> +              ;; The versioned entry is for the Emacs' builtin libraries.
>> +              (files (list "share/emacs/site-lisp"
>> +                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
>
> nit: This line seems to be a bit long.

Reformatted, and edited the commit message to match our standards.

I made minor, cosmetic changes like below:

modified   gnu/packages/emacs.scm
@@ -196,12 +196,16 @@
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
              ;; twice.  This also fixes a minor issue, where WMs would not be
-             ;; able to track emacs back to emacs.desktop.  It's done using
-             ;; this-package so emacs-next can reuse it
+             ;; able to track emacs back to emacs.desktop.  The version is
+             ;; accessed using using THIS-PACKAGE so it "just works" for
+             ;; inherited Emacs packages of different versions.
              (with-directory-excursion (assoc-ref outputs "out")
                (copy-file (string-append
                            "bin/emacs-"
-                           ,(car (string-split (package-version this-package) #\-)))
+                           ,(let ((this-version (package-version this-package)))
+                              (or (false-if-exception
+                                   (version-major+minor+point this-version))
+                                  (version-major+minor this-version))))
                           "bin/emacs")
                #t)))
          (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
@@ -304,7 +308,9 @@ languages.")
               (variable "EMACSLOADPATH")
               ;; The versioned entry is for the Emacs' builtin libraries.
               (files (list "share/emacs/site-lisp"
-                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
+                           (string-append "share/emacs/"
+                                          (version-major+minor+point version)
+                                          "/lisp"))))
              (search-path-specification
               (variable "INFOPATH")
               (files '("share/info"))))))))

Verified it produced a correct EMACSLOADPATH and ran using:

--8<---------------cut here---------------start------------->8---
$ guix environment --pure --ad-hoc emacs-next
[...]
[env]$ echo $EMACSLOADPATH
/gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/site-lisp:/gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/28.0.50/

[env]$ emacs --version
GNU Emacs 28.0.50
--8<---------------cut here---------------end--------------->8---

And pushed to master as commit 0f88fea0eaa.

Thanks everyone!

Closing,

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Oct 2020 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.