guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#47869] [PATCH v3 core-updates] various cross-compilation fixes in g


From: Maxime Devos
Subject: [bug#47869] [PATCH v3 core-updates] various cross-compilation fixes in guix/build/utils.scm
Date: Tue, 01 Jun 2021 21:53:17 +0200
User-agent: Evolution 3.34.2

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.

Attachment: 0001-build-Allow-overriding-the-shell-interpreter-in-wrap.patch
Description: Text Data

Attachment: 0002-build-Define-search-input-file-procedure.patch
Description: Text Data

Attachment: 0003-glib-or-gtk-build-system-Look-up-the-interpreter-in-.patch
Description: Text Data

Attachment: 0004-python-build-system-Look-up-the-interpreter-in-input.patch
Description: Text Data

Attachment: 0005-qt-build-system-Look-up-the-interpreter-in-inputs.patch
Description: Text Data

Attachment: 0006-rakudo-build-system-Look-up-the-interpreter-in-input.patch
Description: Text Data

Attachment: 0007-gnu-carla-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0008-gnu-bats-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0009-gnu-proteinortho-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0010-gnu-prinseq-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0011-gnu-gess-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0012-gnu-nanopolish-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0013-gnu-sieve-connect-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0014-gnu-clipmenu-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0015-gnu-vpnc-scripts-Set-guile-argument-of-wrap-script.patch
Description: Text Data

Attachment: 0016-gnu-openconnect-sso-Set-sh-argument-of-wrap-program.patch
Description: Text Data

Attachment: 0017-gnu-protonvpn-cli-Set-sh-argument-of-wrap-program.patch
Description: Text Data

Attachment: 0018-gnu-wireguard-tools-Set-sh-argument-of-wrap-program.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]