unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43277: emacs-next is broke, "seq" missing
@ 2020-09-08 12:13 Martin Becze
  2020-09-08 12:40 ` Malte Gerdes
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Martin Becze @ 2020-09-08 12:13 UTC (permalink / raw)
  To: 43277


[-- Attachment #1.1: Type: text/plain, Size: 248 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43277: emacs-next is broke, "seq" missing
  2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
@ 2020-09-08 12:40 ` Malte Gerdes
  2020-09-08 13:17   ` Martin Becze
  2020-09-08 14:01 ` Michael Rohleder
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Malte Gerdes @ 2020-09-08 12:40 UTC (permalink / raw)
  To: Martin Becze; +Cc: 43277

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

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@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.
>
>

[-- Attachment #2: Type: text/html, Size: 904 bytes --]

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

* bug#43277: emacs-next is broke, "seq" missing
  2020-09-08 12:40 ` Malte Gerdes
@ 2020-09-08 13:17   ` Martin Becze
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Becze @ 2020-09-08 13:17 UTC (permalink / raw)
  To: Malte Gerdes; +Cc: 43277


[-- Attachment #1.1: Type: text/plain, Size: 774 bytes --]

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@riseup.net
> <mailto:mjbecze@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.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43277: emacs-next is broke, "seq" missing
  2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
  2020-09-08 12:40 ` Malte Gerdes
@ 2020-09-08 14:01 ` Michael Rohleder
  2020-09-08 15:07   ` Martin Becze
  2020-09-11 20:09 ` Pierre Langlois
  2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
  3 siblings, 1 reply; 11+ messages in thread
From: Michael Rohleder @ 2020-09-08 14:01 UTC (permalink / raw)
  To: Martin Becze; +Cc: 43277

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

Hi Martin,

Martin Becze <mjbecze@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

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

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

* bug#43277: emacs-next is broke, "seq" missing
  2020-09-08 14:01 ` Michael Rohleder
@ 2020-09-08 15:07   ` Martin Becze
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Becze @ 2020-09-08 15:07 UTC (permalink / raw)
  To: Michael Rohleder; +Cc: 43277


[-- Attachment #1.1: Type: text/plain, Size: 485 bytes --]

--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@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)
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43277: emacs-next is broke, "seq" missing
  2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
  2020-09-08 12:40 ` Malte Gerdes
  2020-09-08 14:01 ` Michael Rohleder
@ 2020-09-11 20:09 ` Pierre Langlois
  2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
  3 siblings, 0 replies; 11+ messages in thread
From: Pierre Langlois @ 2020-09-11 20:09 UTC (permalink / raw)
  To: Martin Becze; +Cc: 43277

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

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

   


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

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

* bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
  2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
                   ` (2 preceding siblings ...)
  2020-09-11 20:09 ` Pierre Langlois
@ 2020-09-14 22:08 ` Morgan.J.Smith
  2020-09-22 13:05   ` Morgan Smith
  2020-09-22 18:35   ` Pierre Langlois
  3 siblings, 2 replies; 11+ messages in thread
From: Morgan.J.Smith @ 2020-09-14 22:08 UTC (permalink / raw)
  To: 43277; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@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





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

* bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
  2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
@ 2020-09-22 13:05   ` Morgan Smith
  2020-09-22 18:35   ` Pierre Langlois
  1 sibling, 0 replies; 11+ messages in thread
From: Morgan Smith @ 2020-09-22 13:05 UTC (permalink / raw)
  To: guix-devel; +Cc: 43277

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@outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith@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




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

* bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
  2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
  2020-09-22 13:05   ` Morgan Smith
@ 2020-09-22 18:35   ` Pierre Langlois
  2020-09-26 12:08     ` Morgan Smith
  2020-10-01 15:05     ` Maxim Cournoyer
  1 sibling, 2 replies; 11+ messages in thread
From: Pierre Langlois @ 2020-09-22 18:35 UTC (permalink / raw)
  To: Morgan.J.Smith; +Cc: 43277

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

Hi Morgan,

Morgan.J.Smith@outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith@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

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

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

* bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
  2020-09-22 18:35   ` Pierre Langlois
@ 2020-09-26 12:08     ` Morgan Smith
  2020-10-01 15:05     ` Maxim Cournoyer
  1 sibling, 0 replies; 11+ messages in thread
From: Morgan Smith @ 2020-09-26 12:08 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: 43277

Hi Pierre,

Thanks for the feedback!

Pierre Langlois <pierre.langlois@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




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

* bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
  2020-09-22 18:35   ` Pierre Langlois
  2020-09-26 12:08     ` Morgan Smith
@ 2020-10-01 15:05     ` Maxim Cournoyer
  1 sibling, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2020-10-01 15:05 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: Morgan.J.Smith, 43277-done

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




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

end of thread, other threads:[~2020-10-01 15:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
2020-09-08 12:40 ` Malte Gerdes
2020-09-08 13:17   ` Martin Becze
2020-09-08 14:01 ` Michael Rohleder
2020-09-08 15:07   ` Martin Becze
2020-09-11 20:09 ` Pierre Langlois
2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
2020-09-22 13:05   ` Morgan Smith
2020-09-22 18:35   ` Pierre Langlois
2020-09-26 12:08     ` Morgan Smith
2020-10-01 15:05     ` Maxim Cournoyer

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).