* [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh
@ 2022-01-30 21:15 John Hamelink
2022-01-30 22:20 ` Maxime Devos
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: John Hamelink @ 2022-01-30 21:15 UTC (permalink / raw)
To: 53643
[-- Attachment #1.1.1: Type: text/plain, Size: 1479 bytes --]
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
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh
2022-01-30 21:15 [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh John Hamelink
@ 2022-01-30 22:20 ` Maxime Devos
2022-01-30 23:08 ` [bug#53643] [PATCH] gnu: elixir: " John Hamelink
2022-01-30 22:22 ` [bug#53643] [PATCH] Gnu: Elixir: " Maxime Devos
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Maxime Devos @ 2022-01-30 22:20 UTC (permalink / raw)
To: John Hamelink, 53643
[-- Attachment #1: Type: text/plain, Size: 439 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh
2022-01-30 21:15 [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh John Hamelink
2022-01-30 22:20 ` Maxime Devos
@ 2022-01-30 22:22 ` Maxime Devos
2022-01-30 22:23 ` Maxime Devos
2022-02-14 14:52 ` Ludovic Courtès
3 siblings, 0 replies; 6+ messages in thread
From: Maxime Devos @ 2022-01-30 22:22 UTC (permalink / raw)
To: John Hamelink, 53643
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh
2022-01-30 21:15 [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh John Hamelink
2022-01-30 22:20 ` Maxime Devos
2022-01-30 22:22 ` [bug#53643] [PATCH] Gnu: Elixir: " Maxime Devos
@ 2022-01-30 22:23 ` Maxime Devos
2022-02-14 14:52 ` Ludovic Courtès
3 siblings, 0 replies; 6+ messages in thread
From: Maxime Devos @ 2022-01-30 22:23 UTC (permalink / raw)
To: John Hamelink, 53643
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#53643] [PATCH] gnu: elixir: Use previous method for detecting sh
2022-01-30 22:20 ` Maxime Devos
@ 2022-01-30 23:08 ` John Hamelink
0 siblings, 0 replies; 6+ messages in thread
From: John Hamelink @ 2022-01-30 23:08 UTC (permalink / raw)
To: Maxime Devos; +Cc: 53643
[-- Attachment #1.1.1: Type: text/plain, Size: 2468 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh
2022-01-30 21:15 [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh John Hamelink
` (2 preceding siblings ...)
2022-01-30 22:23 ` Maxime Devos
@ 2022-02-14 14:52 ` Ludovic Courtès
3 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2022-02-14 14:52 UTC (permalink / raw)
To: John Hamelink; +Cc: 53643-done, Cees de Groot
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’.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-02-14 15:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-30 21:15 [bug#53643] [PATCH] Gnu: Elixir: Use previous method for detecting sh John Hamelink
2022-01-30 22:20 ` Maxime Devos
2022-01-30 23:08 ` [bug#53643] [PATCH] gnu: elixir: " John Hamelink
2022-01-30 22:22 ` [bug#53643] [PATCH] Gnu: Elixir: " Maxime Devos
2022-01-30 22:23 ` Maxime Devos
2022-02-14 14:52 ` Ludovic Courtès
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).