From patchwork Tue Jun 1 19:53:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 29745 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0556F27BC78; Tue, 1 Jun 2021 20:54:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3B46527BC81 for ; Tue, 1 Jun 2021 20:54:10 +0100 (BST) Received: from localhost ([::1]:45348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loASn-0006El-A2 for patchwork@mira.cbaines.net; Tue, 01 Jun 2021 15:54:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loASg-0006Dh-Qc for guix-patches@gnu.org; Tue, 01 Jun 2021 15:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1loASg-0005Y6-In for guix-patches@gnu.org; Tue, 01 Jun 2021 15:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1loASg-0005x1-Hk for guix-patches@gnu.org; Tue, 01 Jun 2021 15:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47869] [PATCH v3 core-updates] various cross-compilation fixes in guix/build/utils.scm Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Jun 2021 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47869 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47869@debbugs.gnu.org Received: via spool by 47869-submit@debbugs.gnu.org id=B47869.162257721922839 (code B ref 47869); Tue, 01 Jun 2021 19:54:02 +0000 Received: (at 47869) by debbugs.gnu.org; 1 Jun 2021 19:53:39 +0000 Received: from localhost ([127.0.0.1]:37745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loAS9-0005w9-Nv for submit@debbugs.gnu.org; Tue, 01 Jun 2021 15:53:39 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:40446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loAS4-0005vx-Og for 47869@debbugs.gnu.org; Tue, 01 Jun 2021 15:53:28 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id BvtN2500J0mfAB401vtNpi; Tue, 01 Jun 2021 21:53:23 +0200 Message-ID: <3319cbc48171ae821c3297f9e5cbb8e9011b87ed.camel@telenet.be> From: Maxime Devos Date: Tue, 01 Jun 2021 21:53:17 +0200 In-Reply-To: <0892bdfbc097b07631190c8526a41d57b456d343.camel@telenet.be> References: <0892bdfbc097b07631190c8526a41d57b456d343.camel@telenet.be> User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1622577203; bh=wDDGeAGKEPs+THl/fEy4bjgXKEbZ+NG5VOzfx+4Pnz0=; h=Subject:From:To:Date:In-Reply-To:References; b=qP3p6zrQznBtvHxQj8AuMgojvOLrVT3b/mJIzNe69Jl2xa+/WV/zlFLDsyn+7ZJBh /BG0s0PvEFmKLSIjRyzn22G1rJooaOPIQ9EFyi5iVJq9EsjXadRP1UTLK3jMCywOCT h/e2zarjGnrQCswdAJWC+EaWRb5uYP5rkpKsvNBDJYrfkGbrO/MU4esdmpEsIamIq+ 28YuVOWbkwt+K8IO253MFKns5u3U5x3veU4XrK6Q5M4U339Te2yzB44baNUJvsw9yq I+b5M22iaLtLTe9OBtS2bFlWhCYv1EdEai9RPFX8EgrBsggZN5sJFAHVdwe1auK7Bf MdUYJjY13zd5Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 c1ab0f5161254e66ae3515df60440dd4bcb46fd4 Mon Sep 17 00:00:00 2001 From: Maxime Devos 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(+) 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