From debbugs-submit-bounces@debbugs.gnu.org Thu May 27 00:27:07 2021 Received: (at 48682) by debbugs.gnu.org; 27 May 2021 04:27:07 +0000 Received: from localhost ([127.0.0.1]:50423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lm7bv-0006Ms-Ai for submit@debbugs.gnu.org; Thu, 27 May 2021 00:27:07 -0400 Received: from mail-qv1-f51.google.com ([209.85.219.51]:36809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lm7bs-0006MN-HE for 48682@debbugs.gnu.org; Thu, 27 May 2021 00:27:05 -0400 Received: by mail-qv1-f51.google.com with SMTP id ez19so1982136qvb.3 for <48682@debbugs.gnu.org>; Wed, 26 May 2021 21:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=5rmSIbgzobPgg4KGoJUsBi52B/s9s4XncYb/oX5a4Uw=; b=QyZB4G68druzintn7ivVKuDZN2NbFbeSJ9Oq3ga1swPpeqhXclHRRojiqlIoBkGnq4 md++tXLfBm7lic019AwhscR9ebVPstCZJChfeglCQUTPAXRkG7QlniS4dekVxtH1HJmt Rxb0Us6LFvqesVv4r4tlnq6OdyZJxkVkY9isDMMAWQuc1BaXBQvm0CyTSV07F4SZ8fcd epv0AvBxexgM3CBTNcxOUKWnXTv2P++HpSmUdl8kgsG3KQxBCxMjMs34z1ZhbUBb2WQr 4FFquGEcIUWE5IY5l+RUMsJI1JjUulS053o2XCsmEqv6W5xePwmVe6CnhVpl2Wfzz5GN ArBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5rmSIbgzobPgg4KGoJUsBi52B/s9s4XncYb/oX5a4Uw=; b=lyZ1lxe82qgnKvbC7Z9QPljxVFudwa/PHBw9z/dm7TJMHju7X4ML1ZHDHZ6V6drkVO nBCScY39mIwRhLSOXTSQnn9F/cVIeyXa8vRLHnftC1mxGuGgayJ+XzsGBBzO4twbyuYw QLtQ62Gcgb3aiJ0PpepxCvq/nVsFF6M+nuuaDtR2R7DxNMMfk2pX8/955oOD2/fC2NHh x5F+MV+1tcMpGzl1Byt2if1Bqzb21DIu7X5Yf3Qafj2dX7QJmAjlpeUNEz8E9kGXUrru SV8e21uFCOFkKGCTfOlXUs651gqbD0gPFiNAV/Q6L94jEvIRMFPtjhOSEnh5H8qlP7xR xkow== X-Gm-Message-State: AOAM530vg6ue2JT7yC++L7yeDDMGobtB5hGoIwoc5oyRPjoK4g5MOqmB Ja13nGKxTMRUFD3sPT+zrwx5e+KhhO7OaEVd0Qg= X-Google-Smtp-Source: ABdhPJwocwtPPFvF/u8kh7r6zccRHLDbch1ai7d4eYnGXpuPlGKzYLNyt1ZL6Z8AlRBUt45uikLgGQ== X-Received: by 2002:a05:6214:c6c:: with SMTP id t12mr1456160qvj.34.1622089618569; Wed, 26 May 2021 21:26:58 -0700 (PDT) Received: from [192.168.45.135] (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with ESMTPSA id k75sm670332qke.103.2021.05.26.21.26.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 May 2021 21:26:57 -0700 (PDT) Subject: Re: recursive import between (gnu packages chez) and (gnu packages racket) To: raingloom , 48682@debbugs.gnu.org References: <20210526205455.3431430c@riseup.net> From: Philip McGrath Message-ID: <7bb14837-cd53-45f6-f572-7493c2b1bb50@philipmcgrath.com> Date: Thu, 27 May 2021 00:26:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210526205455.3431430c@riseup.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 48682 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hi, I've been working on Racket packaging. I haven't looked into this much yet---hopefully I can tomorrow---but here are a few quick thoughts. On 5/26/21 2:54 PM, raingloom wrote: > I also haven't found any other mention of chez-scheme in racket.scm > other than the line that imports it, which is weird, given that Racket This was my doing. When I added `(gnu packages racket)` in [1], I adapted the patch from a racket.scm I'd been using to experiment ([2], also some branches of [3]): the changes that actually use (gnu packages chez) aren't ready to go yet, but apparently I left the import line in. On 5/26/21 2:54 PM, raingloom wrote: > other than the line that imports it, which is weird, given that Racket > is now built on Chez, so I'd expect it to use it as an input. I guess > it's a bundled version? In any case I don't think I should just remove > the import, because it will be needed eventually, so this issue needs > to be fixed by then. Racket uses a fork of Chez Scheme: I described the situation in [4]. Racket won't have upstream Chez as an input in the foreseeable, but, from a packaging perspective, building Racket's Chez fork uses many of the same pieces as building upstream Chez. I think it may make sense to refactor out some of the common infrastructure, so both `(gnu packages racket)` and `(gnu packages chez)` could depend on some low-level module, but I'm not sure what the Guix-preferred way to organize things would be. (I'm mostly a Racketeer using Racket packaging to learn more about Guix.) Here are some ways `(gnu packages chez)` and `(gnu packages racket)` are intertwined, in no particular order: - `racket-minimal` should use the `nanopass` and `stex` origins as `chez-scheme` does. (But it would be easiest to do this once I've changed `racket-minimal` to build from the Git source, rather than the bootstrapped tarball: I hope that will be soon.) Some more of my not-quite-current thoughts on that at [5]. - The `chez-scheme` phases `unpack-nanopass+stex`, `configure`, `prepare-stex`, and `install-doc` should be shared with Racket. I think it would be better to put them in a build-side module and actually share them, rather than to do tricky things to extract their s-expression representation from `(package-arguments chez-scheme)`. On the other hand, I think a build system would be overkill: it would only build vanilla Chez and Racket-flavored Chez. - Racket-flavored Chez has added some backends that vanilla Chez doesn't support (and can't be readily ported, unless upstream Chez eventually adopts Racket's changes to generating backends). In particular, Racket-flavored Chez adds support for threading on ARMv6 and support for aarch64 (which vanilla Chez doesn't support at all). I haven't thought at all deeply about this, but it might make sense for the default `chez-scheme` package on those architectures to be Racket-flavored Chez. - We may in fact want to use Racket to bootstrap vanilla Chez. Chez has the usual problem with self-hosting compilers that you need the old version to compile the new version. Specifically, you need "bootfiles", which encapsulate the Scheme-implemented portion of Chez, compiled to machine code. Thus, (a) they are platform- specific and (b) they need to agree precisely with the C-implemented part of Chez on the layout of datatypes and such. The vanilla Chez Git repository [6] has bootfiles for i686, x86_64, and (non-threaded) ARMv6. Once you've done a native build for one of those platforms, you can use it to cross-compile for any platform Chez supports (ppc32, various BSDs, etc.). But these are binary blobs. From a "trusting trust" perspective, it's especially striking if you consider that Chez Scheme was non-free software from 1984 to 2016, and the first libre release likewise needed the bootfiles of its ancestors. (However, building bootfiles is reproducible: Chez in fact builds them twice and errors if they aren't byte-for-byte identical.) But Racket is able to simulate enough of Chez to (slowly) compile the Chez compiler and generate bootfiles, providing a path to Chez from just a C compiler. Racket does its whole bootstrapping process regularly in CI, and I'm working on getting the Guix package to do likewise. Unfortunately, the Racket fork has diverged enough from vanilla Chez that the current Racket "cs-bootstrap" package [7] can't build vanilla Chez, but I hope that the solution is just a matter of walking through the Git history to find the right older version of the bootstrapping package, before the Racket fork's `#!base-rtd` gained a vector of ancestors rather than a parent and a few such things. But I'd like to be able to build Racket packages with Guix before I try that :) Ok, that got a bit long. I don't know where the cycle came from with `emacs-geiser-racket`, but I think it would be reasonable either to do some refactoring to `(gnu packages chez)` and `(gnu packages racket)`, or to just remove the import for now to un-break things and figure out the rest later. -Philip [1]: https://issues.guix.gnu.org/47829 [2]: https://gitlab.com/philip1/guix-racket-experiment [3]: https://gitlab.com/philip1/guix-patches/ [4]: https://issues.guix.gnu.org/46865#3 [5]: https://issues.guix.gnu.org/47153#2 [6]: https://github.com/cisco/ChezScheme [7]: https://github.com/racket/racket/tree/master/racket/src/ChezScheme/rktboot