[PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Maxime Devos
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 18 Apr 2021 13:20
(address . guix-patches@gnu.org)
b924afb2f939b7b3a31cf77e0b8b955439425cb8.camel@telenet.be
The procedure ‘which’ from (guix build utils)
is used for two different purposes:

1. for finding the absolute file name of a binary
that we need to run during the build process

2. for finding the absolute file name of a binary,
for the target system (as in --target=TARGET),
e.g. for substituting sh->/gnu/store/.../bin/sh,
python->/gnu/store/.../bin/python

When compiling natively (SYSTEM=TARGET modulo nix/autotools differences),
this is perfectly fine.

However, when cross-compiling, we have a problem.
"which" looks in $PATH for binaries. That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

Admittedly, ‘which’ is simply very convenient (although incorrect
when cross-compiling), and we don't have the right tool ...
until now, that is (see patch)!

This patch adds an optional 'inputs' argument. When it is present,
'which' will look in the bin and sbin subdirectories of the directories
in the 'inputs' alist.

Use it like this:

(package [...]
(arguments
`(#:modules (guix build utils)
#:phases
(modify-phases %standard-phases
(delete 'configure)
(delete 'check)
(add-after 'install 'wrap
(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((growpart (string-append (assoc-ref outputs "out")
"/bin/growpart")))
(wrap-program growpart
`("PATH" ":" prefix (,(dirname (which "sfdisk" inputs))
,(dirname (which "readlink" inputs)))))))))))

(Examples comes from the "cloud-utils" package)
The only change is adding adding the 'inputs' argument. Isn't that easy?

Alternative methods I've seen:
* (string-append (assoc-ref inputs "coreutils") "/bin/readlink")
* (let ((coreutils (assoc-ref inputs "coreutils")))
(setenv "PATH" (string-append coreutils "/bin"))
[code using (which "readlink")])
* (which "readlink") ; possibly incorrect when cross-compiling

I've tested this with "cloud-utils", though admittedly I didn't try to cross-compile
yet, and I've placed my adjusted "which" in a separate module to avoid having to rebuild
everything. (The attached patch just modifies (guix build utils).) I've written
a few tests, which pass. I also documented the new functionality in the manual.

Currently incorrect uses of "which" can be fixed in a follow-up patch.

Thoughts?
Maxime.
Attachment: file
From 6561c943fa134ca1e2a17e43f8f5498fca9b1560 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sun, 18 Apr 2021 13:15:08 +0200
Subject: [PATCH 2/2] =?UTF-8?q?doc:=20Document=20new=20functionality=20of?=
=?UTF-8?q?=20=E2=80=98which=E2=80=99.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/guix.texi (File Search)[which]: Document the optional
'inputs' argument, and give an example on how to use the
procedure.
---
doc/guix.texi | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

Toggle diff (42 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6464fa32cb..365cb13604 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -87,6 +87,7 @@ Copyright @copyright{} 2020 Daniel Brooks@*
Copyright @copyright{} 2020 John Soo@*
Copyright @copyright{} 2020 Jonathan Brielmaier@*
Copyright @copyright{} 2020 Edgar Vincent@*
+Copyright @copyright{} 2021 Maxime Devos@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -8598,11 +8599,25 @@ the root of the Guix source tree:
@result{} ("./libformat.a" "./libstore.a" @dots{})
@end lisp
-@deffn {Scheme Procedure} which @var{program}
+@deffn {Scheme Procedure} which @var{program} [@var{inputs}=#false]
Return the complete file name for @var{program} as found in
-@code{$PATH}, or @code{#f} if @var{program} could not be found.
+@code{$PATH}, or @code{#false} if @var{program} could not be found.
+If @var{INPUTS} is not @code{#false}, instead look in the
+@file{/bin} and @file{/sbin} subdirectories of @var{INPUTS}.
+@var{inputs} is an alist; its keys are ignored."
@end deffn
+Here is an example using the @code{which} procedure in a build phase:
+
+@lisp
+(lambda* (#:key outputs inputs #:allow-other-keys)
+ (let ((growpart (string-append (assoc-ref outputs "out")
+ "/bin/growpart")))
+ (wrap-program growpart
+ `("PATH" ":" prefix (,(dirname (which "sfdisk" inputs))
+ ,(dirname (which "readlink" inputs)))))))
+@end lisp
+
@subsection Build Phases
@cindex build phases
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHwV+xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7r2/AP4hU2XQPn+le3JfU7/cCobGnlXJ
npfGlgydOpvNVuhJeAEAti0f3F1y/3SMnZnZbYl8q4Ub7FexwiYUGEs3UedKPgs=
=hpVX
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 19 Apr 2021 21:04
[PATCH v2 core-updates] various cross-compilation fixes in guix/build/utils.scm
(address . 47869@debbugs.gnu.org)
0892bdfbc097b07631190c8526a41d57b456d343.camel@telenet.be
This is version two of the patch series, removing a 'pk' that
I added for debugging, and also fixing 'wrap-script' and 'wrap-program'.
To fix 'wrap-script' and 'wrap-program', I added a required 'inputs' argument.
All callers have been adjusted to pass it.

Perhaps 'patch-shebang' can be fixed and needs to be fixed, but I don't
have investigated that closely yet. ('patch-shebangs' (with a #\s) works
properly IIUC).

Greetings,
Maxime.
Attachment: file
From fc4419098213673f713181d75f98df30255bd62c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sun, 18 Apr 2021 13:15:08 +0200
Subject: [PATCH 2/7] =?UTF-8?q?doc:=20Document=20new=20functionality=20of?=
=?UTF-8?q?=20=E2=80=98which=E2=80=99.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/guix.texi (File Search)[which]: Document the optional
'inputs' argument, and give an example on how to use the
procedure.
---
doc/guix.texi | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a89701dd68..e8a9a31e1a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8679,11 +8679,25 @@ the root of the Guix source tree:
@result{} ("./libformat.a" "./libstore.a" @dots{})
@end lisp
-@deffn {Scheme Procedure} which @var{program}
+@deffn {Scheme Procedure} which @var{program} [@var{inputs}=#false]
Return the complete file name for @var{program} as found in
-@code{$PATH}, or @code{#f} if @var{program} could not be found.
+@code{$PATH}, or @code{#false} if @var{program} could not be found.
+If @var{INPUTS} is not @code{#false}, instead look in the
+@file{/bin} and @file{/sbin} subdirectories of @var{INPUTS}.
+@var{inputs} is an alist; its keys are ignored.
@end deffn
+Here is an example using the @code{which} procedure in a build phase:
+
+@lisp
+(lambda* (#:key outputs inputs #:allow-other-keys)
+ (let ((growpart (string-append (assoc-ref outputs "out")
+ "/bin/growpart")))
+ (wrap-program growpart
+ `("PATH" ":" prefix (,(dirname (which "sfdisk" inputs))
+ ,(dirname (which "readlink" inputs)))))))
+@end lisp
+
@subsection Build Phases
@cindex build phases
--
2.31.1
From a2b93f190123f9e0bba0ba5b2bf14e4e952ecfe8 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sun, 18 Apr 2021 21:17:01 +0200
Subject: [PATCH 4/7] doc: Document 'wrap-script'.

* doc/guix.texi (Wrapping Code)[wrap-script]: New section.
Document 'wrap-script'. Reuse its docstring.
---
doc/guix.texi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (34 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index e8a9a31e1a..a2ff13fe0f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8698,6 +8698,27 @@ Here is an example using the @code{which} procedure in a build phase:
,(dirname (which "readlink" inputs)))))))
@end lisp
+@subsection Wrapping Code
+
+This section documents procedures that create ‘wrappers’ around existing
+binaries, that e.g. set environment variables required during execution.
+
+@c TODO document wrap-program
+
+@deffn {Scheme Procedure} wrap-script @var{prog} @var{inputs} @var{vars}
+Wrap the script @var{prog} such that @var{vars} are set first. The format
+of @var{vars} is the same as in the @code{wrap-program} procedure. This
+procedure differs from @code{wrap-program} in that it does not create a
+separate shell script. Instead, @var{prog} is modified directly by prepending
+a Guile script, which is interpreted as a comment in the script's language.
+
+Special encoding comments as supported by Python are recreated on the second
+line.
+
+Note that this procedure can only be used once per file as Guile scripts are
+not supported.
+@end deffn
+
@subsection Build Phases
@cindex build phases
--
2.31.1
From 9991ce1e78e9753ddf1dfe24595b7ea82476578e Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sun, 18 Apr 2021 22:01:10 +0200
Subject: [PATCH 5/7] tests: build-utils: Remove obsolete comment.

* tests/build-utils.scm
("wrap-program, one input, multiple calls"): Remove obsolete, and now
factually incorrect comment, that claimed this test creates a symlink.
---
tests/build-utils.scm | 4 ----
1 file changed, 4 deletions(-)

Toggle diff (17 lines)
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 620cddbbfc..a5dfab576d 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -107,10 +107,6 @@
bash)))
(chmod foo #o777)
- ;; wrap-program uses `which' to find bash for the wrapper shebang, but
- ;; it can't know about the bootstrap bash in the store, since it's not
- ;; named "bash". Help it out a bit by providing a symlink it this
- ;; package's output.
(with-environment-variable "PATH" (dirname bash)
(wrap-program foo `("GUIX_FOO" prefix ("hello")))
(wrap-program foo `("GUIX_BAR" prefix ("world")))
--
2.31.1
Attachment: file
From cdd45bc0aef8b6cb60d351a8fded18700804e8db Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 19 Apr 2021 19:54:53 +0200
Subject: [PATCH 7/7] doc: Document 'wrap-program'.

* doc/guix.texi (Wrapping Code)[wrap-program]: Copy docstring from
guix/build/utils.scm and use Texinfo markup.
---
doc/guix.texi | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)

Toggle diff (50 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a2ff13fe0f..6235ae9bf7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8703,7 +8703,42 @@ Here is an example using the @code{which} procedure in a build phase:
This section documents procedures that create ‘wrappers’ around existing
binaries, that e.g. set environment variables required during execution.
-@c TODO document wrap-program
+@deffn {Scheme Procedure} wrap-program @var{prog} @var{inputs} @var{vars}
+Make a wrapper for @var{prog}. @var{vars} should look like this:
+
+@lisp
+ '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
+@end lisp
+
+where @var{delimiter} is optional. @samp{:} will be used if @var{delimiter}
+is not given.
+
+For example, this command:
+
+@lisp
+ (wrap-program "foo"
+ '("PATH" ":" = ("/gnu/.../bar/bin"))
+ '("CERT_PATH" suffix ("/gnu/.../baz/certs"
+ "/qux/certs")))
+@end lisp
+
+will copy @file{foo} to @file{.foo-real} and create the file @file{foo} with
+the following contents:
+
+@example
+ #!location/of/bin/bash
+ export PATH="/gnu/.../bar/bin"
+ export CERT_PATH="$CERT_PATH$@{CERT_PATH:+:@}/gnu/.../baz/certs:/qux/certs"
+ exec -a $0 location/of/.foo-real "$@@"
+@end example
+
+This is useful for scripts that expect particular programs to be in @env{PATH},
+for programs that expect particular shared libraries to be in
+@env{LD_LIBRARY_PATH}, or modules in @env{GUILE_LOAD_PATH}, etc.
+
+If @var{prog} has previously been wrapped by @code{wrap-program} the wrapper is
+extended with definitions for @var{vars}.
+@end deffn
@deffn {Scheme Procedure} wrap-script @var{prog} @var{inputs} @var{vars}
Wrap the script @var{prog} such that @var{vars} are set first. The format
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYH3USBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7n2wAP9ItQ56wb2cqCOlvAf1+tXmW/zT
doT8EKmioF2N2yqzcgEAihAT4e2t6YzSk8e7V0SIXMM4yp6DWWPgNiSfZ2cV5Ag=
=MaHM
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 18 May 2021 22:51
Re: bug#47869: [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 47869@debbugs.gnu.org)
87v97f7oll.fsf_-_@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (9 lines)
> This is version two of the patch series, removing a 'pk' that
> I added for debugging, and also fixing 'wrap-script' and 'wrap-program'.
> To fix 'wrap-script' and 'wrap-program', I added a required 'inputs' argument.
> All callers have been adjusted to pass it.
>
> Perhaps 'patch-shebang' can be fixed and needs to be fixed, but I don't
> have investigated that closely yet. ('patch-shebangs' (with a #\s) works
> properly IIUC).

Thanks for this long patch series, and sorry for the equally long delay!

Since we don’t get to change those interfaces very often, I’m going to
nitpick somewhat because I think we’d rather get them right.

Toggle quote (20 lines)
> From 42e7cf4ca6e4d6e1cd31c2807f608275a5ca759a Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Sun, 18 Apr 2021 12:45:13 +0200
> Subject: [PATCH 1/7] build: Add argument to which for specifying where to
> search.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The procedure ‘which’ from (guix build utils)
> is used for two different purposes:
>
> 1. for finding the absolute file name of a binary
> that needs to run during the build process
>
> 2. for finding the absolute file name of a binary,
> for the target system (as in --target=TARGET),
> e.g. for substituting sh->/gnu/store/.../bin/sh,
> python->/gnu/store/.../bin/python.

But note that only #1 is the intended purpose.

Toggle quote (3 lines)
> When compiling natively (SYSTEM=TARGET modulo nix/autotools differences),
> this is perfectly fine.

Rather “target=#f” in Guix parlance

[...]

Toggle quote (6 lines)
> +(define* (which program #:optional inputs)
> + "Return the complete file name for PROGRAM as found in $PATH, or #false if
> +PROGRAM could not be found. If INPUTS is not #false, instead look in the
> +/bin and /sbin subdirectories of INPUTS. INPUTS is an alist; its keys
> +are ignored."

I find that this leads to a weird interface; ‘which’ is intended to be
like the same-named shell command, and the notion of “input alists”
seems out of place to me.

I was thinking we could make it:

Toggle snippet (7 lines)
(define* (which program #:optional
(path (search-path-as-string->list (getenv "PATH"))))
"Return the complete file name for PROGRAM as found in $PATH, or #f if
PROGRAM could not be found."
(search-path path program))

… but that doesn’t buy us much.

I think what we need is to do is find and fix misuses of ‘which’.

WDYT?


[...]

Toggle quote (10 lines)
> +Here is an example using the @code{which} procedure in a build phase:
> +
> +@lisp
> +(lambda* (#:key outputs inputs #:allow-other-keys)
> + (let ((growpart (string-append (assoc-ref outputs "out")
> + "/bin/growpart")))
> + (wrap-program growpart
> + `("PATH" ":" prefix (,(dirname (which "sfdisk" inputs))
> + ,(dirname (which "readlink" inputs)))))))

That looks weird to me. The “correct” way we do it right now is like
this:

(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(curl (assoc-ref inputs "curl")))
(wrap-program (string-append out "/bin/akku")
`("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
#t))

Here, when cross-compiling, (assoc-ref inputs "curl") returns the target
cURL.

Toggle quote (14 lines)
> From e78d2d8651d5f56afa7d57be78c5cccccebb117a Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Sun, 18 Apr 2021 20:44:28 +0200
> Subject: [PATCH 3/7] build: utils: Make inputs of 'wrap-script' explicit.
>
> Previously, 'wrap-script' used (which "guile") to determine where to locate
> the guile interpreter. But this is incorrect when cross-compiling. When
> cross-compiling, this would locate the (native) guile interpreter that is
> in the PATH, while a guile interpreter for the target is required.
>
> Remove the optional #:guile argument which is only used in tests and replace
> it with a required 'inputs' argument and adjust all callers. Write a new
> test verifying a guile for the target is located, instead of a native guile.

I think the #:guile argument was a fine interface: clear and
to-the-point. The problem IMO is just that it’s not use where it
should. :-)

[...]

Toggle quote (13 lines)
> --- a/gnu/packages/audio.scm
> +++ b/gnu/packages/audio.scm
> @@ -4712,9 +4712,9 @@ as is the case with audio plugins.")
> (chmod (string-append out "/share/carla/carla") #o555)
> #t)))
> (add-after 'install 'wrap-executables
> - (lambda* (#:key outputs #:allow-other-keys)
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> (let ((out (assoc-ref outputs "out")))
> - (wrap-script (string-append out "/bin/carla")
> + (wrap-script (string-append out "/bin/carla") inputs
> `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))

This would become:

(wrap-script (string-append out "/bin/carla")
`(…)
#:guile (assoc-ref inputs "guile"))

WDYT?

Toggle quote (12 lines)
> From 8b843f0dd8803120718747b480983bd5888b1617 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 19 Apr 2021 16:56:00 +0200
> Subject: [PATCH 6/7] build: utils: wrap-program: look up bash in inputs, not
> in PATH
>
> 'wrap-program' is almost always used for creating wrappers for the
> target system. It is only rarely (once) used for creating wrappers for
> the native system. However, 'wrap-program' always creates wrappers for
> the native system and provides no option for creating wrappers for the
> target system instead.

[...]

Toggle quote (8 lines)
> - (wrap-program
> - (string-append libexec "/dhclient-script")
> + (wrap-program (string-append libexec "/dhclient-script")
> + inputs
> `("PATH" ":" prefix
> ,(map (lambda (dir)
> (string-append dir "/bin:"

I’m also skeptical here; ‘wrap-program’ needs to know the file name of
‘sh’ and instead we’re passing it the full input list.

I would instead add #:bash (or #:sh?). The downside is that it’d be a
bit more verbose, but in terms of interfaces, I’d find it clearer:

(wrap-program (string-append libexec "/dhclient-script")
`("PATH" …)
#:sh (string-append (assoc-ref inputs "bash") "/bin/sh"))

We could introduce a helper procedure to replace (string-append …) with:

(search-input-file inputs "/bin/sh")

where:

(define (search-input-file inputs file)
(any (match-lambda
((label . directory)
(let ((file (string-append directory "/" file)))
(and (file-exists? file) file))))
inputs))

WDYT?

Toggle quote (3 lines)
> + (wrap-program (string-append out "/bin/screenfetch")
> + %build-inputs

As a rule of thumb we should refer to #:inputs and #:outputs instead of
the global variables ‘%build-inputs’ etc.

Toggle quote (8 lines)
> From cdd45bc0aef8b6cb60d351a8fded18700804e8db Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 19 Apr 2021 19:54:53 +0200
> Subject: [PATCH 7/7] doc: Document 'wrap-program'.
>
> * doc/guix.texi (Wrapping Code)[wrap-program]: Copy docstring from
> guix/build/utils.scm and use Texinfo markup.

Neat!

Toggle quote (17 lines)
> doc/guix.texi | 37 ++++++++++++++++++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index a2ff13fe0f..6235ae9bf7 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -8703,7 +8703,42 @@ Here is an example using the @code{which} procedure in a build phase:
> This section documents procedures that create ‘wrappers’ around existing
> binaries, that e.g. set environment variables required during execution.
>
> -@c TODO document wrap-program
> +@deffn {Scheme Procedure} wrap-program @var{prog} @var{inputs} @var{vars}
> +Make a wrapper for @var{prog}. @var{vars} should look like this:
> +
> +@lisp
> + '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
^
You can remove indentation and use @var instead of capital letters.

Toggle quote (5 lines)
> +@lisp
> + (wrap-program "foo"
> + '("PATH" ":" = ("/gnu/.../bar/bin"))
> + '("CERT_PATH" suffix ("/gnu/.../baz/certs"
> + "/qux/certs")))
^^
You can remove indentation here too.

Toggle quote (11 lines)
> +@end lisp
> +
> +will copy @file{foo} to @file{.foo-real} and create the file @file{foo} with
> +the following contents:
> +
> +@example
> + #!location/of/bin/bash
> + export PATH="/gnu/.../bar/bin"
> + export CERT_PATH="$CERT_PATH$@{CERT_PATH:+:@}/gnu/.../baz/certs:/qux/certs"
> + exec -a $0 location/of/.foo-real "$@@"

… and here.

This one can even go to master.

Thanks!

Ludo’.
M
M
Maxime Devos wrote on 18 May 2021 23:25
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47869@debbugs.gnu.org)
343ead490dec84fec8694d2411963d3a80d27166.camel@telenet.be
Ludovic Courtès schreef op di 18-05-2021 om 22:51 [+0200]:
Toggle quote (40 lines)
> Hi Maxime,
>
> Maxime Devos <maximedevos@telenet.be> skribis:
>
> > This is version two of the patch series, removing a 'pk' that
> > I added for debugging, and also fixing 'wrap-script' and 'wrap-program'.
> > To fix 'wrap-script' and 'wrap-program', I added a required 'inputs' argument.
> > All callers have been adjusted to pass it.
> >
> > Perhaps 'patch-shebang' can be fixed and needs to be fixed, but I don't
> > have investigated that closely yet. ('patch-shebangs' (with a #\s) works
> > properly IIUC).
>
> Thanks for this long patch series, and sorry for the equally long delay!
>
> Since we don’t get to change those interfaces very often, I’m going to
> nitpick somewhat because I think we’d rather get them right.
>
> > From 42e7cf4ca6e4d6e1cd31c2807f608275a5ca759a Mon Sep 17 00:00:00 2001
> > From: Maxime Devos <maximedevos@telenet.be>
> > Date: Sun, 18 Apr 2021 12:45:13 +0200
> > Subject: [PATCH 1/7] build: Add argument to which for specifying where to
> > search.
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=UTF-8
> > Content-Transfer-Encoding: 8bit
> >
> > The procedure ‘which’ from (guix build utils)
> > is used for two different purposes:
> >
> > 1. for finding the absolute file name of a binary
> > that needs to run during the build process
> >
> > 2. for finding the absolute file name of a binary,
> > for the target system (as in --target=TARGET),
> > e.g. for substituting sh->/gnu/store/.../bin/sh,
> > python->/gnu/store/.../bin/python.
>
> But note that only #1 is the intended purpose.

It is? Then it seems the first patch can be dropped
and replaced with something else, as you mentioned below.

Toggle quote (5 lines)
> > When compiling natively (SYSTEM=TARGET modulo nix/autotools differences),
> > this is perfectly fine.
>
> Rather “target=#f” in Guix parlance

Yes, correct.

Toggle quote (28 lines)
> [...]
>
> > +(define* (which program #:optional inputs)
> > + "Return the complete file name for PROGRAM as found in $PATH, or #false if
> > +PROGRAM could not be found. If INPUTS is not #false, instead look in the
> > +/bin and /sbin subdirectories of INPUTS. INPUTS is an alist; its keys
> > +are ignored."
>
> I find that this leads to a weird interface; ‘which’ is intended to be
> like the same-named shell command, and the notion of “input alists”
> seems out of place to me.
>
> I was thinking we could make it:
>
> --8<---------------cut here---------------start------------->8---
> (define* (which program #:optional
> (path (search-path-as-string->list (getenv "PATH"))))
> "Return the complete file name for PROGRAM as found in $PATH, or #f if
> PROGRAM could not be found."
> (search-path path program))
> --8<---------------cut here---------------end--------------->8---
>
> … but that doesn’t buy us much.
>
> I think what we need is to do is find and fix misuses of ‘which’.
>
> WDYT?

The current correct way is
(string-append (assoc-ref inputs "the-input") "/bin/the-binary")
which can easily lead to long lines. Ideally, there would be a shorter
way to do this, such as ... the weird
interface above.
Or the "search-input-file" from below.

Toggle quote (15 lines)
>
> [...]
>
> > +Here is an example using the @code{which} procedure in a build phase:
> > +
> > +@lisp
> > +(lambda* (#:key outputs inputs #:allow-other-keys)
> > + (let ((growpart (string-append (assoc-ref outputs "out")
> > + "/bin/growpart")))
> > + (wrap-program growpart
> > + `("PATH" ":" prefix (,(dirname (which "sfdisk" inputs))
> > + ,(dirname (which "readlink" inputs)))))))
>
> That looks weird to me.

The "dirname" & "which" look weird to me to! I grabbed that from
some package definition. I guess a different example is needed.

Toggle quote (13 lines)
> The “correct” way we do it right now is like
> this:
>
> (lambda* (#:key outputs inputs #:allow-other-keys)
> (let ((out (assoc-ref outputs "out"))
> (curl (assoc-ref inputs "curl")))
> (wrap-program (string-append out "/bin/akku")
> `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
> #t))
>
> Here, when cross-compiling, (assoc-ref inputs "curl") returns the target
> cURL.

This is something that can be fixed on 'core-updates', right?
At least when fixing the package definitions doesn't cause to
many rebuilds.

Toggle quote (18 lines)
> > From e78d2d8651d5f56afa7d57be78c5cccccebb117a Mon Sep 17 00:00:00 2001
> > From: Maxime Devos <maximedevos@telenet.be>
> > Date: Sun, 18 Apr 2021 20:44:28 +0200
> > Subject: [PATCH 3/7] build: utils: Make inputs of 'wrap-script' explicit.
> >
> > Previously, 'wrap-script' used (which "guile") to determine where to locate
> > the guile interpreter. But this is incorrect when cross-compiling. When
> > cross-compiling, this would locate the (native) guile interpreter that is
> > in the PATH, while a guile interpreter for the target is required.
> >
> > Remove the optional #:guile argument which is only used in tests and replace
> > it with a required 'inputs' argument and adjust all callers. Write a new
> > test verifying a guile for the target is located, instead of a native guile.
>
> I think the #:guile argument was a fine interface: clear and
> to-the-point. The problem IMO is just that it’s not use where it
> should. :-)

It should be used practically everywhere, no? So making it optional doesn't
make much sense to me when we want to support cross-compilation.

Toggle quote (24 lines)
>
> [...]
>
> > --- a/gnu/packages/audio.scm
> > +++ b/gnu/packages/audio.scm
> > @@ -4712,9 +4712,9 @@ as is the case with audio plugins.")
> > (chmod (string-append out "/share/carla/carla") #o555)
> > #t)))
> > (add-after 'install 'wrap-executables
> > - (lambda* (#:key outputs #:allow-other-keys)
> > + (lambda* (#:key inputs outputs #:allow-other-keys)
> > (let ((out (assoc-ref outputs "out")))
> > - (wrap-script (string-append out "/bin/carla")
> > + (wrap-script (string-append out "/bin/carla") inputs
> > `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
>
> This would become:
>
> (wrap-script (string-append out "/bin/carla")
> `(…)
> #:guile (assoc-ref inputs "guile"))
>
> WDYT?

Ok, this looks a good interface to me, though I think
'wrap-script' will need to be modified. IIRC, #:guile
must be the full file name of the guile binary and not
simply /gnu/store/[...]-guile-$VERSION.

Toggle quote (32 lines)
> > From 8b843f0dd8803120718747b480983bd5888b1617 Mon Sep 17 00:00:00 2001
> > From: Maxime Devos <maximedevos@telenet.be>
> > Date: Mon, 19 Apr 2021 16:56:00 +0200
> > Subject: [PATCH 6/7] build: utils: wrap-program: look up bash in inputs, not
> > in PATH
> >
> > 'wrap-program' is almost always used for creating wrappers for the
> > target system. It is only rarely (once) used for creating wrappers for
> > the native system. However, 'wrap-program' always creates wrappers for
> > the native system and provides no option for creating wrappers for the
> > target system instead.
>
> [...]
>
> > - (wrap-program
> > - (string-append libexec "/dhclient-script")
> > + (wrap-program (string-append libexec "/dhclient-script")
> > + inputs
> > `("PATH" ":" prefix
> > ,(map (lambda (dir)
> > (string-append dir "/bin:"
>
> I’m also skeptical here; ‘wrap-program’ needs to know the file name of
> ‘sh’ and instead we’re passing it the full input list.
>
> I would instead add #:bash (or #:sh?). The downside is that it’d be a
> bit more verbose, but in terms of interfaces, I’d find it clearer:
>
> (wrap-program (string-append libexec "/dhclient-script")
> `("PATH" …)
> #:sh (string-append (assoc-ref inputs "bash") "/bin/sh"))

LGTM, though rather verbose.

Toggle quote (14 lines)
> We could introduce a helper procedure to replace (string-append …) with:
>
> (search-input-file inputs "/bin/sh")
> where:
>
> (define (search-input-file inputs file)
> (any (match-lambda
> ((label . directory)
> (let ((file (string-append directory "/" file)))
> (and (file-exists? file) file))))
> inputs))
>
> WDYT?

That should help with the verbosity. The previous code becomes

(wrap-program (string-append libexec "/dhclient-script")
`("PATH" …)
#:sh (search-input-file inputs "bin/sh"))

which isn't overly verbose.

This procedure 'search-input-file' would return #f if the input
was not found, right? I would rather it raises an exception instead.
There have been some bugs where "#f" was silently written into some file,
which is unlikely to work well.

For the few cases were the input binary is truly optional,
we can define a 'search-optional-input-file' procedure.

Toggle quote (8 lines)
>
>
> > + (wrap-program (string-append out "/bin/screenfetch")
> > + %build-inputs
>
> As a rule of thumb we should refer to #:inputs and #:outputs instead of
> the global variables ‘%build-inputs’ etc.

Agreed, that's what I thought as well, but that seems like a separate
(stylistic) bug to fix. IIRC, the surrounding code used %build-inputs
instead of #:inputs.

Toggle quote (18 lines)
> [...]
> > diff --git a/doc/guix.texi b/doc/guix.texi
> > index a2ff13fe0f..6235ae9bf7 100644
> > --- a/doc/guix.texi
> > +++ b/doc/guix.texi
> > @@ -8703,7 +8703,42 @@ Here is an example using the @code{which} procedure in a build phase:
> > This section documents procedures that create ‘wrappers’ around existing
> > binaries, that e.g. set environment variables required during execution.
> >
> > -@c TODO document wrap-program
> > +@deffn {Scheme Procedure} wrap-program @var{prog} @var{inputs} @var{vars}
> > +Make a wrapper for @var{prog}. @var{vars} should look like this:
> > +
> > +@lisp
> > + '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
> ^
> You can remove indentation and use @var instead of capital letters.

@var can be used inside @lisp? Didn't know that.

Toggle quote (4 lines)
> [...]
>
> This one can even go to master.

Yep.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYKQwyBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uOPAQCvgzmdOGw7jwwekusHMPS3LrmW
Glhc4/xoRIhChy6RSgD/YotwTIWnYiZXVwbWkmCNazJVl8lH1dCCvTEDhTHZSQY=
=RELI
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 29 May 2021 16:50
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 47869@debbugs.gnu.org)
87wnrha90y.fsf_-_@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (2 lines)
> Ludovic Courtès schreef op di 18-05-2021 om 22:51 [+0200]:

[...]

Toggle quote (15 lines)
>> The “correct” way we do it right now is like
>> this:
>>
>> (lambda* (#:key outputs inputs #:allow-other-keys)
>> (let ((out (assoc-ref outputs "out"))
>> (curl (assoc-ref inputs "curl")))
>> (wrap-program (string-append out "/bin/akku")
>> `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
>> #t))
>>
>> Here, when cross-compiling, (assoc-ref inputs "curl") returns the target
>> cURL.
>
> This is something that can be fixed on 'core-updates', right?

Yes, it’s a good time for this! For now, we can even afford world
rebuilds on ‘core-updates’.

Toggle quote (21 lines)
>> > From e78d2d8651d5f56afa7d57be78c5cccccebb117a Mon Sep 17 00:00:00 2001
>> > From: Maxime Devos <maximedevos@telenet.be>
>> > Date: Sun, 18 Apr 2021 20:44:28 +0200
>> > Subject: [PATCH 3/7] build: utils: Make inputs of 'wrap-script' explicit.
>> >
>> > Previously, 'wrap-script' used (which "guile") to determine where to locate
>> > the guile interpreter. But this is incorrect when cross-compiling. When
>> > cross-compiling, this would locate the (native) guile interpreter that is
>> > in the PATH, while a guile interpreter for the target is required.
>> >
>> > Remove the optional #:guile argument which is only used in tests and replace
>> > it with a required 'inputs' argument and adjust all callers. Write a new
>> > test verifying a guile for the target is located, instead of a native guile.
>>
>> I think the #:guile argument was a fine interface: clear and
>> to-the-point. The problem IMO is just that it’s not use where it
>> should. :-)
>
> It should be used practically everywhere, no? So making it optional doesn't
> make much sense to me when we want to support cross-compilation.

Yes, and I agree that’s a difficulty.

Toggle quote (21 lines)
>> > (add-after 'install 'wrap-executables
>> > - (lambda* (#:key outputs #:allow-other-keys)
>> > + (lambda* (#:key inputs outputs #:allow-other-keys)
>> > (let ((out (assoc-ref outputs "out")))
>> > - (wrap-script (string-append out "/bin/carla")
>> > + (wrap-script (string-append out "/bin/carla") inputs
>> > `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
>>
>> This would become:
>>
>> (wrap-script (string-append out "/bin/carla")
>> `(…)
>> #:guile (assoc-ref inputs "guile"))
>>
>> WDYT?
>
> Ok, this looks a good interface to me, though I think
> 'wrap-script' will need to be modified. IIRC, #:guile
> must be the full file name of the guile binary and not
> simply /gnu/store/[...]-guile-$VERSION.

Good point. I think one could write:

(wrap-script … #:guile (search-input-file inputs "/bin/guile"))

which is more reasonable.

Toggle quote (13 lines)
> That should help with the verbosity. The previous code becomes
>
> (wrap-program (string-append libexec "/dhclient-script")
> `("PATH" …)
> #:sh (search-input-file inputs "bin/sh"))
>
> which isn't overly verbose.
>
> This procedure 'search-input-file' would return #f if the input
> was not found, right? I would rather it raises an exception instead.
> There have been some bugs where "#f" was silently written into some file,
> which is unlikely to work well.

Agreed, let’s have ‘search-input-file’ raise an exception if the file
isn’t found.

Toggle quote (3 lines)
> For the few cases were the input binary is truly optional,
> we can define a 'search-optional-input-file' procedure.

Let’s ignore that until the problem shows up.

Toggle quote (11 lines)
>> > -@c TODO document wrap-program
>> > +@deffn {Scheme Procedure} wrap-program @var{prog} @var{inputs} @var{vars}
>> > +Make a wrapper for @var{prog}. @var{vars} should look like this:
>> > +
>> > +@lisp
>> > + '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
>> ^
>> You can remove indentation and use @var instead of capital letters.
>
> @var can be used inside @lisp? Didn't know that.

Yes.

Sorry for the delay, and thanks again!

Ludo’.
M
M
Maxime Devos wrote on 1 Jun 2021 21:53
[PATCH v3 core-updates] various cross-compilation fixes in guix/build/utils.scm
(address . 47869@debbugs.gnu.org)
3319cbc48171ae821c3297f9e5cbb8e9011b87ed.camel@telenet.be
Hi guix,

This is version three of the patch series,
which (no pun intended) incorporates feedback
from Ludovic Courtès.

This version adds a 'search-input-file' procedure
to (guix build utils). It is used like:

(wrap-script something #:guile
(search-input-file inputs "bin/guile")
[...])

Explicitely setting #:guile instead of defaulting
to (which "guile") is required for cross-compilation,
to make sure the guile eventually used is compiled for
the correct architecture.

This patch series also extends 'wrap-program' with
a #:sh keyword argument, which has the same purpose
as #:guile for 'wrap-script'.

Some differences to v2:

* The #:sh and #:guile arguments are optional.
The default value should be good when compiling natively,
but not when cross-compiling.

Eventually, we may look into making them required,
but let's pun for later.

* I left 'wrap-qt-program' alone for now.

* I left documenting 'wrap-program' and 'wrap-script' for later.

* I didn't adjust all uses of wrap-program to set #:sh,
only a few.

For testing wrap-program:
Write to "a.sh":

#!/stuff/etcetera
echo "hello world!"

From ./pre-inst-env guix repl, do:

(use-modules (guix build utils))
(wrap-program "a.sh" #:sh "/bin/sh" '("PATH" = ("stuff")))

Now look at "a.sh":

#!/bin/sh
export PATH="stuff"
exec -a "$0" "[current working directory]/.a.sh-real" "$@"

There are some tests in tests/build-utils.scm for 'search-input-file'.

I also ran "make && ./pre-inst-env guix build hello wireguard-tools".
(Not sure about which packages I tested actually.) This successfully
built "hello" (and all its dependencies, this can take a lot of time!).

Building wireguard-tools failed at first. It turned out I made a mistake
in 'wrap-program': the following ...

(define vars/filtered
(match vars
((#:sh . vars) vars)
(vars vars)))

... should have been ...

(define vars/filtered
(match vars
((#:sh _ . vars) vars)
(vars vars)))

That has been corrected. I tested the corrected "wrap-program" in a REPL
as above, but haven't tried building wireguard-tools again (that would
entail doing the whole bootstrapping process again).

This patch series is on top of commit 9ba35475ede5eb61bfeead096bc6b73f123ac891
on core-updates.

Greetings,
Maxime.
From 02d2b52458fae1c391e79f89a89696f3b07fdb2b Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 18:22:31 +0200
Subject: [PATCH 01/18] =?UTF-8?q?build:=20Allow=20overriding=20the=20shell?=
=?UTF-8?q?=20interpreter=20in=20=E2=80=98wrap-program=E2=80=99.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previously, when creating new wrappers, 'wrap-program' would search
for an interpreter to use in PATH. However, this is incorrect when
cross-compiling. Allow overriding the shell interpreter to use,
via an optional keyword argument #:sh.

In time, when all users of 'wrap-program' have been corrected,
this keyword argument can be made mandatory.

* guix/build/utils.scm (wrap-program): Introduce a #:sh keyword
argument, defaulting to (which "sh"). Use this keyword argument.

---
guix/build/utils.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

Toggle diff (57 lines)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index dbfc0a9142..c6731b37ae 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1234,7 +1235,7 @@ known as `nuke-refs' in Nixpkgs."
(and (string-prefix? "." base)
(string-suffix? "-real" base)))))
-(define* (wrap-program prog #:rest vars)
+(define* (wrap-program prog #:key (sh (which "bash")) #:rest vars)
"Make a wrapper for PROG. VARS should look like this:
'(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
@@ -1261,7 +1262,12 @@ programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
modules in $GUILE_LOAD_PATH, etc.
If PROG has previously been wrapped by 'wrap-program', the wrapper is extended
-with definitions for VARS."
+with definitions for VARS. If it is not, SH will be used as interpreter."
+ (define vars/filtered
+ (match vars
+ ((#:sh _ . vars) vars)
+ (vars vars)))
+
(define wrapped-file
(string-append (dirname prog) "/." (basename prog) "-real"))
@@ -1315,7 +1321,7 @@ with definitions for VARS."
(for-each (lambda (var)
(display (export-variable var) port)
(newline port))
- vars)
+ vars/filtered)
(display last port)
(close-port port))
@@ -1327,8 +1333,8 @@ with definitions for VARS."
(lambda (port)
(format port
"#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
- (which "bash")
- (string-join (map export-variable vars) "\n")
+ sh
+ (string-join (map export-variable vars/filtered) "\n")
(canonicalize-path wrapped-file))))
(chmod prog-tmp #o755)
--
2.31.1
From f598c0168bfcb75f718cc8edf990b7a560334405 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 18:36:09 +0200
Subject: [PATCH 02/18] =?UTF-8?q?build:=20Define=20=E2=80=98search-input-f?=
=?UTF-8?q?ile=E2=80=99=20procedure.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The procedure ‘which’ from (guix build utils)
is used for two different purposes:

1. for finding the absolute file name of a binary
that needs to run during the build process

2. for finding the absolute file name of a binary,
for the target system (as in --target=TARGET),
e.g. for substituting sh->/gnu/store/.../bin/sh,
python->/gnu/store/.../bin/python.

When compiling natively (target=#f in Guix parlance),
this is perfectly fine.

However, when cross-compiling, there is a problem.
"which" looks in $PATH for binaries. That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

This commit defines a ‘search-input-file’ procedure. It functions
like 'which', but instead of searching in $PATH, it searches in
the 'inputs' of the build phase, which must be passed to
‘search-input-file’ as an argument. Also, the file name must
include "bin/" or "sbin/" as appropriate.

* guix/build/utils.scm (search-input-file): New procedure.
* tests/build-utils.scm
("search-input-file: exception if not found")
("search-input-file: can find if existent"): Test it.
* doc/guix.texi (File Search): Document it.

---
doc/guix.texi | 13 +++++++++++++
guix/build/utils.scm | 9 +++++++++
tests/build-utils.scm | 11 +++++++++++
3 files changed, 33 insertions(+)

Toggle diff (80 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 535e7614fd..f9d2322ea7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8661,6 +8661,19 @@ Return the complete file name for @var{program} as found in
@code{$PATH}, or @code{#f} if @var{program} could not be found.
@end deffn
+@deffn {Scheme Procedure} search-input-file @var{inputs} @var{name}
+Return the complete file name for @var{name} as found in @var{inputs}.
+If @var{name} could not be found, an exception is raised instead.
+Here, @var{inputs} is an association list like @var{inputs} and
+@var{native-inputs} as available to build phases.
+
+This procedure can be used for telling @code{wrap-script} and
+@code{wrap-program} (currently undocumented) where the Guile
+binary or shell binary are located. In fact, that's the
+purpose for which @code{search-input-file} has been created
+in the first place.
+@end deffn
+
@subsection Build Phases
@cindex build phases
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index c6731b37ae..2ae8478ef7 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -80,6 +80,7 @@
search-path-as-string->list
list->search-path-as-string
which
+ search-input-file
every*
alist-cons-before
@@ -614,6 +615,14 @@ PROGRAM could not be found."
(search-path (search-path-as-string->list (getenv "PATH"))
program))
+(define (search-input-file inputs file)
+ "Find a file named FILE among the INPUTS and return its absolute file name.
+
+FILE must be a string like \"bin/sh\". If FILE is not found, an exception is
+raised."
+ (or (search-path (map cdr inputs) file)
+ (error "could not find ~a among the inputs" file)))
+
;;;
;;; Phases.
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 31be7ff80f..33685c6468 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2012, 2015, 2016, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -263,4 +264,14 @@ print('hello world')"))
(lambda _
(get-string-all (current-input-port))))))))
+(test-assert "search-input-file: exception if not found"
+ (not (false-if-exception
+ (search-input-file '() "does-not-exist"))))
+
+(test-equal "search-input-file: can find if existent"
+ (which "guile")
+ (search-input-file
+ `(("guile/bin" . ,(dirname (which "guile"))))
+ "guile"))
+
(test-end)
--
2.31.1
From 98856ca64218bd98c0d066a25ac93038a98c7ff5 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:47:01 +0200
Subject: [PATCH 03/18] glib-or-gtk-build-system: Look up the interpreter in
'inputs'.

* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/glib-or-gtk-build-system.scm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

Toggle diff (70 lines)
diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm
index ccb3138fe2..8d3c3684d3 100644
--- a/guix/build/glib-or-gtk-build-system.scm
+++ b/guix/build/glib-or-gtk-build-system.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -136,6 +137,11 @@ Wrapping is not applied to outputs whose name is listed in
GLIB-OR-GTK-WRAP-EXCLUDED-OUTPUTS. This is useful when an output is known not
to contain any GLib or GTK+ binaries, and where wrapping would gratuitously
add a dependency of that output on GLib and GTK+."
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
(define handle-output
(match-lambda
((output . directory)
@@ -165,36 +171,36 @@ add a dependency of that output on GLib and GTK+."
#f)))
(cond
((and data-env-var gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gtk-mod-env-var
gio-mod-env-var)
bin-list))
((and data-env-var gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gtk-mod-env-var)
bin-list))
((and data-env-var (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gio-mod-env-var)
bin-list))
((and (not data-env-var) gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gio-mod-env-var
gtk-mod-env-var)
bin-list))
((and data-env-var (not gtk-mod-env-var) (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var)
bin-list))
((and (not data-env-var) gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gtk-mod-env-var)
bin-list))
((and (not data-env-var) (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gio-mod-env-var)
bin-list))))))))
--
2.31.1
From bc0085b79dd42e586cc5fcffa6f4972db9f42563 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:48:44 +0200
Subject: [PATCH 04/18] python-build-system: Look up the interpreter in
'inputs'.

* guix/build/python-build-system.scm (wrap): Pass the shell
interpreter from 'inputs' to 'wrap-program' using 'search-input-file'.

---
guix/build/python-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (34 lines)
diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index 5b1339d14c..08871f60cd 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2020 Jakub K?dzio?ka <kuba@kadziolka.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -234,12 +235,18 @@ running checks after installing the package."
(string-append dir "/sbin"))))
outputs))
+ ;; Do not require "bash" to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(let* ((var `("GUIX_PYTHONPATH" prefix
,(search-path-as-string->list
(or (getenv "GUIX_PYTHONPATH") "")))))
(for-each (lambda (dir)
(let ((files (list-of-files dir)))
- (for-each (cut wrap-program <> var)
+ (for-each (cut wrap-program <> #:sh (sh) var)
files)))
bindirs)))
--
2.31.1
From 0370ad982e90c3e4def9cd5245cbd6769fda2830 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:20:12 +0200
Subject: [PATCH 05/18] qt-build-system: Look up the interpreter in 'inputs'.

* guix/build/qt-build-system.scm (wrap-all-programs): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/qt-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (36 lines)
diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm
index 762fd8a2ee..ec7ceb38bd 100644
--- a/guix/build/qt-build-system.scm
+++ b/guix/build/qt-build-system.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -126,6 +127,12 @@ add a dependency of that output on Qt."
(((_ . dir) ...)
dir)))
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(define handle-output
(match-lambda
((output . directory)
@@ -135,7 +142,7 @@ add a dependency of that output on Qt."
(append (list directory)
input-directories))))
(when (not (null? vars-to-wrap))
- (for-each (cut apply wrap-program <> vars-to-wrap)
+ (for-each (cut apply wrap-program <> #:sh (sh) vars-to-wrap)
bin-list)))))))
(for-each handle-output outputs)
--
2.31.1
From 92278afdc58430e8e9f6887d481964e1d73e551c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:21:16 +0200
Subject: [PATCH 06/18] rakudo-build-system: Look up the interpreter in
'inputs'.

* guix/build/rakudo-build-system.scm (wrap): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/rakudo-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (35 lines)
diff --git a/guix/build/rakudo-build-system.scm b/guix/build/rakudo-build-system.scm
index b2c090f946..5cf1cc55bc 100644
--- a/guix/build/rakudo-build-system.scm
+++ b/guix/build/rakudo-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -108,6 +109,12 @@
(string-append dir "/sbin"))))
outputs))
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(let* ((out (assoc-ref outputs "out"))
(var `("PERL6LIB" "," prefix
,(cons (string-append out "/share/perl6/lib,"
@@ -117,7 +124,7 @@
(or (getenv "PERL6LIB") "") #\,)))))
(for-each (lambda (dir)
(let ((files (list-of-files dir)))
- (for-each (cut wrap-program <> var)
+ (for-each (cut wrap-program <> #:sh (sh) var)
files)))
bindirs)
#t))
--
2.31.1
From e8b21fba6cd6a45cbaaab6547f8906b84618a38e Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:41:22 +0200
Subject: [PATCH 07/18] gnu: carla: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/audio.scm
(carla)[arguments]<#:phases>{wrap-executables}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/audio.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index f677d46a7f..930c111d5e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -4711,9 +4711,10 @@ as is the case with audio plugins.")
(chmod (string-append out "/share/carla/carla") #o555)
#t)))
(add-after 'install 'wrap-executables
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(wrap-script (string-append out "/bin/carla")
+ #:guile (search-input-file inputs "bin/guile")
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
#t))))))
(inputs
--
2.31.1
From 7a337fa6576ed1b797cbae5c6d26e0dd90a744fa Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:42:58 +0200
Subject: [PATCH 08/18] gnu: bats: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bash.scm
(bats)[arguments]<#:builder>: Set #:guile argument
of ‘wrap-script’.
---
gnu/packages/bash.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 8dfbd7834e..7e98367bbb 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -402,6 +402,7 @@ capturing.")
;; Install phase
(invoke "./install.sh" %output)
(wrap-script (string-append %output "/bin/bats")
+ #:guile (search-input-file %build-inputs "bin/guile")
(list "PATH" 'prefix (string-split (getenv "PATH")
#\:))))))
(build-system trivial-build-system)
--
2.31.1
From 3cca28ba7694ee32f252c089d88d7e2834d1c415 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:46:22 +0200
Subject: [PATCH 09/18] gnu: proteinortho: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(proteinortho)[arguments]<#:phases>{wrap-programs}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 85f785955e..7d8496e692 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5447,9 +5447,11 @@ predicts the locations of structural units in the sequences.")
(add-after 'install 'wrap-programs
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((path (getenv "PATH"))
- (out (assoc-ref outputs "out")))
+ (out (assoc-ref outputs "out"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each (lambda (script)
- (wrap-script script `("PATH" ":" prefix (,path))))
+ (wrap-script script #:guile guile
+ `("PATH" ":" prefix (,path))))
(cons (string-append out "/bin/proteinortho")
(find-files out "\\.(pl|py)$"))))
#t)))))
--
2.31.1
From a60dd8b0cd55e27f1e5d72f75cb5cbfb59acfb48 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:48:19 +0200
Subject: [PATCH 10/18] gnu: prinseq: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(prinseq)[arguments]<#:phases>{install}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7d8496e692..37483984ec 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7557,7 +7557,8 @@ experience substantial biological insertions and deletions.")
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
- (scripts (find-files "." "prinseq.*.pl")))
+ (scripts (find-files "." "prinseq.*.pl"))
+ (guile (search-input-file "bin/guile")))
(substitute* scripts
(("\"perl -pe")
(string-append "\"" (which "perl") " -pe")))
@@ -7565,6 +7566,7 @@ experience substantial biological insertions and deletions.")
(chmod file #o555)
(install-file file bin)
(wrap-script (string-append bin "/" (basename file))
+ #:guile guile
`("PERL5LIB" ":" prefix
(,(getenv "PERL5LIB")))))
scripts)))))))
--
2.31.1
From 0ef6b12b7b5645b9e17bfbe9e65ed341146eec80 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:50:07 +0200
Subject: [PATCH 11/18] gnu: gess: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(gess)[arguments]<#:phases>{install}
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 37483984ec..965e26b812 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7554,7 +7554,7 @@ experience substantial biological insertions and deletions.")
(delete 'configure)
(delete 'build)
(replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(scripts (find-files "." "prinseq.*.pl"))
@@ -10239,6 +10239,7 @@ matplotlib.use('Agg')
" line)))
;; Make sure GESS has all modules in its path
(wrap-script (string-append target "GESS.py")
+ #:guile (search-input-file inputs "bin/guile")
`("GUIX_PYTHONPATH" ":" = (,target ,(getenv "GUIX_PYTHONPATH"))))
(mkdir-p bin)
(symlink (string-append target "GESS.py")
--
2.31.1
From bb4599d61bebe0a9db8863542349d1558163b468 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:54:49 +0200
Subject: [PATCH 12/18] gnu: nanopolish: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(nanopolish)[arguments]<#:phases>{wrap-programs}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 965e26b812..fc2fc867ac 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -13583,16 +13583,18 @@ choosing which reads pass the filter.")
(find-files "scripts" ".*"))
#t)))
(add-after 'install 'wrap-programs
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((pythonpath (getenv "GUIX_PYTHONPATH"))
(perl5lib (getenv "PERL5LIB"))
(scripts (string-append (assoc-ref outputs "out")
- "/share/nanopolish/scripts")))
+ "/share/nanopolish/scripts"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each (lambda (file)
(wrap-program file `("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
(find-files scripts "\\.py"))
(for-each (lambda (file)
- (wrap-script file `("PERL5LIB" ":" prefix (,perl5lib))))
+ (wrap-script file #:guile guile
+ `("PERL5LIB" ":" prefix (,perl5lib))))
(find-files scripts "\\.pl"))))))))
(inputs
`(("guile" ,guile-3.0) ; for wrappers
--
2.31.1
From 0e8be56ecd1c4509d1b4ccdf51ec178a0ec1baaf Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:58:53 +0200
Subject: [PATCH 13/18] gnu: sieve-connect: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/mail.scm
(sieve-connect)[arguments]<#:phases>{wrap-program}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/mail.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a885e2417c..7aed1aa5bd 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2924,6 +2924,7 @@ transfer protocols.")
(let ((out (assoc-ref outputs "out"))
(path (getenv "PERL5LIB")))
(wrap-script (string-append out "/bin/sieve-connect")
+ #:guile (search-input-file inputs "bin/guile")
`("PERL5LIB" ":" = (,path)))
#t))))))
(inputs
--
2.31.1
From 9f71e9330382689e6a79f19568d456e36df3087e Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:04:30 +0200
Subject: [PATCH 14/18] gnu: clipmenu: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/xdisorg.scm
(clipmenu)[arguments]<#:phases>{wrap-script}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/xdisorg.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index de2cba8e57..d339851f51 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -2555,10 +2555,12 @@ tools to complement clipnotify.")
(gawk (assoc-ref inputs "gawk"))
(util-linux (assoc-ref inputs "util-linux"))
(xdotool (assoc-ref inputs "xdotool"))
- (xsel (assoc-ref inputs "xsel")))
+ (xsel (assoc-ref inputs "xsel"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each
(lambda (prog)
(wrap-script (string-append out "/bin/" prog)
+ #:guile guile
`("PATH" ":" prefix
,(map (lambda (dir)
(string-append dir "/bin"))
--
2.31.1
From 7ecf6502fc902959fd2a233c5f772180678e9f35 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:06:12 +0200
Subject: [PATCH 15/18] gnu: vpnc-scripts: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(vpnc-scripts)[arguments]<#:phases>{wrap-scripts}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/vpn.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index a952e3f0db..33ef87c52d 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -192,10 +192,12 @@ Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
;; Wrap scripts with paths to their common hard dependencies.
;; Optional dependencies will need to be installed by the user.
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (let ((out (assoc-ref outputs "out"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each
(lambda (script)
(wrap-script (string-append out "/etc/vpnc/" script)
+ #:guile guile
`("PATH" ":" prefix
,(map (lambda (name)
(let ((input (assoc-ref inputs name)))
--
2.31.1
From 5a18f07c5d7ea73d306e3b66ff72f285f38376ac Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:09:45 +0200
Subject: [PATCH 16/18] gnu: openconnect-sso: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(openconnect-sso)[arguments]<#:phases>{wrap-qt-process-path}
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 33ef87c52d..584ff0ec84 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -326,6 +326,7 @@ and probably others.")
(assoc-ref inputs "qtwebengine")
"/lib/qt5/libexec/QtWebEngineProcess")))
(wrap-program bin
+ #:sh (search-input-file inputs "bin/bash")
`("QTWEBENGINEPROCESS_PATH" = (,qt-process-path)))
#t))))))
(inputs
--
2.31.1
From b180eb2b419ca8b09412ab30c0442f54ae14775f Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:11:50 +0200
Subject: [PATCH 17/18] gnu: protonvpn-cli: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(protonvpn-cli)[arguments]<#:phases>{wrap-wrapper}:
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 584ff0ec84..66c103e75f 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -440,6 +440,7 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
(let ((entrypoint (string-append (assoc-ref outputs "out")
"/bin/.protonvpn-real")))
(wrap-program entrypoint
+ #:sh (search-input-file inputs "bin/bash")
`("PATH" ":" prefix
,(map (lambda (name)
(let ((input (assoc-ref inputs name)))
--
2.31.1
From c1ab0f5161254e66ae3515df60440dd4bcb46fd4 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:12:55 +0200
Subject: [PATCH 18/18] gnu: wireguard-tools: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(wireguard-tools)[arguments]<#:phases>{wrap-wg-quick}:
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 66c103e75f..34715a4cc8 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -726,6 +726,7 @@ WireGuard was added to Linux 5.6.")
(coreutils (string-append (assoc-ref inputs "coreutils")
"/bin")))
(wrap-program (string-append out "/bin/wg-quick")
+ #:sh (search-input-file inputs "bin/bash")
`("PATH" ":" prefix ,(append inputs-sbin
(list coreutils))))
#t))))))
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYLaQLRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qWdAPwLn4CiIQD2ocHFioWv0876dv6o
C/9zMQbce5vZzorWsQD/UzgdMZycU6g5vV18vjyxcwOCcJIrh1GJZ9YeuW8DKQA=
=DARB
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 1 Jun 2021 23:01
Re: bug#47869: [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 47869@debbugs.gnu.org)
87sg21z4d9.fsf_-_@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (16 lines)
> Some differences to v2:
>
> * The #:sh and #:guile arguments are optional.
> The default value should be good when compiling natively,
> but not when cross-compiling.
>
> Eventually, we may look into making them required,
> but let's pun for later.
>
> * I left 'wrap-qt-program' alone for now.
>
> * I left documenting 'wrap-program' and 'wrap-script' for later.
>
> * I didn't adjust all uses of wrap-program to set #:sh,
> only a few.

[...]

Toggle quote (3 lines)
> This patch series is on top of commit 9ba35475ede5eb61bfeead096bc6b73f123ac891
> on core-updates.

Woow, nice!

I’ll first focus on the first few patches, those that trigger a world
rebuild. Subsequent patches look good and are less “critical”.

Toggle quote (22 lines)
> From 02d2b52458fae1c391e79f89a89696f3b07fdb2b Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 31 May 2021 18:22:31 +0200
> Subject: [PATCH 01/18] =?UTF-8?q?build:=20Allow=20overriding=20the=20shell?=
> =?UTF-8?q?=20interpreter=20in=20=E2=80=98wrap-program=E2=80=99.?=
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Previously, when creating new wrappers, 'wrap-program' would search
> for an interpreter to use in PATH. However, this is incorrect when
> cross-compiling. Allow overriding the shell interpreter to use,
> via an optional keyword argument #:sh.
>
> In time, when all users of 'wrap-program' have been corrected,
> this keyword argument can be made mandatory.
>
> * guix/build/utils.scm (wrap-program): Introduce a #:sh keyword
> argument, defaulting to (which "sh"). Use this keyword argument.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

LGTM (will apply together with the other world-rebuild changes).

Toggle quote (42 lines)
> From f598c0168bfcb75f718cc8edf990b7a560334405 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 31 May 2021 18:36:09 +0200
> Subject: [PATCH 02/18] =?UTF-8?q?build:=20Define=20=E2=80=98search-input-f?=
> =?UTF-8?q?ile=E2=80=99=20procedure.?=
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The procedure ‘which’ from (guix build utils)
> is used for two different purposes:
>
> 1. for finding the absolute file name of a binary
> that needs to run during the build process
>
> 2. for finding the absolute file name of a binary,
> for the target system (as in --target=TARGET),
> e.g. for substituting sh->/gnu/store/.../bin/sh,
> python->/gnu/store/.../bin/python.
>
> When compiling natively (target=#f in Guix parlance),
> this is perfectly fine.
>
> However, when cross-compiling, there is a problem.
> "which" looks in $PATH for binaries. That's good for purpose (1),
> but incorrect for (2), as the $PATH contains binaries from native-inputs
> instead of inputs.
>
> This commit defines a ‘search-input-file’ procedure. It functions
> like 'which', but instead of searching in $PATH, it searches in
> the 'inputs' of the build phase, which must be passed to
> ‘search-input-file’ as an argument. Also, the file name must
> include "bin/" or "sbin/" as appropriate.
>
> * guix/build/utils.scm (search-input-file): New procedure.
> * tests/build-utils.scm
> ("search-input-file: exception if not found")
> ("search-input-file: can find if existent"): Test it.
> * doc/guix.texi (File Search): Document it.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

I don’t think we need the whole story here :-) though it doesn’t hurt.
‘search-input-file’ is useful on its own IMO.

Toggle quote (13 lines)
> +@deffn {Scheme Procedure} search-input-file @var{inputs} @var{name}
> +Return the complete file name for @var{name} as found in @var{inputs}.
> +If @var{name} could not be found, an exception is raised instead.
> +Here, @var{inputs} is an association list like @var{inputs} and
> +@var{native-inputs} as available to build phases.
> +
> +This procedure can be used for telling @code{wrap-script} and
> +@code{wrap-program} (currently undocumented) where the Guile
> +binary or shell binary are located. In fact, that's the
> +purpose for which @code{search-input-file} has been created
> +in the first place.
> +@end deffn

I’d remove the second paragraph: IMO it’s not the right place to
document the motivation. However, an @lisp example would be nice.

BTW, please remember to leave two spaces after end-of-sentence periods.

Toggle quote (8 lines)
> +(define (search-input-file inputs file)
> + "Find a file named FILE among the INPUTS and return its absolute file name.
> +
> +FILE must be a string like \"bin/sh\". If FILE is not found, an exception is
> +raised."
> + (or (search-path (map cdr inputs) file)
> + (error "could not find ~a among the inputs" file)))

Rather:

(match inputs
(((_ . directories) ...)
(or (search-path directories file)
(raise (condition (&search-error (path directories) (file file)))))))

… so you’d need to define a new error condition type.

It’s better to make this extra effort; ‘error’ throws to 'misc-error and
cannot be meaningfully handled by callers.

Toggle quote (4 lines)
> +(test-assert "search-input-file: exception if not found"
> + (not (false-if-exception
> + (search-input-file '() "does-not-exist"))))

Here you’d use ‘guard’ to check you got the right exception.

Toggle quote (12 lines)
> From 98856ca64218bd98c0d066a25ac93038a98c7ff5 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Tue, 1 Jun 2021 21:47:01 +0200
> Subject: [PATCH 03/18] glib-or-gtk-build-system: Look up the interpreter in
> 'inputs'.
>
> * guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Pass
> the shell interpreter from 'inputs' to 'wrap-program' using
> 'search-input-file'.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

[...]

Toggle quote (6 lines)
> + ;; Do not require bash to be present in the package inputs
> + ;; even when there is nothing to wrap.
> + ;; Also, calculate (sh) only once to prevent some I/O.
> + (define %sh (delay (search-input-file inputs "bin/bash")))
> + (define (sh) (force %sh))

I’d be tempted for clarity to simply write:

(define (sh)
(search-input-file inputs "bin/bash"))

The extra ‘stat’ calls may be okay in practice but yeah, dunno.

Toggle quote (11 lines)
> From bc0085b79dd42e586cc5fcffa6f4972db9f42563 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Tue, 1 Jun 2021 21:48:44 +0200
> Subject: [PATCH 04/18] python-build-system: Look up the interpreter in
> 'inputs'.
>
> * guix/build/python-build-system.scm (wrap): Pass the shell
> interpreter from 'inputs' to 'wrap-program' using 'search-input-file'.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

[...]

Toggle quote (11 lines)
> From 0370ad982e90c3e4def9cd5245cbd6769fda2830 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 31 May 2021 19:20:12 +0200
> Subject: [PATCH 05/18] qt-build-system: Look up the interpreter in 'inputs'.
>
> * guix/build/qt-build-system.scm (wrap-all-programs): Pass
> the shell interpreter from 'inputs' to 'wrap-program' using
> 'search-input-file'.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

[...]

Toggle quote (12 lines)
> From 92278afdc58430e8e9f6887d481964e1d73e551c Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Mon, 31 May 2021 19:21:16 +0200
> Subject: [PATCH 06/18] rakudo-build-system: Look up the interpreter in
> 'inputs'.
>
> * guix/build/rakudo-build-system.scm (wrap): Pass
> the shell interpreter from 'inputs' to 'wrap-program' using
> 'search-input-file'.
>
> Partially-Fixes: <https://issues.guix.gnu.org/47869>

LGTM!

So in the end, I’m suggesting modifications to #2 and the rest LGTM.

Thank you!

Ludo’.
M
M
Maxime Devos wrote on 2 Jun 2021 09:56
[PATCH v4 core-updates] various cross-compilation fixes in guix/build/utils.scm
(address . 47869@debbugs.gnu.org)
c7e4fc629adaf7c44f618cfdb38c05d34cb5aec4.camel@telenet.be
Hi guix,

This is version 4 of the patch series.
It lets 'search-input-file' raise the new
&search-error exception instead of misc-error.

The documentation of 'search-input-file' has been
adjusted to give an example of how it can be used.

Also, there is one new test in tests/build-utils.scm
("search-input-file: can search in multiple directories").

Greetings,
Maxime.
From 02d2b52458fae1c391e79f89a89696f3b07fdb2b Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 18:22:31 +0200
Subject: [PATCH 01/18] =?UTF-8?q?build:=20Allow=20overriding=20the=20shell?=
=?UTF-8?q?=20interpreter=20in=20=E2=80=98wrap-program=E2=80=99.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previously, when creating new wrappers, 'wrap-program' would search
for an interpreter to use in PATH. However, this is incorrect when
cross-compiling. Allow overriding the shell interpreter to use,
via an optional keyword argument #:sh.

In time, when all users of 'wrap-program' have been corrected,
this keyword argument can be made mandatory.

* guix/build/utils.scm (wrap-program): Introduce a #:sh keyword
argument, defaulting to (which "sh"). Use this keyword argument.

---
guix/build/utils.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

Toggle diff (57 lines)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index dbfc0a9142..c6731b37ae 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1234,7 +1235,7 @@ known as `nuke-refs' in Nixpkgs."
(and (string-prefix? "." base)
(string-suffix? "-real" base)))))
-(define* (wrap-program prog #:rest vars)
+(define* (wrap-program prog #:key (sh (which "bash")) #:rest vars)
"Make a wrapper for PROG. VARS should look like this:
'(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
@@ -1261,7 +1262,12 @@ programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
modules in $GUILE_LOAD_PATH, etc.
If PROG has previously been wrapped by 'wrap-program', the wrapper is extended
-with definitions for VARS."
+with definitions for VARS. If it is not, SH will be used as interpreter."
+ (define vars/filtered
+ (match vars
+ ((#:sh _ . vars) vars)
+ (vars vars)))
+
(define wrapped-file
(string-append (dirname prog) "/." (basename prog) "-real"))
@@ -1315,7 +1321,7 @@ with definitions for VARS."
(for-each (lambda (var)
(display (export-variable var) port)
(newline port))
- vars)
+ vars/filtered)
(display last port)
(close-port port))
@@ -1327,8 +1333,8 @@ with definitions for VARS."
(lambda (port)
(format port
"#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
- (which "bash")
- (string-join (map export-variable vars) "\n")
+ sh
+ (string-join (map export-variable vars/filtered) "\n")
(canonicalize-path wrapped-file))))
(chmod prog-tmp #o755)
--
2.31.1
From 51aad468090519e063efcddb5aa2afdf19d8da1d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:47:01 +0200
Subject: [PATCH 03/18] glib-or-gtk-build-system: Look up the interpreter in
'inputs'.

* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/glib-or-gtk-build-system.scm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

Toggle diff (70 lines)
diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm
index ccb3138fe2..8d3c3684d3 100644
--- a/guix/build/glib-or-gtk-build-system.scm
+++ b/guix/build/glib-or-gtk-build-system.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -136,6 +137,11 @@ Wrapping is not applied to outputs whose name is listed in
GLIB-OR-GTK-WRAP-EXCLUDED-OUTPUTS. This is useful when an output is known not
to contain any GLib or GTK+ binaries, and where wrapping would gratuitously
add a dependency of that output on GLib and GTK+."
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
(define handle-output
(match-lambda
((output . directory)
@@ -165,36 +171,36 @@ add a dependency of that output on GLib and GTK+."
#f)))
(cond
((and data-env-var gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gtk-mod-env-var
gio-mod-env-var)
bin-list))
((and data-env-var gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gtk-mod-env-var)
bin-list))
((and data-env-var (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var
gio-mod-env-var)
bin-list))
((and (not data-env-var) gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gio-mod-env-var
gtk-mod-env-var)
bin-list))
((and data-env-var (not gtk-mod-env-var) (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
data-env-var)
bin-list))
((and (not data-env-var) gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gtk-mod-env-var)
bin-list))
((and (not data-env-var) (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
+ (for-each (cut wrap-program <> #:sh (sh)
gio-mod-env-var)
bin-list))))))))
--
2.31.1
From 852d494e3b59f8ea0e7e4fd7ef5f4f4e8fff06c6 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:48:44 +0200
Subject: [PATCH 04/18] python-build-system: Look up the interpreter in
'inputs'.

* guix/build/python-build-system.scm (wrap): Pass the shell
interpreter from 'inputs' to 'wrap-program' using 'search-input-file'.

---
guix/build/python-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (34 lines)
diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index 5b1339d14c..08871f60cd 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2020 Jakub K?dzio?ka <kuba@kadziolka.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -234,12 +235,18 @@ running checks after installing the package."
(string-append dir "/sbin"))))
outputs))
+ ;; Do not require "bash" to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(let* ((var `("GUIX_PYTHONPATH" prefix
,(search-path-as-string->list
(or (getenv "GUIX_PYTHONPATH") "")))))
(for-each (lambda (dir)
(let ((files (list-of-files dir)))
- (for-each (cut wrap-program <> var)
+ (for-each (cut wrap-program <> #:sh (sh) var)
files)))
bindirs)))
--
2.31.1
From 0fd271eb0a955eb693ce86d4312f60b74f875908 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:20:12 +0200
Subject: [PATCH 05/18] qt-build-system: Look up the interpreter in 'inputs'.

* guix/build/qt-build-system.scm (wrap-all-programs): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/qt-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (36 lines)
diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm
index 762fd8a2ee..ec7ceb38bd 100644
--- a/guix/build/qt-build-system.scm
+++ b/guix/build/qt-build-system.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -126,6 +127,12 @@ add a dependency of that output on Qt."
(((_ . dir) ...)
dir)))
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(define handle-output
(match-lambda
((output . directory)
@@ -135,7 +142,7 @@ add a dependency of that output on Qt."
(append (list directory)
input-directories))))
(when (not (null? vars-to-wrap))
- (for-each (cut apply wrap-program <> vars-to-wrap)
+ (for-each (cut apply wrap-program <> #:sh (sh) vars-to-wrap)
bin-list)))))))
(for-each handle-output outputs)
--
2.31.1
From f7fb5c8a4e65965c7f7ce15a81782a89d1f3ec80 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:21:16 +0200
Subject: [PATCH 06/18] rakudo-build-system: Look up the interpreter in
'inputs'.

* guix/build/rakudo-build-system.scm (wrap): Pass
the shell interpreter from 'inputs' to 'wrap-program' using
'search-input-file'.

---
guix/build/rakudo-build-system.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (35 lines)
diff --git a/guix/build/rakudo-build-system.scm b/guix/build/rakudo-build-system.scm
index b2c090f946..5cf1cc55bc 100644
--- a/guix/build/rakudo-build-system.scm
+++ b/guix/build/rakudo-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -108,6 +109,12 @@
(string-append dir "/sbin"))))
outputs))
+ ;; Do not require bash to be present in the package inputs
+ ;; even when there is nothing to wrap.
+ ;; Also, calculate (sh) only once to prevent some I/O.
+ (define %sh (delay (search-input-file inputs "bin/bash")))
+ (define (sh) (force %sh))
+
(let* ((out (assoc-ref outputs "out"))
(var `("PERL6LIB" "," prefix
,(cons (string-append out "/share/perl6/lib,"
@@ -117,7 +124,7 @@
(or (getenv "PERL6LIB") "") #\,)))))
(for-each (lambda (dir)
(let ((files (list-of-files dir)))
- (for-each (cut wrap-program <> var)
+ (for-each (cut wrap-program <> #:sh (sh) var)
files)))
bindirs)
#t))
--
2.31.1
From 45d3f442dbf855619f19d4d6591585279bf1e846 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:41:22 +0200
Subject: [PATCH 07/18] gnu: carla: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/audio.scm
(carla)[arguments]<#:phases>{wrap-executables}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/audio.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index f677d46a7f..930c111d5e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -4711,9 +4711,10 @@ as is the case with audio plugins.")
(chmod (string-append out "/share/carla/carla") #o555)
#t)))
(add-after 'install 'wrap-executables
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(wrap-script (string-append out "/bin/carla")
+ #:guile (search-input-file inputs "bin/guile")
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
#t))))))
(inputs
--
2.31.1
From 045b440056a699f872cf258568612734b617cb36 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:42:58 +0200
Subject: [PATCH 08/18] gnu: bats: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bash.scm
(bats)[arguments]<#:builder>: Set #:guile argument
of ‘wrap-script’.
---
gnu/packages/bash.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 8dfbd7834e..7e98367bbb 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -402,6 +402,7 @@ capturing.")
;; Install phase
(invoke "./install.sh" %output)
(wrap-script (string-append %output "/bin/bats")
+ #:guile (search-input-file %build-inputs "bin/guile")
(list "PATH" 'prefix (string-split (getenv "PATH")
#\:))))))
(build-system trivial-build-system)
--
2.31.1
From 6d2cf56697d1bbced16a7ce4ef34304ddbbf73a7 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:46:22 +0200
Subject: [PATCH 09/18] gnu: proteinortho: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(proteinortho)[arguments]<#:phases>{wrap-programs}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 85f785955e..7d8496e692 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5447,9 +5447,11 @@ predicts the locations of structural units in the sequences.")
(add-after 'install 'wrap-programs
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((path (getenv "PATH"))
- (out (assoc-ref outputs "out")))
+ (out (assoc-ref outputs "out"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each (lambda (script)
- (wrap-script script `("PATH" ":" prefix (,path))))
+ (wrap-script script #:guile guile
+ `("PATH" ":" prefix (,path))))
(cons (string-append out "/bin/proteinortho")
(find-files out "\\.(pl|py)$"))))
#t)))))
--
2.31.1
From 8363e0e350ee482cb4d14743371c933f5e9d8163 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:48:19 +0200
Subject: [PATCH 10/18] gnu: prinseq: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(prinseq)[arguments]<#:phases>{install}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7d8496e692..37483984ec 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7557,7 +7557,8 @@ experience substantial biological insertions and deletions.")
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
- (scripts (find-files "." "prinseq.*.pl")))
+ (scripts (find-files "." "prinseq.*.pl"))
+ (guile (search-input-file "bin/guile")))
(substitute* scripts
(("\"perl -pe")
(string-append "\"" (which "perl") " -pe")))
@@ -7565,6 +7566,7 @@ experience substantial biological insertions and deletions.")
(chmod file #o555)
(install-file file bin)
(wrap-script (string-append bin "/" (basename file))
+ #:guile guile
`("PERL5LIB" ":" prefix
(,(getenv "PERL5LIB")))))
scripts)))))))
--
2.31.1
From 398d1ef1a0d547b23a4972ecc619b2c70d908aa9 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:50:07 +0200
Subject: [PATCH 11/18] gnu: gess: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(gess)[arguments]<#:phases>{install}
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 37483984ec..965e26b812 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7554,7 +7554,7 @@ experience substantial biological insertions and deletions.")
(delete 'configure)
(delete 'build)
(replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(scripts (find-files "." "prinseq.*.pl"))
@@ -10239,6 +10239,7 @@ matplotlib.use('Agg')
" line)))
;; Make sure GESS has all modules in its path
(wrap-script (string-append target "GESS.py")
+ #:guile (search-input-file inputs "bin/guile")
`("GUIX_PYTHONPATH" ":" = (,target ,(getenv "GUIX_PYTHONPATH"))))
(mkdir-p bin)
(symlink (string-append target "GESS.py")
--
2.31.1
From afa806033297984b129a8c430a8e6f0e89693368 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:54:49 +0200
Subject: [PATCH 12/18] gnu: nanopolish: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
(nanopolish)[arguments]<#:phases>{wrap-programs}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/bioinformatics.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 965e26b812..fc2fc867ac 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -13583,16 +13583,18 @@ choosing which reads pass the filter.")
(find-files "scripts" ".*"))
#t)))
(add-after 'install 'wrap-programs
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((pythonpath (getenv "GUIX_PYTHONPATH"))
(perl5lib (getenv "PERL5LIB"))
(scripts (string-append (assoc-ref outputs "out")
- "/share/nanopolish/scripts")))
+ "/share/nanopolish/scripts"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each (lambda (file)
(wrap-program file `("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
(find-files scripts "\\.py"))
(for-each (lambda (file)
- (wrap-script file `("PERL5LIB" ":" prefix (,perl5lib))))
+ (wrap-script file #:guile guile
+ `("PERL5LIB" ":" prefix (,perl5lib))))
(find-files scripts "\\.pl"))))))))
(inputs
`(("guile" ,guile-3.0) ; for wrappers
--
2.31.1
From 12671858d0b145b7c40440621c628b624f2df7fd Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:58:53 +0200
Subject: [PATCH 13/18] gnu: sieve-connect: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/mail.scm
(sieve-connect)[arguments]<#:phases>{wrap-program}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/mail.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a885e2417c..7aed1aa5bd 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2924,6 +2924,7 @@ transfer protocols.")
(let ((out (assoc-ref outputs "out"))
(path (getenv "PERL5LIB")))
(wrap-script (string-append out "/bin/sieve-connect")
+ #:guile (search-input-file inputs "bin/guile")
`("PERL5LIB" ":" = (,path)))
#t))))))
(inputs
--
2.31.1
From 39d88a8d1cd801d119056efac7b93ca2883caf2c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:04:30 +0200
Subject: [PATCH 14/18] gnu: clipmenu: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/xdisorg.scm
(clipmenu)[arguments]<#:phases>{wrap-script}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/xdisorg.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index de2cba8e57..d339851f51 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -2555,10 +2555,12 @@ tools to complement clipnotify.")
(gawk (assoc-ref inputs "gawk"))
(util-linux (assoc-ref inputs "util-linux"))
(xdotool (assoc-ref inputs "xdotool"))
- (xsel (assoc-ref inputs "xsel")))
+ (xsel (assoc-ref inputs "xsel"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each
(lambda (prog)
(wrap-script (string-append out "/bin/" prog)
+ #:guile guile
`("PATH" ":" prefix
,(map (lambda (dir)
(string-append dir "/bin"))
--
2.31.1
From cc868239ba629f2046cdb0e27e294ac11bc8cb30 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:06:12 +0200
Subject: [PATCH 15/18] gnu: vpnc-scripts: Set #:guile argument of
'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(vpnc-scripts)[arguments]<#:phases>{wrap-scripts}:
Set #:guile argument of ‘wrap-script’.
---
gnu/packages/vpn.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index a952e3f0db..33ef87c52d 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -192,10 +192,12 @@ Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
;; Wrap scripts with paths to their common hard dependencies.
;; Optional dependencies will need to be installed by the user.
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (let ((out (assoc-ref outputs "out"))
+ (guile (search-input-file inputs "bin/guile")))
(for-each
(lambda (script)
(wrap-script (string-append out "/etc/vpnc/" script)
+ #:guile guile
`("PATH" ":" prefix
,(map (lambda (name)
(let ((input (assoc-ref inputs name)))
--
2.31.1
From 97746bc3bee9bf8c8a74c8d278567a819a14265c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:09:45 +0200
Subject: [PATCH 16/18] gnu: openconnect-sso: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(openconnect-sso)[arguments]<#:phases>{wrap-qt-process-path}
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 33ef87c52d..584ff0ec84 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -326,6 +326,7 @@ and probably others.")
(assoc-ref inputs "qtwebengine")
"/lib/qt5/libexec/QtWebEngineProcess")))
(wrap-program bin
+ #:sh (search-input-file inputs "bin/bash")
`("QTWEBENGINEPROCESS_PATH" = (,qt-process-path)))
#t))))))
(inputs
--
2.31.1
From 429de9acb1e79e621b6d4da18cde816eef63ada8 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:11:50 +0200
Subject: [PATCH 17/18] gnu: protonvpn-cli: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(protonvpn-cli)[arguments]<#:phases>{wrap-wrapper}:
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 584ff0ec84..66c103e75f 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -440,6 +440,7 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
(let ((entrypoint (string-append (assoc-ref outputs "out")
"/bin/.protonvpn-real")))
(wrap-program entrypoint
+ #:sh (search-input-file inputs "bin/bash")
`("PATH" ":" prefix
,(map (lambda (name)
(let ((input (assoc-ref inputs name)))
--
2.31.1
From 00a73e18e1b62ec525a44cbe890843f1c93b9d16 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:12:55 +0200
Subject: [PATCH 18/18] gnu: wireguard-tools: Set #:sh argument of
'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
(wireguard-tools)[arguments]<#:phases>{wrap-wg-quick}:
Set #:sh argument of ‘wrap-program’.
---
gnu/packages/vpn.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 66c103e75f..34715a4cc8 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -726,6 +726,7 @@ WireGuard was added to Linux 5.6.")
(coreutils (string-append (assoc-ref inputs "coreutils")
"/bin")))
(wrap-program (string-append out "/bin/wg-quick")
+ #:sh (search-input-file inputs "bin/bash")
`("PATH" ":" prefix ,(append inputs-sbin
(list coreutils))))
#t))))))
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYLc5nBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sZcAQCNNEBfeBZhQMtfMH3dR5F5oyL3
nLgZXSUqmJN1f/JjhwEAl9XwLdvaTYG3CiPkP++J/G5rZsQIvk3kPAmAQ03h9Qc=
=EZxE
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 4 Jun 2021 23:31
Re: bug#47869: [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 47869-done@debbugs.gnu.org)
87h7idnwpb.fsf_-_@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (10 lines)
> This is version 4 of the patch series.
> It lets 'search-input-file' raise the new
> &search-error exception instead of misc-error.
>
> The documentation of 'search-input-file' has been
> adjusted to give an example of how it can be used.
>
> Also, there is one new test in tests/build-utils.scm
> ("search-input-file: can search in multiple directories").

I pushed the whole series as d1827d5c636adb395153a4ed6064629ed5b7664b:

d1827d5c63 * gnu: wireguard-tools: Set #:sh argument of 'wrap-program'.
96a2ae40fb * gnu: protonvpn-cli: Set #:sh argument of 'wrap-program'.
b74085ce36 * gnu: openconnect-sso: Set #:sh argument of 'wrap-program'.
3bbb0ec888 * gnu: vpnc-scripts: Set #:guile argument of 'wrap-script'.
a4e38cc216 * gnu: clipmenu: Set #:guile argument of 'wrap-script'.
0758ee8002 * gnu: sieve-connect: Set #:guile argument of 'wrap-script'.
b2459387b9 * gnu: nanopolish: Set #:guile argument of 'wrap-script'.
2d092a2afa * gnu: gess: Set #:guile argument of 'wrap-script'.
c4989f7569 * gnu: prinseq: Set #:guile argument of 'wrap-script'.
fadbac0ecc * gnu: proteinortho: Set #:guile argument of 'wrap-script'.
b202fdf131 * gnu: bats: Set #:guile argument of 'wrap-script'.
0a843e3643 * gnu: carla: Set #:guile argument of 'wrap-script'.
a62d17dc05 * rakudo-build-system: Look up the interpreter in 'inputs'.
2ac898d7f8 * qt-build-system: Look up the interpreter in 'inputs'.
5b24cbee31 * python-build-system: Look up the interpreter in 'inputs'.
1dbc3b2b0c * glib-or-gtk-build-system: Look up the interpreter in 'inputs'.
5378edeab4 * utils: Define ‘search-input-file’ procedure.
8b0899963f * utils: Allow overriding the shell interpreter in ‘wrap-program’.

Thank you!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 47869@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 47869
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch