From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GHnhGeRRrGWctAAAqHPOHw:P1 (envelope-from ) for ; Sun, 21 Jan 2024 00:06:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id GHnhGeRRrGWctAAAqHPOHw (envelope-from ) for ; Sun, 21 Jan 2024 00:06:12 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r24 header.b=he6zDERE; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705791972; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=JpshyRAZVQdFUHklVwiMNlGNS1vQly7BLqw5JOnbomM=; b=PpUM22FFGD6J2Fb+ayNu8pujXG08bVpmLolp3/Fl8jIU41la+7+wmqo2I9H3o3KmNY0iMZ T9hDcXO1czlbkK4+e4qYAhe2skW/lm+GWgtKpEpLZU0oRZzcOa87u8itrd+NdH4NgwxRhp RGOtt5u1hbRb3x83VMgoQuMtkeoA3RvvN3VBJxl7uOm+SsPBn0OpqREX2Dk3rcMtCQpSUX iJQYAR7NzgwwpukM8+tBtQa2IFsjxmAPaJz9eOm405i/SyleNLdtRO794nVXmRjIcw1s4W J6McM/aiGxwQXHOEDhmydEb2dy7zOatwL1tdIzxo2Cuzqyq/dMaK92ogHSdpsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r24 header.b=he6zDERE; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705791972; a=rsa-sha256; cv=none; b=H6tnWhrgqRq4YvwcG+PtNfO7d+1z9xVm14hvCLT0/WKziT++S6ni9k0f2vvm3T5dxAK7oC 5ByYcMvUNbQ59C1et1zxrvbTzKeKRn0Ib2tDKzQfjV1cslOz7t1VZxvX3udpyucTS6hplF +eSb/i11ELnMNXuf/zWl/HS/fn9yhWXNOOlodoXAbcB4Yphxkwiba4+G7Opn39tVMJfvxw l5IzqVlidLpGsXvpBBRAw4f7zEsQAU9NL7qZZrPBjrfxzoVWOEE05AxDr7BKnUag2REmOG Il2iYrr2yMoOhSXSKXMd2qRoPzsrBizwptvmfAKTXQJapIJK93ItQBfqXLbFkg== 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 12935525BD for ; Sun, 21 Jan 2024 00:06:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRKPb-0002D2-PQ; Sat, 20 Jan 2024 18:06:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRKPY-0002Cp-2Q for guix-patches@gnu.org; Sat, 20 Jan 2024 18:06:00 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRKPX-00042a-Qj for guix-patches@gnu.org; Sat, 20 Jan 2024 18:05:59 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRKPa-0005cZ-J0 for guix-patches@gnu.org; Sat, 20 Jan 2024 18:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#48849] [PATCH core-updates]: Add #:sh argument towrap-qt-program Resent-From: M Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Jan 2024 23:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48849 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Maxim Cournoyer , "48849@debbugs.gnu.org" <48849@debbugs.gnu.org> Received: via spool by 48849-submit@debbugs.gnu.org id=B48849.170579191421535 (code B ref 48849); Sat, 20 Jan 2024 23:06:02 +0000 Received: (at 48849) by debbugs.gnu.org; 20 Jan 2024 23:05:14 +0000 Received: from localhost ([127.0.0.1]:36098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRKOn-0005bG-F3 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 18:05:14 -0500 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:41724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRKOi-0005aX-GS for 48849@debbugs.gnu.org; Sat, 20 Jan 2024 18:05:12 -0500 Received: from [IPv6:2a02:1811:8c09:9d00:e5aa:e8c2:b860:4c97] ([IPv6:2a02:1811:8c09:9d00:e5aa:e8c2:b860:4c97]) by laurent.telenet-ops.be with bizsmtp id dB4w2B0081cshW701B4xZR; Sun, 21 Jan 2024 00:04:57 +0100 Message-ID: <20240121000457.dB4w2B0081cshW701B4xZR@laurent.telenet-ops.be> MIME-Version: 1.0 From: M Date: Sun, 21 Jan 2024 00:04:57 +0100 Importance: normal X-Priority: 3 In-Reply-To: <87a5ozd4nh.fsf@gmail.com> References: <678f5b29c1b5e2100bfde5b5121c57a9d2d2f3d8.camel@telenet.be> <87a5ozd4nh.fsf@gmail.com> Content-Type: multipart/alternative; boundary="_5326F311-2858-498E-AF88-2AD7831EDEB1_" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=telenet.be; s=r24; t=1705791897; bh=2KEUGb1yIVUkT0jvXqN+CZJwm7g9RxqisFxKObBe6Dc=; h=To:From:Subject:Date:In-Reply-To:References; b=he6zDEREiN8acwYqKO18aJ5OAvjO0DY2KTabn8zFjXFIPFrJl/9h9nlCTYL27Itt4 TKSMgQP1iih6UvDyUxBGf1VtnRB8pusy/55ReEMQI2fJqeNl7zzlcAYUBnMCZM1qYm T0MZY0Nz+z2St7lMJp9zr6FRrmRecav4VS4/fYnD7erP6UuoDGoKYPPrgtkHDWd8ex z/nWHbbZPhHzhSzkPRiUxCKqP4AyxcBBvs9cneI5IN54m3qBT5g+2jaoyBrCBeh2Q6 NizTuz05lN51o+wWx/FGr6sGSyLeGxxMeQlEyxjocMS3296qkIAFyh43MQrnR15lxh NVtiBpAjAMK5Q== 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.23 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: 2.23 X-Migadu-Queue-Id: 12935525BD X-TUID: /asAjo6t2B3V --_5326F311-2858-498E-AF88-2AD7831EDEB1_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" >> Subject: [PATCH 1/8] qt-utils: Allow overriding the shell interpreter in >> 'wrap-qt-program'. >> >> * guix/build/qt-utils.scm (wrap-qt-program): Introduce a #:sh keyword >> argument and pass it to 'wrap-program'. > > If bash-minimal is added to inputs as we do for other packages making > use of wrap-program, we don't need to do more, no? Why do we need to > explicit the argument here? Post-hoc reason (for the first patch): wrap-program has #:sh argument, wrap= -qt-program doesn=E2=80=99t, which is inconsistent. For the rest (to be clear I think the remaining patches can be removed): Right, technically we don=E2=80=99t. The reason is to make sure that it=E2= =80=99s the bash from inputs instead of the bash native-inputs. Currently, = at first it gets the (wrong) native bash, and later on this is fixed up by = the patch-shebangs phase, IIRC. However, (IIRC) that behaviour is a bug =E2=80=93 patch-shebangs is for /us= r/bin/=E2=80=A6 -> /gnu/store/=E2=80=A6 stuff =E2=80=93 if the code =E2=80= =9Cmake install=E2=80=9D or the like already set a proper /gnu/store/=E2=80= =A6 shebang, why automatically change it to something else? Presumably it s= et it to the right interpreter, and now patch-shebangs might autocorrupt it= . Another problem: there might not even be a patch-shebangs phase, uses of wr= ap-program, wrap-qt-program and the phase of the qt-build-system that uses = wrap-qt-program (IIRC there exists such a phase) should be usable in isolat= ion. Also, there is a hidden assumption that the uses of wrap-program are _= before_ the shebang patching, whereas it might be run afterwards as wll. Instead, I think it=E2=80=99s better for the uses of =E2=80=98wrap-program= =E2=80=99 to directly set it to the _right_ bash. That=E2=80=99s what the #:sh argument is for, but #:sh is set to by default= (which =E2=80=9Cbash=E2=80=9D), which is incorrect. Hence, #:sh needs to b= e set explicitly, and hence wrap-qt-program needs a #:sh argument or the li= ke to pass on to wrap-program. That said, I don=E2=80=99t think all this explicit #:sh is appropriate eith= er =E2=80=93 it would need to be repeated for every single package definiti= on refering to wrap-program, etc.. Instead, for the future, I=E2=80=99d pro= pose to eliminate the argument list of phases, turning phase procedures in = phase thunks and stuffing the old arguments in parameter objects instead. Then, the #:sh of =E2=80=98wrap-program=E2=80=99 could default to (search-i= nput-file (inputs) =E2=80=9Cbin/inputs=E2=80=9D) =E2=80=93 automatically co= rrect (without needing patch-shebangs) both for native and cross-compilatio= n, and when cross-compiling without =E2=80=9Cbash=E2=80=9D in (implicit) in= puts, it automatically errors out (instead of doing the wrong thing as done= currently). The phases would also be a bit less verbose to write =E2=80=93 (lambda* (#:= key this that #:allow-other-keys) (proc this) stuff =E2=80=A6) could become= (lambda () (proc) stuff =E2=80=A6). (The =E2=80=98procedure=E2=80=99 syntax (inputs) for parameter objects migh= t not be the best here, but that=E2=80=99s nothing some bikeshedding over t= he precise syntax can=E2=80=99t fix.) Bst regards, Maxime Devos (p.s. I received the mails for the other patches but I=E2=80=99m not respon= ding at the time =E2=80=93 not active with Guix currently, and borrowing an= other computer because of repairs.) --_5326F311-2858-498E-AF88-2AD7831EDEB1_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

>&= gt; Subject: [PATCH 1/8] qt-utils: Allow overriding the shell interpreter i= n

>>=C2=A0 'wrap-qt-program'.

>> 

>> * guix/= build/qt-utils.scm (wrap-qt-program): Introduce a #:sh keyword

>>=C2=A0=C2=A0 argument and pass it to 'wrap-program'.

> 

> I= f bash-minimal is added to inputs as we do for other packages making

> use of wrap-program, we don't need to do more, no?= =C2=A0 Why do we need to

> explicit the argument= here?

 

Po= st-hoc reason (for the first patch): wrap-program has #:sh argument, wrap-q= t-program doesn=E2=80=99t, which is inconsistent.

<= o:p> 

For the rest (to be clear I think = the remaining patches can be removed):

 <= /o:p>

Right, technically we don=E2=80=99t. The reas= on is to make sure that it=E2=80=99s the bash from inputs instead of the ba= sh native-inputs. Currently, at first it gets the (wrong) native bash, and = later on this is fixed up by the patch-shebangs phase, IIRC.

 

However, (IIRC) that be= haviour is a bug =E2=80=93 patch-shebangs is for /usr/bin/=E2=80=A6 -> /= gnu/store/=E2=80=A6 stuff =E2=80=93 if the code =E2=80=9Cmake install=E2=80= =9D or the like already set a proper /gnu/store/=E2=80=A6 shebang, why auto= matically change it to something else? Presumably it set it to the right in= terpreter, and now patch-shebangs might autocorrupt it.

 

Another problem: there might= not even be a patch-shebangs phase, uses of wrap-program, wrap-qt-program = and the phase of the qt-build-system that uses wrap-qt-program (IIRC there = exists such a phase) should be usable in isolation. Also, there is a hidden= assumption that the uses of wrap-program are _before_ the shebang p= atching, whereas it might be run afterwards as wll.

 

Instead, I think it=E2=80=99s be= tter for the uses of =E2=80=98wrap-program=E2=80=99 to directly set it to t= he _right_ bash.

That=E2=80=99s what the #:s= h argument is for, but #:sh is set to by default (which =E2=80=9Cbash=E2=80= =9D), which is incorrect. Hence, #:sh needs to be set explicitly, and hence= wrap-qt-program needs a #:sh argument or the like to pass on to wrap-progr= am.

 

That = said, I don=E2=80=99t think all this explicit #:sh is appropriate either = =E2=80=93 it would need to be repeated for every single package definition = refering to wrap-program, etc.. Instead, for the future, I=E2=80=99d propos= e to eliminate the argument list of phases, turning phase procedures in pha= se thunks and stuffing the old arguments in parameter objects instead.

<= p class=3DMsoNormal> 

Then, the #:s= h of =E2=80=98wrap-program=E2=80=99 could default to (search-input-file (in= puts) =E2=80=9Cbin/inputs=E2=80=9D) =E2=80=93 automatically correct (withou= t needing patch-shebangs) both for native and cross-compilation, and when c= ross-compiling without =E2=80=9Cbash=E2=80=9D in (implicit) inputs, it auto= matically errors out (instead of doing the wrong thing as done currently).<= /p>

 

The phase= s would also be a bit less verbose to write =E2=80=93 (lambda* (#:key this = that #:allow-other-keys) (proc this) stuff =E2=80=A6) could become (lambda = () (proc) stuff =E2=80=A6).

 

(The =E2=80=98procedure=E2=80=99 syntax (inputs) for par= ameter objects might not be the best here, but that=E2=80=99s nothing some = bikeshedding over the precise syntax can=E2=80=99t fix.)

 

Bst regards,

Maxime Devos

 

(p.s. I received the mails for the other patches but I=E2=80= =99m not responding at the time =E2=80=93 not active with Guix currently, a= nd borrowing another computer because of repairs.)

= --_5326F311-2858-498E-AF88-2AD7831EDEB1_--