From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OPMEDCHD8mI0dwEAbAwnHQ (envelope-from ) for ; Tue, 09 Aug 2022 22:27:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4CziCyHD8mJfhAAAauVa8A (envelope-from ) for ; Tue, 09 Aug 2022 22:27:13 +0200 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 E627223179 for ; Tue, 9 Aug 2022 22:27:12 +0200 (CEST) Received: from localhost ([::1]:44480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLVol-0004IZ-Ta for larch@yhetil.org; Tue, 09 Aug 2022 16:27:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLVoc-0004GB-EG for guix-patches@gnu.org; Tue, 09 Aug 2022 16:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLVoc-0000DX-5h for guix-patches@gnu.org; Tue, 09 Aug 2022 16:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLVoc-0001rF-24 for guix-patches@gnu.org; Tue, 09 Aug 2022 16:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH 3/6] gnu: chez-scheme: Fix use of "/bin/sh". Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Aug 2022 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org, Liliana Marie Prikler Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.16600767847098 (code B ref 57050); Tue, 09 Aug 2022 20:27:02 +0000 Received: (at 57050) by debbugs.gnu.org; 9 Aug 2022 20:26:24 +0000 Received: from localhost ([127.0.0.1]:45190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLVo0-0001qP-2P for submit@debbugs.gnu.org; Tue, 09 Aug 2022 16:26:24 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:47301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLVnx-0001q9-A2 for 57050@debbugs.gnu.org; Tue, 09 Aug 2022 16:26:22 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 24ABB5C0246; Tue, 9 Aug 2022 16:26:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 09 Aug 2022 16:26:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1660076775; x= 1660163175; bh=hetiSWDKqG4nYXQCuD/4IzXCkiYLD7/99+ApAj3xj7M=; b=c 8sydSBbjZxUXI8M69g/yg8L1AbRI74AfLMK8KIjlUcftErTx6qXPcnmmByMZbp58 WZV0mG2S4vsFZMwdLI9DD/xuY++noJ+te3IEIvriz1TGZv99NxhYqrhU5xfn0dyc aAD5mXGivWuo37Jqtu6DH+Vs+USWIocd8GlUAa2ewoRT8waeH+XQ8nMXZn6QHkUG yXTdld7jJLLXqwIfBKtZ8BzMfx7iaS3kQde5wcaij277d1PFaehJzHxpn5B+7W7a deCHHKsO7Wdq58MjIab9u1tDrM9RW/mi64MzL6aqKSOACTAUvitaNzCFXH+z1fXn NLWiPspiFlt9OMjq7/YWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660076775; x=1660163175; bh=hetiSWDKqG4nYXQCuD/4IzXCkiYL D7/99+ApAj3xj7M=; b=S8eoim3RbyDzCFqfWGR/4+WlBIus/m//7e7MzNWkvfqJ QhAaaEFi2lLmi/+oj2RWSAH7PEd0LC4ZZqaJsHk3gv2QEiNeKO+LyqFLohin/QnT 1M/QFXbX1IbNppz0sEOY8o0qdqDbbgShBNC8/TeoBUiG+zOBYcRBkvbzAfZCsG/S gpUp25rhZTC5d/3FLYCAdMsGckSApfmcP9Nw9KtrQY1sS8EaJFQK5wWTHOchFKjB NkynWeTRWe51sxi5JmTYlO5ieBHEuaheRZMAqB3egcnzZr6ZN1FlDgyfOsyQSPcx 8vJz2DMqDzVhwP06/QScUgEm+ZeW4U4dov4pFB1v1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdegtddgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhi phcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh eqnecuggftrfgrthhtvghrnhepkefhheetjeegleelheffvdevjeeludeufeffteelheev gfffvdehhedvffejueejnecuffhomhgrihhnpehgnhhurdhorhhgpdhgihhtlhgrsgdrtg homhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehp hhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Aug 2022 16:26:14 -0400 (EDT) From: Philip McGrath Date: Tue, 09 Aug 2022 16:25:54 -0400 Message-ID: <10947119.NyiUUSuA9g@avalon> In-Reply-To: <77d198cb202f2fa77ec8b54bc26a3d2e3836792c.camel@ist.tugraz.at> References: <5e5e8f491c7cbee3ef7a21437a52675dd47d186e.1659936550.git.philip@philipmcgrath.com> <77d198cb202f2fa77ec8b54bc26a3d2e3836792c.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4728651.usQuhbGJ8B"; micalg="pgp-sha512"; protocol="application/pgp-signature" 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660076833; 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=hetiSWDKqG4nYXQCuD/4IzXCkiYLD7/99+ApAj3xj7M=; b=OOj788wuYFPx0Mjl+7ctHTz2MKiBwdMZ3aVjQkmL5q5l5jw4dIrycUlayr5bZayyDbUCvx 4XzE5fCs6JpSuJ4OkqdtTfa9VfMwVwrYShDcsZh4fHvWCEnpguPGJymt2QHOn8L0HeADmi ZgTjOxCpcv8Yl79V0js/+g7XmSatYn2OIWMSgoXpaRnWG1/DPASOpa1yGLazwlGpZeSv3a PovwDMGZVToEMIT6UT/yTKXiR8rCIx2J/yjxb//qAizkU2iMF2AmNkqSR+eihbMbP+BxL8 8gEjKb4q7cScL1WQNgsDJYwuC5qFoeCT3RD57nXZItqfwsNOJydC4Pk51GVE+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660076833; a=rsa-sha256; cv=none; b=cDfoHOTWab3LJda+XVLisPFwZtiueYjWN2jaj4v41JbxgZ6m2tkT1K3uchyHnkK9gKTeXz 27pRrVXJDYB05dWWldwa//AEqB8bKT5KQg8XOluS1uMtRq5SXcKRysaqliaamRxakxTXNv eF2KtOaEhmuqrIRqXlfyNOvAlKRUBzMSq7NRr+fmiJguuEt/HZla+RSb664iHM8iZejP9F ddjuamybh/FtG75hOllGH7tIFlU5UKRv6RqQMqtP/vVGGvJN4C7DKtaMIudbYOuFpPWyTr vj/4+gK763yTCsszQAibWHxh1obGoTDZN67jLWZPL62zFzm6Ba+9ME2AQJo1gw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b="c 8sydSB"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=S8eoim3R; dmarc=none; 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" X-Migadu-Spam-Score: -1.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b="c 8sydSB"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=S8eoim3R; dmarc=none; 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" X-Migadu-Queue-Id: E627223179 X-Spam-Score: -1.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: dqfYMGltIsVd --nextPart4728651.usQuhbGJ8B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath Subject: Re: [PATCH 3/6] gnu: chez-scheme: Fix use of "/bin/sh". Date: Tue, 09 Aug 2022 16:25:54 -0400 Message-ID: <10947119.NyiUUSuA9g@avalon> Hi, On Monday, August 8, 2022 4:53:42 AM EDT Liliana Marie Prikler wrote: > Am Montag, dem 08.08.2022 um 02:10 -0400 schrieb Philip McGrath: > > +diff --git a/c/prim5.c b/c/prim5.c > > +index 5a07893..926d68d 100644 > > +--- a/c/prim5.c > > ++++ b/c/prim5.c > > +@@ -746,6 +746,22 @@ static ptr s_process(char *s, IBOOL stderrp) { > > + > > + INT tofds[2], fromfds[2], errfds[2]; > > + struct sigaction act, oint_act; > > ++ /* BEGIN PATCH for Guix */ > > ++#if defined(GUIX_RKTIO_BIN_SH) > > ++# define GUIX_AS_a_STR_HELPER(x) #x > > ++# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x) > > ++ /* A level of indirection makes `#` work as needed: */ > > ++ struct stat guix_stat_buf; > > ++ char *guix_sh =3D > > ++ (0 =3D=3D stat(GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH), &guix_stat_buf= )) > > ++ ? GUIX_AS_a_STR(GUIX_RKTIO_BIN_SH) > > ++ : "/bin/sh"; > > ++# undef GUIX_AS_a_STR > > ++# undef GUIX_AS_a_STR_HELPER > > ++#else /* GUIX_RKTIO_BIN_SH */ > > ++ char *guix_sh =3D "/bin/sh"; > > ++#endif > > ++ /* END PATCH for Guix */ >=20 > /* BEGIN PATCH for Guix */ and /* END PATCH for Guix */ is in my humble > opinion superfluous (though apparently also present in the already > exsting patch, whose author might disagree). My goal here originally was making it clear in `guix build --source` exactl= y=20 what we'd changed from upstream. (That's less relevant for the patches with= =20 "backport" in the name, which have all been merged upstream.) It certainly = is=20 debatable, given that "guix" is mentioned in the variable/macro names, but,= =20 given that it's currently there, I'm not inclined to change the status quo. > Also, I think this could easily be submitted upstream if you named it > RKTIO_SHELL and rktio_shell respectively, with the default to > "/bin/sh". Then, we'd simply have to -DRKTIO_SHELL=3D/path/to/bin/sh in > our #:make-flags. >=20 I'm not strongly opposed to sending these patches upstream. The main reason= I=20 haven't, and also the reason that, were I a Racket committer (which I'm not= ),=20 I'd be slightly hesitant to merge them, is that I can't think of a=20 circumstance other than Guix for which these patches would be useful: even = Nix=20 apparently provides "/bin/sh" and "/bin/env" in build containers. If the patches are indeed specific to Guix, they haven't been a burden to=20 maintain=E2=80=94this is the only time they've been changed at all=E2=80=94= and keeping them=20 ourselves gives us maximum flexibility to change them if we do want to for = any=20 reason. In any case, even if we do upstream them, we'd still need the patches until= =20 8.7. >=20 > As for absorbing racket-specific patches into chez-scheme itself, I'm > not too sure if I agree with that approach. Maybe a different prefix > rather than RKTIO should be used here =E2=80=93 one that fits chez. >=20 I can understand the hesitation, but I think on balance these are not "Rack= et- specific patches". First, just in case this wasn't clear, the issue affects= both=20 variants of Chez Scheme: see the end of this email for an example. More=20 generally, any programming language that provides a way to run shell comman= ds=20 will need to deal with this issue: that includes libc's `system` function (= I=20 haven't looked at what we do there), and it also came up with SML/NJ: https= :// lists.gnu.org/archive/html/help-guix/2021-11/msg00036.html =46or the packages that are developed in the main Racket Git repository, I = would=20 be loathe to use more than one preprocessor macro for this purpose. While a= t=20 the moment it works nicely for us to control all of the intermediate build= =20 steps explicitly as Guix packages, many build modes handle some of those st= eps=20 automatically, and it would be very unpleasant to have to configure with th= ree=20 different flags, potentially in both CPPFLAGS and CPPFLAGS_FOR_BUILD. The question, then, comes down to upstream Chez Scheme, and to me the benef= its=20 of using the same macro for these two very closely related projects far=20 outweighs the downside. (For one metric of their interrelationship, over 10= %=20 of the commits to upstream Chez since it became free software in 2016 have= =20 come from Racket contributors=E2=80=94though this metric badly undercounts = the c.=20 375,000 lines of code developed by Dybvig et al. since 1984.) I guess another possibility would be to call the macro something like=20 GUIX_BIN_SH. That would make sense if we intended to adopt this approach mo= re=20 broadly, as I suggested in the email linked above about SML/NJ, but I think= =20 we'd need some consensus in that case to reserve a concise name that would= n't=20 conflict with other uses in Guix. =2DPhilip =2D-8<---------------cut here---------------start------------->8--- philip@avalon:~$ guix shell --container chez-scheme -- scheme Chez Scheme Version 9.5.8 Copyright 1984-2022 Cisco Systems, Inc. > (get-string-all (car (process "echo $BASH"))) "/bin/sh\n" >=20 philip@avalon:~$ guix shell --container chez-scheme-for-racket -- scheme Chez Scheme Version 9.5.7.6 Copyright 1984-2021 Cisco Systems, Inc. > (get-string-all (car (process "echo $BASH"))) "/bin/sh\n" >=20 philip@avalon:~$ philip@avalon:~$ guix time-machine --url=3Dhttps://gitlab.com/philip1/guix-= patches --commit=3D5e5e8f491c7cbee3ef7a21437a52675dd47d186e --disable- authentication -- shell --container chez-scheme -- scheme Updating channel 'guix' from Git repository at 'https://gitlab.com/philip1/ guix-patches'... guix time-machine: warning: channel authentication disabled Computing Guix derivation for 'x86_64-linux'... - Chez Scheme Version 9.5.8 Copyright 1984-2022 Cisco Systems, Inc. > (get-string-all (car (process "echo $BASH"))) "/gnu/store/chfwin3a4qp1znnpsjbmydr2jbzk0d6y-bash-minimal-5.1.8/bin/sh\n" >=20 philip@avalon:~$ guix time-machine --url=3Dhttps://gitlab.com/philip1/guix-= patches --commit=3D5e5e8f491c7cbee3ef7a21437a52675dd47d186e --disable- authentication -- shell --container chez-scheme-for-racket -- scheme Updating channel 'guix' from Git repository at 'https://gitlab.com/philip1/ guix-patches'... guix time-machine: warning: channel authentication disabled Computing Guix derivation for 'x86_64-linux'... - Chez Scheme Version 9.5.7.6 Copyright 1984-2021 Cisco Systems, Inc. > (get-string-all (car (process "echo $BASH"))) "/gnu/store/chfwin3a4qp1znnpsjbmydr2jbzk0d6y-bash-minimal-5.1.8/bin/sh\n" >=20 =2D-8<---------------cut here---------------end--------------->8--- --nextPart4728651.usQuhbGJ8B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmLywtIACgkQygNjjfo/ HHprphAAtObMqsomh1epZIg2h/O/j1gKZkGOTpcHxZVdBOoLdgSwhAt8lXo/Vvo8 p6ig3b9L7tYgRY37BJPo2L5TBWiMo/vwIT4MTmaU46f9Zl8dnOJrX04yv4X4L1zu gtoBll5UWoLB4E6A6KPgBEh5ZvARwTXQ8tdmrM8nq73nWM5bWCwS79gf62xRQOxL /9twly4clqqZ4CgYJYr9ISZfj6/jwLWXRBnmPlyTiP+UU44OP9w+WKQUQVzssIc5 cHKECptyy1Cqz++AzkXVHdUIg67JMufRYrKGmeW0JfgkH9C2E1UzlM0keQdlha6G /oz9r/JcUBH1JLNsFAUe7rkZrXtADBehuQwchs1YLuuG+uYiCksNHVBI4+sGnni6 //Rhqvbro0becNHHpz6xgLDGfN/kxE5hVbSV5n48ibf0IiE7c+CSfsTTbBYZX5Vp 0RoVz5wzJDXqma8Sk9JRZBJUAJ3Wz2SX4o/Cc12YMIKoz8aBgTCQ4drcJFlaRItc aFVc7ru4SIogLSJIgXQki0o1Xso48AUcI8AMzZf/DaRAVpD0EBl2j3qJkVnYH2GH y2if+mx52aS6CDIIEHHeqnUjrGkI/wMsBHHA+bH8x6YR5UJz8gGwiAE/9BEmV8vD jiCgT1NExFwmiBerpgDjgmUTmEtCB3UV6OlQVfJH9H5v6hFL0Ic= =6Ozx -----END PGP SIGNATURE----- --nextPart4728651.usQuhbGJ8B--