From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mIz3GkTP8GJyJAAAbAwnHQ (envelope-from ) for ; Mon, 08 Aug 2022 10:54:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qPkVG0TP8GIgXwAA9RJhRA (envelope-from ) for ; Mon, 08 Aug 2022 10:54:28 +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 366AD2B345 for ; Mon, 8 Aug 2022 10:54:28 +0200 (CEST) Received: from localhost ([::1]:44098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKyWp-0002Fg-4B for larch@yhetil.org; Mon, 08 Aug 2022 04:54:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKyWQ-0002FU-LC for guix-patches@gnu.org; Mon, 08 Aug 2022 04:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKyWQ-00016m-C0 for guix-patches@gnu.org; Mon, 08 Aug 2022 04:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKyWQ-00076O-77 for guix-patches@gnu.org; Mon, 08 Aug 2022 04:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH 3/6] gnu: chez-scheme: Fix use of "/bin/sh". Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Aug 2022 08:54: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: Philip McGrath , 57050@debbugs.gnu.org Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.165994883227267 (code B ref 57050); Mon, 08 Aug 2022 08:54:02 +0000 Received: (at 57050) by debbugs.gnu.org; 8 Aug 2022 08:53:52 +0000 Received: from localhost ([127.0.0.1]:39167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKyWF-00075i-Dg for submit@debbugs.gnu.org; Mon, 08 Aug 2022 04:53:52 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:11461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKyWB-00075X-0w for 57050@debbugs.gnu.org; Mon, 08 Aug 2022 04:53:50 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4M1VNl2hDHz3wV0; Mon, 8 Aug 2022 10:53:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1659948823; bh=0rPGzw2ALIzS2fJ05fp08B5T/L9IauUbLS/YD9Czo6A=; h=Subject:From:To:Date:In-Reply-To:References; b=oHjnbMrlk78sRE73Ky6XTzKegoG56VWhC5doONzeY5vwxxmpmO9XjsmIvimNVYnBv wnvxYPqweDKOSxGSLG6AW4D3aszHpe7z0+9OM2/oSDvgBBkYDifA/SUqoh+oFch5Ay PEszQGGoSBnk+u3tbKeWG1xoAbXb6faZCsSH/AU8= Message-ID: <77d198cb202f2fa77ec8b54bc26a3d2e3836792c.camel@ist.tugraz.at> From: Liliana Marie Prikler Date: Mon, 08 Aug 2022 10:53:42 +0200 In-Reply-To: <5e5e8f491c7cbee3ef7a21437a52675dd47d186e.1659936550.git.philip@philipmcgrath.com> References: <5e5e8f491c7cbee3ef7a21437a52675dd47d186e.1659936550.git.philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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=1659948868; 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: content-transfer-encoding:content-transfer-encoding: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=0rPGzw2ALIzS2fJ05fp08B5T/L9IauUbLS/YD9Czo6A=; b=pmxPuATx3a5qE0bHS5GtnY6fmnjPQdE/5QHN3VS2LLAf2Vmq1C/K/IZb2hB+f/O6pJh2ao TUxWbxTakZCQEmnqgEgRKuqtFnAu/XYe+Qxm4bGUvG+5XxrX/d6sMeTmFmmk34YNTyqkjg Th7G0d+FHWN+XI3Ktv8U6X67Hw6ew8loH59Pg07G+WQQznJOqo6jQp0EJ05QEmWilZyTQm 52gf+pHaj+uQeru0UYDQxCBcCeAF5OQcteqDGx3KMJ0jNDGeocMCP0yCwh/S6rGuoUY4Ou jXmpbrtBSStGuD22HcMFPDJc5qPKf+DGRG3ow13ENNtjqx7wHidxvnbV072n0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659948868; a=rsa-sha256; cv=none; b=H1v2g1VBBDKIBXwACZ2XIYUEIaIx2jb/oMZ2iNR5nw6cBWYNOXn1F8ct3rLs5h88yESf0Y CMe1zqFwi16PbfMG135WNrfo+uFDs/7KJWPPmqwCIMoX7msjuwYHIewHbeLMYpqbjtSfLA GBCBRfu/ksdqnyVxzy6VPNxEoQQwJ5lHAYL9aYDHUMyGBmpaZr4vTar6npKeeXGHDkHJZ4 umZ8TNM5IV8wXpBdZGO/dqCP10K1jWpM5qi+pmdbyP00VMQ6OJ2aPUzOE9KQ765gH223Wf L4mkuD/did2OSP5Ir4ebyHSQOsKzZspoOL8tZ0CXAE6IKFFWbNShF2UKRNtM0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=oHjnbMrl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=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: 7.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=oHjnbMrl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=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: 366AD2B345 X-Spam-Score: 7.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: U8Oqvy6r3aTS Am Montag, dem 08.08.2022 um 02:10 -0400 schrieb Philip McGrath: > The unsuccessful attempt to execute "/bin/sh" by Chez Scheme's > 'process' > function seems to have caused parts of the Chez Scheme test suite to > have been silently skipped. The issue was exposed by the upcoming > changes to Racket's build system. > > * gnu/packages/patches/chez-scheme-bin-sh.patch, > gnu/packages/patches/racket-chez-scheme-bin-sh.patch: New patches. > * gnu/packages/patches/racket-minimal-sh-via-rktio.patch: Rename to > ... > * gnu/packages/patches/racket-rktio-bin-sh.patch: ... this, refresh > with > upstream, and shorten the macro name. > * gnu/local.mk (dist_patch_DATA): Update accordingly. > * gnu/packages/racket.scm (%racket-origin)[patches]: Likewise. > (racket-vm-common-configure-flags): Likewise. > * gnu/packages/chez.scm (chez-scheme)[origin]: Likewise. > [inputs]: Add bash-minimal. > [arguments]<#:configure-flags>: Set CPPFLAGS to enable new patches. > --- >  gnu/local.mk                                  |  4 +- >  gnu/packages/chez.scm                         |  5 ++ >  gnu/packages/patches/chez-scheme-bin-sh.patch | 66 > +++++++++++++++++++ >  .../patches/racket-chez-scheme-bin-sh.patch   | 66 > +++++++++++++++++++ >  ...-rktio.patch => racket-rktio-bin-sh.patch} | 28 ++++---- >  gnu/packages/racket.scm                       |  5 +- >  6 files changed, 158 insertions(+), 16 deletions(-) >  create mode 100644 gnu/packages/patches/chez-scheme-bin-sh.patch >  create mode 100644 gnu/packages/patches/racket-chez-scheme-bin- > sh.patch >  rename gnu/packages/patches/{racket-minimal-sh-via-rktio.patch => > racket-rktio-bin-sh.patch} (79%) > > diff --git a/gnu/local.mk b/gnu/local.mk > index 234f21ad33..e827feed36 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -940,6 +940,7 @@ dist_patch_DATA > =                                           \ >    %D%/packages/patches/ceph-boost-compat.patch                 \ >    %D%/packages/patches/ceph-rocksdb-compat.patch               \ >    %D%/packages/patches/cheese-vala- > update.patch                        \ > +  %D%/packages/patches/chez-scheme-bin- > sh.patch                        \ >    %D%/packages/patches/chmlib-inttypes.patch                   \ >    %D%/packages/patches/cl-asdf-config- > directories.patch                \ >    %D%/packages/patches/clamav-config-llvm-libs.patch           \ > @@ -1769,7 +1770,8 @@ dist_patch_DATA > =                                         \ >    %D%/packages/patches/ripperx-missing-file.patch              \ >    %D%/packages/patches/rpcbind-CVE-2017-8779.patch             \ >    %D%/packages/patches/rtags-separate- > rct.patch                        \ > -  %D%/packages/patches/racket-minimal-sh-via-rktio.patch       \ > +  %D%/packages/patches/racket-chez-scheme-bin-sh.patch         \ > +  %D%/packages/patches/racket-rktio-bin-sh.patch               \ >    %D%/packages/patches/remake-impure- > dirs.patch                        \ >    %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ >    %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch      \ > diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm > index 4c253effa0..66098c7a24 100644 > --- a/gnu/packages/chez.scm > +++ b/gnu/packages/chez.scm > @@ -34,6 +34,7 @@ (define-module (gnu packages chez) >    #:use-module (guix build-system copy) >    #:use-module (guix build-system gnu) >    #:use-module (guix build-system copy) > +  #:use-module (gnu packages bash) >    #:use-module (gnu packages compression) >    #:use-module (gnu packages ncurses) >    #:use-module (gnu packages ghostscript) > @@ -269,6 +270,7 @@ (define-public chez-scheme >                 (base32 >                  > "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) >                (file-name (git-file-name name version)) > +              (patches (search-patches "chez-scheme-bin-sh.patch")) >                (snippet #~(begin >                             (use-modules (guix build utils)) >                             ;; TODO: consider putting this in a (guix > ...) or > @@ -287,6 +289,7 @@ (define-public chez-scheme >        `(,util-linux "lib") ;<-- libuuid >        zlib >        lz4 > +      bash-minimal ;<-- for process >        ncurses ;<-- for expeditor >        ;; for X11 clipboard support in expeditor: >        ;; > https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 > @@ -313,6 +316,8 @@ (define-public chez-scheme >                          (cut memq 'threads <>)) >                   #~("--threads") >                   #~()) > +          ,(string-append "CPPFLAGS=-DGUIX_RKTIO_BIN_SH=" > +                          #$(file-append bash-minimal "/bin/sh")) >            "ZLIB=-lz" >            "LZ4=-llz4" >            "--libkernel" > diff --git a/gnu/packages/patches/chez-scheme-bin-sh.patch > b/gnu/packages/patches/chez-scheme-bin-sh.patch > new file mode 100644 > index 0000000000..e6228e3264 > --- /dev/null > +++ b/gnu/packages/patches/chez-scheme-bin-sh.patch > @@ -0,0 +1,66 @@ > +From c170f0f3a326f293ee1f460a70303382966ca41b Mon Sep 17 00:00:00 > 2001 > +From: Philip McGrath > +Date: Thu, 19 May 2022 13:41:56 -0400 > +Subject: [PATCH] patch s_process for "/bin/sh" on Guix > + > +This patch reuses the C preprocessor macro `GUIX_RKTIO_BIN_SH` > +from a previous patch. > + > +If: > + > +    1. The `GUIX_RKTIO_BIN_SH` macro is defined; and > + > +    2. The path specified by `GUIX_RKTIO_BIN_SH` exists; > + > +then `s_process` will call `execl` with the file specified by > +`GUIX_RKTIO_BIN_SH` instead of "/bin/sh". > + > +This patch does not change the behavior of `s_system`, which relies > +on `system` from the C library. > +--- > + c/prim5.c | 20 +++++++++++++++++++- > + 1 file changed, 19 insertions(+), 1 deletion(-) > + > +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 = > ++      (0 == 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 = "/bin/sh"; > ++#endif > ++    /* END PATCH for Guix */ /* 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). 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=/path/to/bin/sh in our #:make-flags. > ++        /* BEGIN PATCH for Guix */ > ++        execl(guix_sh, guix_sh, "-c", s, NULL); > ++        /* END PATCH for Guix */ Likewise. 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 – one that fits chez. Cheers