From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MIUVA2xGUGA9cQAA0tVLHw (envelope-from ) for ; Tue, 16 Mar 2021 05:47:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2KlhOmtGUGBLbAAAB5/wlQ (envelope-from ) for ; Tue, 16 Mar 2021 05:47:23 +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 A349812BDA for ; Tue, 16 Mar 2021 06:47:23 +0100 (CET) Received: from localhost ([::1]:34310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM2Y6-0007Ln-EU for larch@yhetil.org; Tue, 16 Mar 2021 01:47:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM2Us-0003tp-3W for guix-patches@gnu.org; Tue, 16 Mar 2021 01:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lM2Ur-0007kj-QJ for guix-patches@gnu.org; Tue, 16 Mar 2021 01:44:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lM2Ur-0008Mo-OI for guix-patches@gnu.org; Tue, 16 Mar 2021 01:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47180] [PATCH] gnu: racket: Don't inject store paths into Racket files. Resent-From: Jack Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Mar 2021 05:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Philip McGrath Cc: 47180@debbugs.gnu.org Received: via spool by 47180-submit@debbugs.gnu.org id=B47180.161587339232076 (code B ref 47180); Tue, 16 Mar 2021 05:44:01 +0000 Received: (at 47180) by debbugs.gnu.org; 16 Mar 2021 05:43:12 +0000 Received: from localhost ([127.0.0.1]:37797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lM2U4-0008LI-41 for submit@debbugs.gnu.org; Tue, 16 Mar 2021 01:43:12 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:43872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lM2U2-0008L3-Mn for 47180@debbugs.gnu.org; Tue, 16 Mar 2021 01:43:11 -0400 Received: from marsh.hcoop.net ([45.55.52.66]) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lM2Tx-0001rq-7U; Tue, 16 Mar 2021 01:43:05 -0400 Date: Tue, 16 Mar 2021 01:43:05 -0400 (EDT) From: Jack Hill X-X-Sender: jackhill@marsh.hcoop.net In-Reply-To: <20210316025632.9767-1-philip@philipmcgrath.com> Message-ID: References: <20210316025632.9767-1-philip@philipmcgrath.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="925712948-1221268349-1615870838=:8138" Content-ID: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615873643; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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; bh=Fy29XSBBQPjD0kgrLzCvCZdS+Izz36j8EPDdakM46Tw=; b=WCa/sbZ1V9Ez6t7lxDHFhwRJtrhf/IxZgUxqslWjs8f5si+JcmHHIsQVdcGxJMNMFH+BGg kTJnqHKvrArtAvWvjaDZNTSr1lfJmypG3wOtS7uVrTXP6IimGlx7DyQ5IJrKVSmuTNLZTI KibaL3bl/fifJPuMnJc5CnnNNoGj5ge7BZNafwJ0DfZhHkXvyS6Adczlh+93N4RvrBFcxG OMi3QRTtAAKas6BsGrpu919/Zhp9T8n/fYjuqnxhoYMlisedOvw22SOZ0uAIMo33C6OtKq BIoI78PMGdst3h1wJbFZn3YFJwmlu9PKS5crLVxfEa78oMJlwSQcDgw/aU4zgg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615873643; a=rsa-sha256; cv=none; b=U7o7ZbBTeoq3b+WpQ5o48bajYiQAyoqq6Nm7aAPirCiSngPB+nN+VDyCqUtfWoYlvSRVQF tX27IToffp4d5Of/6ka8Vkcj/GQSCh6H6ASX0hT/QUgg402ImSc0D4SFu9GohcTijRprgr 0wBRxbwqL1WEJTkH56qMI29UnP1CSL4omsRNIkj+PYHcUc7OlJ3GDafGHTdSdpFX7tSyS6 /Hzk0CBdI+hYgOc+5sON7NLtVnd7ZBFCvgU+VqaFVGKrESxdAOtXyHD41CDE3tJNvB+wzs y+S1DN5VZeCs16S6zzRLboU5FHsjGiQ7/pDKChMYwlCBR8h2xzokQOT+9gAgsw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.40 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A349812BDA X-Spam-Score: -1.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: LY7zgxxDeBhT This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --925712948-1221268349-1615870838=:8138 Content-Type: text/plain; CHARSET=UTF-8; FORMAT=flowed Content-Transfer-Encoding: 8BIT Content-ID: Wow, that was speedy. Thanks for the care you've taken thinking about these issues. I've tested applying and building this patch and it works! (Now that DrRacket starts it appears that I may have a font issue with it. I'll investigate more an open a separate bug if so.) I don't think I know enough about Guix or Racket internals to give it a proper review or judge whether this will be robust against future grafting problems, but I do have a few comments `git am` complained about the following, but I can't spot them looking at the patch. .git/rebase-apply/patch:83: trailing whitespace. .git/rebase-apply/patch:100: trailing whitespace. .git/rebase-apply/patch:122: trailing whitespace. -- .git/rebase-apply/patch:124: new blank line at EOF. On Mon, 15 Mar 2021, Philip McGrath wrote: > Apparently, during grafting, Guix can somehow mangle compiled > Racket CS files (.zo) such that Racket will refuse to load them. > (Maybe it has something to do with compression?) > So, we stop patching Racket sources with absolute paths to store > files (i.e. for foreign libraries to dlopen). > Instead, we put them in a data file that doesn't get compiled or, > in one case, embed it in C. […] > +Guix should enable the special case by defining the C preprocessor > +macro `GUIX_RKTIO_PATCH_BIN_SH` with the path to `sh` in the store. > +If: > + > + 1. The `GUIX_RKTIO_PATCH_BIN_SH` macro is defined; and > + > + 2. `rktio_process` is called with the exact path "/bin/sh"; and > + > + 3. "/bin/sh" does not exist (if it does, we don't want to change > + the expected behavior); and Do we really want #3? That would have a different effect than the current patching behavior intends. /bin/sh is present by default on Guix System, and likely to be present of foreign distros. I think in generally we like to avoid this dynamic binding and instead use the sh that was included as a package input. > + 4. The path specified by `GUIX_RKTIO_PATCH_BIN_SH` does exists; > + > +then `rktio_process` will execute the file specified > +by `GUIX_RKTIO_PATCH_BIN_SH` instead of "/bin/sh". > + > +Compared to previous attempts to patch the Racket sources, > +making this change at the C level is both: > + > + - More comprehensive: it catches all attempts to execute "/bin/sh", > + without having to track down the source of every occurance; and > + > + - Less intrusive: by guarding the special case with a C preprocessor > + conditional and a runtime check that the file in the store exists, > + we make it much less likely that it will "leak" out of Guix. Again, I might be wrong by preferring to always avoid /bin/sh even when it's available. Hopefully someone more knowledgeable will come along. Best, Jack --925712948-1221268349-1615870838=:8138--