From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6HvAMG5DdGCd1QAAgWs5BA (envelope-from ) for ; Mon, 12 Apr 2021 14:56:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sJWAKm5DdGC/LgAAB5/wlQ (envelope-from ) for ; Mon, 12 Apr 2021 12:56:14 +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 3BA5E1BC4B for ; Mon, 12 Apr 2021 14:56:14 +0200 (CEST) Received: from localhost ([::1]:56634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVw6u-0002hk-6R for larch@yhetil.org; Mon, 12 Apr 2021 08:56:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVw6k-0002hX-3I for guix-patches@gnu.org; Mon, 12 Apr 2021 08:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVw6j-0000ky-SL for guix-patches@gnu.org; Mon, 12 Apr 2021 08:56:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lVw6j-0006OF-Qj for guix-patches@gnu.org; Mon, 12 Apr 2021 08:56:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47180] [PATCH] gnu: racket: Don't inject store paths into Racket files. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Apr 2021 12:56: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: jackhill@trilug.org, 47180@debbugs.gnu.org Received: via spool by 47180-submit@debbugs.gnu.org id=B47180.161823215124537 (code B ref 47180); Mon, 12 Apr 2021 12:56:01 +0000 Received: (at 47180) by debbugs.gnu.org; 12 Apr 2021 12:55:51 +0000 Received: from localhost ([127.0.0.1]:56822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVw6Y-0006Na-Ib for submit@debbugs.gnu.org; Mon, 12 Apr 2021 08:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVw6W-0006NL-W7 for 47180@debbugs.gnu.org; Mon, 12 Apr 2021 08:55:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53860) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVw6R-0000YW-CK; Mon, 12 Apr 2021 08:55:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48058 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lVw5s-0007Jm-2a; Mon, 12 Apr 2021 08:55:27 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210316025632.9767-1-philip@philipmcgrath.com> <87wnt9zwix.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Germinal an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 12 Apr 2021 14:55:06 +0200 In-Reply-To: (Philip McGrath's message of "Sun, 11 Apr 2021 23:40:59 -0400") Message-ID: <878s5npsr9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1618232174; 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: 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; bh=DIx8wvOKDe78lBI5xcGN6DkG+/uBP8qlAxlf+w4vU/s=; b=bqoWZN+aDNwy1ZpnYZ5atONmbEf1ZxMpleYcVPOakCLGzLjOmtaJ1oWiROEQDVJprh/9jL 82EfkAxkSDcNRkik0cx7REmBAABwrlh+TK2VMR0RYZ2I3VJIqvr4msqPIs9CWTNf44lK3s K+l4C1z4KJA5oEdZgsJmxJSbvsbSNensdqFbPPQA45NR/wnVsmcOp5vx07hy8mYzylYCKH Ouv245oCtoVVMbKkwn3Edb+b4DhydhWkHFFy9gRzxBhB1yPTyuOTvzKvn5dqwhC/f9Vme8 n0K8raL2BTsrgCaXmQT0Q6X/eeaia2f5a8UDIWv7bc50AkhSSY2u9WaRSv9tWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618232174; a=rsa-sha256; cv=none; b=qyjDtoLRIDEBEcmX/An2yHzc7Mp8yaAHjaQmT3NltVUBvMDFSAfrm/fE5pDvUdhmVNErdm wg/fO107t8L7C9tyD2bT0u6wwYJf2Ba45m/6isP5mhMzaLnZYSh+2cH5mMnpAi6bLw7A1v ZHBoRYA7uOehuMXBq/Lm9H+tadOCzQct23iTL9yafLPKjBciDvhp5eJNLsZTNB/wOkN8a/ 9bNV+HdKDAxdyP1bdGNLjt1ie5kEsX6UpQ897WCXQRtdTT4SjY+TO9nZzJV/bxSRZCw0Fi ftKQjfW5a+sQuBqzvCGTm4viqKwi21gQC2a4Mb43NqP00/IxfI8JczguPLFn9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: -2.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 3BA5E1BC4B X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2snUilh30CLY Hi Philip, Philip McGrath skribis: > So there seem to be at least three bad cases: > > 1. The grafter can mangle .zo files so that Racket can't > read them at all. > 2. The grafter can miss store references in .zo files, so Racket could > end up using the ungrafted versions. > 3. With a garbage collection, Racket could try to use the ungrafted > versions but fail to find them at runtime. Yes, similar to the problems observed with SBCL: https://issues.guix.gnu.org/33848 >> Would it be an option to instead turn off compression and keep doing >> things as usual? > > In theory, this should be possible. I see two significant downsides: > > 1. Compiled code would be much larger=E2=80=94maybe twice as big=E2=80= =94and, if I > recall correctly, load times would be worse, too. With the move to > Racket CS, existing Racket code moved from a world of small and > cheap bytecode to a world of machine code: the default compression > settings have been tuned to avoid an unacceptable worsening of > binary size and load time. Interesting (I=E2=80=99m curious how load time can be improved by (1) readi= ng files in memory instead of merely mmap=E2=80=99ing, and (2) decompressing.) [...] > More broadly, I think the best strategy for Racket packaging will be, > as much as possible, to use Racket's supported configuration features=20 > rather than Guix-specific hacks. This seems especially viable since > Racket has been willing to accept unobtrusive patches upstream that > help things go smoothly for Guix, e.g. with 8.1 we should no longer > need any patches to the build scripts: we're all friendly, > parentheses-loving folks. That makes sense to me, I=E2=80=99m all for uniting with parentheses-loving folks of the world. :-) > For another example, it looks like existing > "racket-store-checksum-override.patch" fixes a previous issue > discussed in caused by grafting zo > files: I hope this change will also let us remove that patch, though > I'd want to test more before proposing we drop it. So these problems > aren't fundamentally new; they just have an additional symptom since > the change to Racket CS by default in Racket 8.0. If we can fix the > root problem of violating Racket's assumptions by patching zo files, > we should be able to stop hunting down symptoms. OK. I=E2=80=99m testing v2 of the patch and will push shortly if everything goes well. > Rather than using "config.rktd", an alternative approach would be to > set things up so that `dlopen` would find the foreign libraries, > perhaps via `LD_LIBRARY_PATH`. This has some intriguing possibilities: > I could imagine Guix providing an alternate `dlopen` implementation > that might be useful beyond Racket. What would that alternate dlopen do? It still has to know where to look for things, somehow. > Nix apparently configures some things via `LD_LIBRARY_PATH`, but their > approach (as I understand it) relies on generating Racket scripts > around all Racket-generated executable, which causes other > problems. There should be workarounds, but it seems better to avoid > going down that road if we can. Yeah, as a rule of thumb I=E2=80=99d say: don=E2=80=99t fiddle with LD_LIBR= ARY_PATH. > Finally, here's a sketch of how `guix import racket` and such might > work. Racket's package system has a concept of "package scope", so > that "installation" scope can coexist with narrower scopes (mostly > per-user scope, though there are more complex possibilities). Right > now, Guix puts installation scope in the read-only store, which > basically corresponds to how other package managers put it in > root-owned places, except Guix can't write to the store to install > additional packages. I'm still at the information-gathering stage, but > my current thinking is that the hypothetical `racket-build-system` > should basically take the source package and turn it into what Racket > calls a "built" package ready to be installed in `static-link` mode, > which includes compiling the code and building the docs (which can > involve quite a lot, e.g. ray tracing icons). Then a profile hook > could knit together all of the Racket packages into an installation > package scope. For packages that depend on foreign libraries, this > would be a chance for Guix to add the necessary paths to the > "config.rktd" for the installation. I=E2=80=99m not sure I follow the details and I=E2=80=99m glad you have a p= lan. Finally having a Racket importer would be sweet! Thanks! Ludo=E2=80=99.