diff mbox series

[bug#53643] Gnu: Elixir: Use previous method for detecting sh

Message ID 878ruwexe3.fsf@johnhame.link
State Accepted
Headers show
Series [bug#53643] Gnu: Elixir: Use previous method for detecting sh | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

John Hamelink Jan. 30, 2022, 9:15 p.m. UTC
gnu/packages/elixir.scm (elixir)[arguments]: Keep G-expressions, but use
========================================================================

WHICH instead of SEARCH-INPUT-FILES.

Signed-off-by: John Hamelink <me@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

Comments

M Jan. 30, 2022, 10:20 p.m. UTC | #1
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.
M Jan. 30, 2022, 10:22 p.m. UTC | #2
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@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.
M Jan. 30, 2022, 10:23 p.m. UTC | #3
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.
Ludovic Courtès Feb. 14, 2022, 2:52 p.m. UTC | #4
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’.
diff mbox series

Patch

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