GNU bug report logs - #34187
[PATCH] gnu: emacs-ert-runner: Fix lisp directory warning.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 24 Jan 2019 04:51:02 UTC

Severity: normal

Tags: patch

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 34187 in the body.
You can then email your comments to 34187 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 guix-patches <at> gnu.org:
bug#34187; Package guix-patches. (Thu, 24 Jan 2019 04:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 24 Jan 2019 04:51:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: emacs-ert-runner: Fix lisp directory warning.
Date: Wed, 23 Jan 2019 23:35:19 -0500
[Message part 1 (text/plain, inline)]
Hello!

This fixes an annoyance where a warning would be print every time
ert-runner was executed, like:

--8<---------------cut here---------------start------------->8---
ert-runner --version
Warning: Lisp directory '/tmp/guix-build-emacs-ert-runner-0.7.0.drv-0/ert-runner.el-0.7.0': No such file or directory
Option ‘--version‘ not available
--8<---------------cut here---------------end--------------->8---

Thank you,

Maxim

[0001-gnu-emacs-ert-runner-Fix-lisp-directory-warning.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#34187; Package guix-patches. (Tue, 29 Jan 2019 22:37:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 34187 <at> debbugs.gnu.org
Subject: Re: [bug#34187] [PATCH] gnu: emacs-ert-runner: Fix lisp directory
 warning.
Date: Tue, 29 Jan 2019 23:36:57 +0100
Hello,

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

>>From 532f0dfeaa5f9aa7c03916afc843d5556a12f53c Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
> Date: Tue, 22 Jan 2019 05:33:19 +0000
> Subject: [PATCH] gnu: emacs-ert-runner: Fix lisp directory warning.
>
> This fixes the warning message such as: "Warning: Lisp directory
> '/tmp/guix-build-emacs-ert-runner-0.7.0-1.90b8fdd.drv-0/source': No such file
> or directory" that would be printed upon running ert-runner.
>
> * gnu/packages/emacs-xyz.scm (emacs-ert-runner)[modules]: Add (srfi srfi-1) to
> the list of used modules.
> [phases]{install-executable}: Compute SOURCE-DRV and filter it out from the
> paths composing the EMACSLOADPATH variable used in the wrapper.

Good catch!

>                   (wrap-program (string-append out "/bin/ert-runner")
>                     (list "EMACSLOADPATH" ":" 'prefix
> -                         (string-split (getenv "EMACSLOADPATH") #\:)))
> +                         ;; Do not capture the transient source directory in
> +                         ;; the wrapper.
> +                         (remove (lambda (p)
> +                                   (string=? p source-drv))
> +                                 (string-split (getenv "EMACSLOADPATH") #\:))))

Or simply: (delete source-drv (string-split (getenv "EMACSLOADPATH") #\:))).

> +                     (source-drv (string-append
> +                                  "/tmp/guix-build-" ,name "-" ,version
> +                                  ".drv-0/source")))

Actually ‘source-drv’ is misleading because it’s not a derivation.  How
about ‘source’, ‘source-directory’, or something like that?

Instead of hardcoding /tmp/guix-build-*, you could just use (getcwd), if
I’m not mistaken.

OK with changes along these lines, thanks!

Ludo’.




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Tue, 05 Feb 2019 15:12:03 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Tue, 05 Feb 2019 15:12:06 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 34187-done <at> debbugs.gnu.org
Subject: Re: [bug#34187] [PATCH] gnu: emacs-ert-runner: Fix lisp directory
 warning.
Date: Tue, 05 Feb 2019 10:11:26 -0500
Hello, and sorry for the delay!

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello,
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>
>>>From 532f0dfeaa5f9aa7c03916afc843d5556a12f53c Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
>> Date: Tue, 22 Jan 2019 05:33:19 +0000
>> Subject: [PATCH] gnu: emacs-ert-runner: Fix lisp directory warning.
>>
>> This fixes the warning message such as: "Warning: Lisp directory
>> '/tmp/guix-build-emacs-ert-runner-0.7.0-1.90b8fdd.drv-0/source': No such file
>> or directory" that would be printed upon running ert-runner.
>>
>> * gnu/packages/emacs-xyz.scm (emacs-ert-runner)[modules]: Add (srfi srfi-1) to
>> the list of used modules.
>> [phases]{install-executable}: Compute SOURCE-DRV and filter it out from the
>> paths composing the EMACSLOADPATH variable used in the wrapper.
>
> Good catch!
>
>>                   (wrap-program (string-append out "/bin/ert-runner")
>>                     (list "EMACSLOADPATH" ":" 'prefix
>> -                         (string-split (getenv "EMACSLOADPATH") #\:)))
>> +                         ;; Do not capture the transient source directory in
>> +                         ;; the wrapper.
>> +                         (remove (lambda (p)
>> +                                   (string=? p source-drv))
>> +                                 (string-split (getenv "EMACSLOADPATH") #\:))))
>
> Or simply: (delete source-drv (string-split (getenv "EMACSLOADPATH") #\:))).

This is much simpler, thanks!

>> +                     (source-drv (string-append
>> +                                  "/tmp/guix-build-" ,name "-" ,version
>> +                                  ".drv-0/source")))
>
> Actually ‘source-drv’ is misleading because it’s not a derivation.  How
> about ‘source’, ‘source-directory’, or something like that?

Right. I've settled for source-directory.

> Instead of hardcoding /tmp/guix-build-*, you could just use (getcwd), if
> I’m not mistaken.

(getcwd) wasn't in the tmp directory (it should be in the store IIRC,
since we byte-compile the files in-place after installing them), but
(getenv "TMPDIR") returned exactly what was needed.

> OK with changes along these lines, thanks!

The changes read as:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/emacs-xyz.scm
@@ -6955,18 +6955,13 @@ Emacs.")
          ("emacs-s" ,emacs-s)
          ("emacs-shut-up" ,emacs-shut-up)))
       (arguments
-       `(#:modules ((guix build emacs-build-system)
-                    (guix build emacs-utils)
-                    (guix build utils)
-                    (srfi srfi-1))      ;for `remove'
-         #:phases
+       `(#:phases
          (modify-phases %standard-phases
            (add-after 'install 'install-executable
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let ((out (assoc-ref outputs "out"))
-                     (source-drv (string-append
-                                  "/tmp/guix-build-" ,name "-" ,version
-                                  ".drv-0/source")))
+                     (source-directory (string-append
+                                  (getenv "TMPDIR") "/source")))
                  (substitute* "bin/ert-runner"
                    (("ERT_RUNNER=\"\\$\\(dirname \\$\\(dirname \\$0\\)\\)")
                     (string-append "ERT_RUNNER=\"" out
@@ -6977,8 +6972,7 @@ Emacs.")
                    (list "EMACSLOADPATH" ":" 'prefix
                          ;; Do not capture the transient source directory in
                          ;; the wrapper.
-                         (remove (lambda (p)
-                                   (string=? p source-drv))
+                         (delete source-directory
                                  (string-split (getenv "EMACSLOADPATH") #\:))))
                  #t))))
          #:include (cons* "^reporters/.*\\.el$" %default-include)))
--8<---------------cut here---------------end--------------->8---

And the commit message was also reworded.

Pushed to master with commit f9dff4f7f.

Thank you!

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Mar 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 51 days ago.

Previous Next


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