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.