From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KDMlKubEu2CEIwAAgWs5BA (envelope-from ) for ; Sat, 05 Jun 2021 20:39:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +JNJJebEu2BNYQAAbx9fmQ (envelope-from ) for ; Sat, 05 Jun 2021 18:39:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D71EC21054 for ; Sat, 5 Jun 2021 20:39:33 +0200 (CEST) Received: from localhost ([::1]:48584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpbCm-0006dg-Rk for larch@yhetil.org; Sat, 05 Jun 2021 14:39:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpbCd-0006dU-Qs for guix-devel@gnu.org; Sat, 05 Jun 2021 14:39:24 -0400 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]:44324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpbCb-0002Cu-D2 for guix-devel@gnu.org; Sat, 05 Jun 2021 14:39:23 -0400 Received: from butterfly ([188.188.221.10]) by baptiste.telenet-ops.be with bizsmtp id DWfG2500M0E3zys01WfHG6; Sat, 05 Jun 2021 20:39:17 +0200 Message-ID: Subject: Question: wrap-program without #:sh can be ok even when cross-compiling? From: Maxime Devos To: guix-devel@gnu.org Date: Sat, 05 Jun 2021 20:39:10 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-BqglHrKaoq1fqKLMJUF8" 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=1622918357; bh=xVETEPIEpqod6+W4aW+5H+ssMWLkR4Dgl3VJDrxzY2c=; h=Subject:From:To:Date; b=JUA6qvLLykFquoz1WOc+ghirb4OqTQWz/PsCWtiUmZ/273x9BFl3Op4FpuH24FCX1 0cIh7kk9Q+anrntbUDreBFY448kZnxgR0sgbYRpbRjlZMK43J4y/OOthJq1osaGggt mf9czZCuaQbK0pDsEDUu78jQN1DVif+BNj41nN/dcXG/chNaZWaQDUedrWPEiDj37p s/AhrXa62+wI06aR2PrFvZGv5EFz1vWC/zNAoGTAhkDLId3fngjqoPJaqTZ7VYi0nn Sxnoy1GJ+H0Jcd3w7lUaw3GtyrNSeKseVZ0CmBHxNqZNBjf5XFnaLsm4fSW8E+B/ts WeZb98Zvhiz9g== Received-SPF: pass client-ip=2a02:1800:120:4::f00:13; envelope-from=maximedevos@telenet.be; helo=baptiste.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622918374; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xVETEPIEpqod6+W4aW+5H+ssMWLkR4Dgl3VJDrxzY2c=; b=WjxMvb+I+IN5tMAQ8r0rNcmLwHOV0WGgLq9CdMxENdrqtzq9kst+doWF154JWxc76jalvh 7ZsA0NAaDgy3Dsaf6Q/58w/KOuHTIox8VA7DoA8kynGbqWVJZSgtlJp1zV7ZPEXf0gt6eL IoWDl6Ila4awtjH4MDNseiUfN3r8TtYwYBfUZT4pJCp2a+aPP9O/kgxcWotNOHvtKaElMn ks33iJRai2FxK8iafAZzKWyn349Av34nFJqNTRtsy+LiwCivb9H9JIi9dkFDmAUJ4MDYf7 mMTmGXmoH48rAQWu8EZou6u/DcpFOz+z2RuhImyam3VIUMVmkMWTgTV39AtamQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622918374; a=rsa-sha256; cv=none; b=Lufjm6fEJrqukUoLqgzs+BbI6UEDwVgOsF/80txPhGJt715d6uyUgVawrTSgsWOvl+lFX+ 2RyJ/dRMCsm6K/JY2bRFMvrIIgWLGkPZz1JK5/QM2cJtjrYbFbax7IMdQ5iP4INOBUicHp S6Uj9+e4/hjbBqkD7BWJ96NtUX30EyfiVC0BqycwYEJpKgC7wR9QW2pVHDvkI1yoktMafC 4eUXiRT5W+DnXaExtxi8ON+pZmDzOPFTuXzp1leL7f9cmQaDwKsh62VjTB6rGemAE6XKaN vIOZisY3E1XAOquRN1gwTLtACvAsUMbBg00f/GGeOD1WUNf7FuIHDKa5EryPVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=JUA6qvLL; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r21 header.b=JUA6qvLL; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: D71EC21054 X-Spam-Score: -2.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: zwDRdKjEsxvt --=-BqglHrKaoq1fqKLMJUF8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable About (the =E2=80=98wrap-program #:sh=E2=80=99 patch series): While looking at guix/build/gnu-build-system.scm, I noticed the 'patch-shebangs' phase, which is run after the install phase. IIUC, this phase is for changing shebangs ... #!/usr/bin/stuff to ... #!/gnu/store/...-stuff-1.0/bin/stuff IIUC, this phase tries to find the interpreter in 'inputs'. So, if the original interpreter was for SYSTEM, the new interpreter is for TARGET. As such, when cross-compiling, when bash is present in the inputs, when the patch-shebangs phase isn't disabled and we use wrap-program without a #:sh argument, even though wrap-program will use an interpreter for SYSTEM, the patch-shebangs will automatically correct it for us to an interpreter for TARGET. So, is the patch series in bug#47869 still useful? * if, for some reason, patch-shebangs? is #f, then we need to explicitely #:sh set --> patch useful patch-shebangs? doesn't seem to be set to #f anywhere though. * some build systems might not have a patch-shebangs phase (I'm not aware of any such build systems though) --> patch useful * explicit is better than implicit [citation needed, see e.g. python] --> patch useful The extra verbosity seems acceptable in build systems (see e.g. usage of wrap-program in guix/build/glib-or-gtk-build-system.scm and guix/build/python-build-system.scm). Dunno about package definitions though. So I'd would say yes! But should we explicitely set #:sh (search-input-file inputs "bin/bash") in package definitions? Cons for explicit / pros for implicit (relying on patch-shebangs): * explicit form is a bit verbose * in the transition, many, many package definitions need to be adjusted. Pros for explicit / cons for explicit: * by explicitely writing #:sh (search-input-file inputs "bin/bash"), it should be clear that bash-minimal (or bash) needs to be added to the package inputs (Note that I intend to separate 'inputs' from 'native-inputs' in build phases even when compiling natively. Haven't gotten around to trying it though, seems complicated ...) Alternative: write a linter checking that wrap-program is only used if "bash" (or "bash-minimal") is in the package inputs (native-inputs doesn't count here). * Using the explicit form is always correct. The implicit #:sh (which "bi= n/bash") is not always corrected by the patch-shebangs phase. Note that when cross-compiling, not setting #:sh and when bash is absent from inputs, the patch-shebang phase merely emits a warning (which can easily get lost in the noise) and _not_ an error. Thoughts? Maxime. --=-BqglHrKaoq1fqKLMJUF8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYLvEzhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iw3AQDhmLjFrDmbVcO5MSi9eASh570G ll/pNhGwZR5CvhH3awD9FL6uIOZ4uDXqJmi9OY/xDNiuMiVuIUiPoSc33pWjQg0= =mRBK -----END PGP SIGNATURE----- --=-BqglHrKaoq1fqKLMJUF8--