GNU bug report logs - #53643
[PATCH] Gnu: Elixir: Use previous method for detecting sh

Previous Next

Package: guix-patches;

Reported by: John Hamelink <me <at> johnhame.link>

Date: Sun, 30 Jan 2022 21:18:01 UTC

Severity: normal

Tags: patch

Merged with 53708

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

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 53643 in the body.
You can then email your comments to 53643 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#53643; Package guix-patches. (Sun, 30 Jan 2022 21:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Hamelink <me <at> johnhame.link>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 30 Jan 2022 21:18:01 GMT) Full text and rfc822 format available.

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

From: John Hamelink <me <at> johnhame.link>
To: guix-patches <at> gnu.org
Subject: [PATCH] Gnu: Elixir: Use previous method for detecting sh
Date: Sun, 30 Jan 2022 21:15:17 +0000
[Message part 1 (text/plain, inline)]
gnu/packages/elixir.scm (elixir)[arguments]: Keep G-expressions, but use
========================================================================

WHICH instead of SEARCH-INPUT-FILES.

Signed-off-by: John Hamelink <me <at> johnhame.link>
---
 gnu/packages/elixir.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi there,

While following a tutorial, I found myself struggling to build
elixir. After discussing on #guix, and looking on the build server for
clues, it seems that the SEARCH-INPUT-FILE change in 3da297997d ("gnu:
elixir: Use G-expressions.")  was the culprit. Within the
G-expression, I reverted to the use of WHICH for the "sh" binary,
while leaving the others as they are.

I do not understand the differences between these two functions or why
SEARCH-INPUT-FILE is preferential, so there may be additional caveats I'm not
aware of that SEARCH-INPUT-FILE addresses.

Thanks
John

diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm
index 3fb74a56a5..5df50902ce 100644
--- a/gnu/packages/elixir.scm
+++ b/gnu/packages/elixir.scm
@@ -68,7 +68,7 @@ (define-public elixir
               (substitute* '("lib/mix/lib/mix/release.ex"
                              "lib/mix/lib/mix/tasks/release.init.ex")
                 (("#!/bin/sh")
- (string-append "#!" (search-input-file inputs "sh"))))
+ (string-append "#!" (which "sh"))))
  (substitute* "bin/elixir"
    (("^ERTS_BIN=$")
     (string-append
-- 
2.35.1
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#53643; Package guix-patches. (Sun, 30 Jan 2022 22:21:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: John Hamelink <me <at> johnhame.link>, 53643 <at> debbugs.gnu.org
Subject: Re: [bug#53643] [PATCH] Gnu: Elixir: Use previous method for
 detecting sh
Date: Sun, 30 Jan 2022 23:20:38 +0100
[Message part 1 (text/plain, inline)]
John Hamelink schreef op zo 30-01-2022 om 21:15 [+0000]:
> - (string-append "#!" (search-input-file inputs "sh"))))
> + (string-append "#!" (which "sh"))))

'which' looks in $PATH, which is formed by native-inputs,
so this change is incorrect when cross-compiling.

Instead, I suggest:

- (string-append "#!" (search-input-file inputs "sh"))))
+ (string-append "#!" (search-input-file inputs "bin/sh"))))

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

Information forwarded to guix-patches <at> gnu.org:
bug#53643; Package guix-patches. (Sun, 30 Jan 2022 22:23:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: John Hamelink <me <at> johnhame.link>, 53643 <at> debbugs.gnu.org
Subject: Re: [bug#53643] [PATCH] Gnu: Elixir: Use previous method for
 detecting sh
Date: Sun, 30 Jan 2022 23:22:09 +0100
[Message part 1 (text/plain, inline)]
John Hamelink schreef op zo 30-01-2022 om 21:15 [+0000]:
> gnu/packages/elixir.scm (elixir)[arguments]: Keep G-expressions, but
> use
> =====================================================================
> ===
> 
> WHICH instead of SEARCH-INPUT-FILES.
> 
> Signed-off-by: John Hamelink <me <at> johnhame.link>

That's not how Signed-off-by is used in Guix; Guix assigns a different
(albeit slightly related) meaning to Signed-off-by than Linux does, see
(guix)Commit access:

   When pushing a commit on behalf of somebody else, please add a
‘Signed-off-by’ line at the end of the commit log message—e.g., with
‘git am --signoff’.  This improves tracking of who did what.

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

Information forwarded to guix-patches <at> gnu.org:
bug#53643; Package guix-patches. (Sun, 30 Jan 2022 22:24:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: John Hamelink <me <at> johnhame.link>, 53643 <at> debbugs.gnu.org
Subject: Re: [bug#53643] [PATCH] Gnu: Elixir: Use previous method for
 detecting sh
Date: Sun, 30 Jan 2022 23:23:08 +0100
[Message part 1 (text/plain, inline)]
John Hamelink schreef op zo 30-01-2022 om 21:15 [+0000]:
> [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh

The package is named 'elixir', not 'Elixir'. The directory is
$CHECKOUT/gnu, not $CHECKOUT/Gnu.

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

Information forwarded to guix-patches <at> gnu.org:
bug#53643; Package guix-patches. (Sun, 30 Jan 2022 23:18:01 GMT) Full text and rfc822 format available.

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

From: John Hamelink <me <at> johnhame.link>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 53643 <at> debbugs.gnu.org
Subject: Re: [bug#53643] [PATCH] gnu: elixir: Use previous method for
 detecting sh
Date: Sun, 30 Jan 2022 23:08:56 +0000
[Message part 1 (text/plain, inline)]
Hi Maxime,

Thanks for looking over my submission. I agree on all points.

> - (string-append "#!" (search-input-file inputs "sh"))))
> + (string-append "#!" (search-input-file inputs "bin/sh"))))

The rest of the file's usage of search-input-file involves a
forward-slash before bin. I tried including the forward-slash and
leaving it out in all relevant places, and it doesn't seem like it
makes a difference - I didn't try to cross-compile, though. Regardless,
I made a patch for each option.

---
 gnu/packages/elixir.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm
index 3fb74a56a5..fae8279e5c 100644
--- a/gnu/packages/elixir.scm
+++ b/gnu/packages/elixir.scm
@@ -68,7 +68,7 @@ (define-public elixir
               (substitute* '("lib/mix/lib/mix/release.ex"
                              "lib/mix/lib/mix/tasks/release.init.ex")
                 (("#!/bin/sh")
- (string-append "#!" (search-input-file inputs "sh"))))
+ (string-append "#!" (search-input-file inputs "/bin/sh"))))
  (substitute* "bin/elixir"
    (("^ERTS_BIN=$")
     (string-append
-- 
2.35.1

---
 gnu/packages/elixir.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm
index 3fb74a56a5..2fee929d6a 100644
--- a/gnu/packages/elixir.scm
+++ b/gnu/packages/elixir.scm
@@ -64,11 +64,11 @@ (define-public elixir
                              "lib/mix/lib/mix/scm/git.ex")
                 (("(cmd\\(['\"])git" _ prefix)
                  (string-append prefix
- (search-input-file inputs "/bin/git"))))
+ (search-input-file inputs "bin/git"))))
  (substitute* '("lib/mix/lib/mix/release.ex"
  	       "lib/mix/lib/mix/tasks/release.init.ex")
    (("#!/bin/sh")
- (string-append "#!" (search-input-file inputs "sh"))))
+ (string-append "#!" (search-input-file inputs "bin/sh"))))
  (substitute* "bin/elixir"
    (("^ERTS_BIN=$")
     (string-append
@@ -79,7 +79,7 @@ (define-public elixir
                   ;; are not in release mode and can point to the actual erl
                   ;; binary in Guix store.
                   "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN="
- (string-drop-right (search-input-file inputs "/bin/erl") 3)
+ (string-drop-right (search-input-file inputs "bin/erl") 3)
      "; fi\n")))
  (substitute* "bin/mix"
    (("#!/usr/bin/env elixir")
-- 
2.35.1
[signature.asc (application/pgp-signature, inline)]

Merged 53643 53708. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 14 Feb 2022 13:38:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#53643; Package guix-patches. (Mon, 14 Feb 2022 14:53:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: John Hamelink <me <at> johnhame.link>
Cc: 53643-done <at> debbugs.gnu.org, Cees de Groot <cg <at> evrl.com>
Subject: Re: bug#53643: [PATCH] Gnu: Elixir: Use previous method for
 detecting sh
Date: Mon, 14 Feb 2022 15:52:19 +0100
Hi,

> While following a tutorial, I found myself struggling to build
> elixir. After discussing on #guix, and looking on the build server for
> clues, it seems that the SEARCH-INPUT-FILE change in 3da297997d ("gnu:
> elixir: Use G-expressions.")  was the culprit. Within the
> G-expression, I reverted to the use of WHICH for the "sh" binary,
> while leaving the others as they are.

Fixed along the lines of what Maxime and Cees suggested.

Thanks,
Ludo’.




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

This bug report was last modified 3 years and 153 days ago.

Previous Next


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