Message ID | 20220213215127.218952-8-philip@philipmcgrath.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 62D6F27BBEB; Sun, 13 Feb 2022 21:55:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B778627BBE9 for <patchwork@mira.cbaines.net>; Sun, 13 Feb 2022 21:55:10 +0000 (GMT) Received: from localhost ([::1]:57810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1nJMpp-0006GH-Pf for patchwork@mira.cbaines.net; Sun, 13 Feb 2022 16:55:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nJMon-0005cg-2q for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nJMom-0001uJ-Pl for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nJMom-0003EM-Q3 for guix-patches@gnu.org; Sun, 13 Feb 2022 16:54:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Resent-From: Philip McGrath <philip@philipmcgrath.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Feb 2022 21:54:04 +0000 Resent-Message-ID: <handler.53878.B53878.164478920112272@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53878@debbugs.gnu.org Cc: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>, Philip McGrath <philip@philipmcgrath.com> Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164478920112272 (code B ref 53878); Sun, 13 Feb 2022 21:54:04 +0000 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:21 +0000 Received: from localhost ([127.0.0.1]:39067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1nJMo5-0003Br-D6 for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:21 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <philip@philipmcgrath.com>) id 1nJMo0-0003BF-Hs for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:17 -0500 Received: by mail-qk1-f179.google.com with SMTP id o25so12986324qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CYgngiATXaLMvhaAGpIcMnIeSYTe0mOCGRZVfgJ63WI=; b=jwW6YlLJr67sTXjSSCYhaU+Ee2tKd4zfgBQZfritpRkdmyeq46bjieZWRBTLmotQnv cp9qgc24fXjD+YcrKvS7QIs1UqfyrDMjb+pLKLXCRAHYcsoftlbLbu+1KuhFMkqBkoDK WegsfAPVTBw7/Dy44TCTaYpJ8O3EtDIUYFyBm6eJpjHpKV+1LvhqJ66mWZok80gSZAiX nNuul7BohRtbMskBw3dUKEZkoovuBSUQY7PiDMem1FLO4J2ROw+GUQjmkRBhO9T7FYDa Pe46/Plk0XhElQlkUFD0lFWYj+xECM2BNLXom8HRwGU7D9pIpP3HYlIhy9cFgn1CG8gA ponA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CYgngiATXaLMvhaAGpIcMnIeSYTe0mOCGRZVfgJ63WI=; b=fN5pn4s2ew1SoBzLr1xLF911K3WfudyolH8ptYU3rxyDM+4xY4U2mYYQuQDRQYKtKd 1+O291grVSovy3NImfd9B7D7FQN6Bz6+ISnVh0nsvMjCFNYpRgmW4aTMDDAe7I5jDpN7 qW4rZOmOLlqi2CcQsAzXHDINgqFdPCarPlwoiNABXhR6E8DHB8BzU0EXEbeJJzXKrfrk 43/qGxAUUDXNRN5bZ/Xf9oO7ORdJGzPtivXrLpsxfxWQDwPu/3m4TJKt7hPKfVdVcvc+ NVOsmozv+CfWQEXQcd6Sr99IID9k4tL5NjWerC4QC26CVyJkT24QH5NHOj30PdcVfKZE 61Ag== X-Gm-Message-State: AOAM530G5Rur89Amm5b3Ik2UPx+NYZIBvvud//ehGPIKW4gABvUEozL4 xysJhFXdwD2uB0azqsbnonjIfNnScGRTAd+QFXo= X-Google-Smtp-Source: ABdhPJzBsVoWBxh3noXT2CiNvW834eIn5XQKLWRzaQ01NtfwdWfJ94aYPGV2JRBPt6ErbvKyS7tkkQ== X-Received: by 2002:a05:620a:1928:: with SMTP id bj40mr5471915qkb.520.1644789191024; Sun, 13 Feb 2022 13:53:11 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id m17sm16938970qtk.53.2022.02.13.13.53.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:10 -0800 (PST) From: Philip McGrath <philip@philipmcgrath.com> Date: Sun, 13 Feb 2022 16:51:23 -0500 Message-Id: <20220213215127.218952-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <aa99da7a8bf48cb2f375dfad0bca7ddd67c48916.camel@ist.tugraz.at> <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
Update Racket to 8.4. Adjust Chez Scheme packages.
|
|
Commit Message
Philip McGrath
Feb. 13, 2022, 9:51 p.m. UTC
This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]: Add new phase 'unpack-bootfiles'. [version, source, home-page]: Derive from 'chez-scheme-bootstrap-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 57 ++++++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-)
Comments
Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > This might seem a bit silly in isolation, but it makes the structure > of the upstream Chez Scheme package the same as for the Racket > variant, it sets things up for (one day, hopefully) actually being > able to bootstrap the upstream Chez Scheme bootfiles, and it may be > useful for cross-compilation and adding support for architectures > without pre-built bootfiles from upstream. > > * gnu/packages/chez-and-racket-bootstrap.scm > (chez-scheme-bootstrap-bootfiles): New variable. > (chez-scheme)[native-inputs]: Add it. > [arguments]: Add new phase 'unpack-bootfiles'. > [version, source, home-page]: Derive from 'chez-scheme-bootstrap- > bootfiles'. > --- While having chez-scheme-bootstrap-bootfiles (silly name) does make some kind of sense, making chez-scheme inherit from it does not. Given that we don't have a chez-scheme bootstrap tower at hand, you should probably make (chez-scheme-bootstrap) a procedure which takes chez- scheme's origin as argument and returns the full package. Also, while technically a violation of the DRY principle, you are allowed to type out the homepage multiple times.
Hi, On 2/14/22 09:54, Liliana Marie Prikler wrote: > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >> This might seem a bit silly in isolation, but it makes the structure >> of the upstream Chez Scheme package the same as for the Racket >> variant, it sets things up for (one day, hopefully) actually being >> able to bootstrap the upstream Chez Scheme bootfiles, and it may be >> useful for cross-compilation and adding support for architectures >> without pre-built bootfiles from upstream. >> >> * gnu/packages/chez-and-racket-bootstrap.scm >> (chez-scheme-bootstrap-bootfiles): New variable. >> (chez-scheme)[native-inputs]: Add it. >> [arguments]: Add new phase 'unpack-bootfiles'. >> [version, source, home-page]: Derive from 'chez-scheme-bootstrap- >> bootfiles'. >> --- > While having chez-scheme-bootstrap-bootfiles (silly name) does make > some kind of sense, making chez-scheme inherit from it does not. Given > that we don't have a chez-scheme bootstrap tower at hand, you should > probably make (chez-scheme-bootstrap) a procedure which takes chez- > scheme's origin as argument and returns the full package. > Making a function is an interesting idea, but I'm not sure I'm quite picturing what you have in mind. I will see if I can figure out something that seems reasonable as I revise this series, if I don't hear from you before then. One reason I like making the bootfiles a package is that a set of bootfiles includes artifacts in addition to the bootfiles themselves, such as generated C headers describing the layout of Scheme objects in memory, some of which are not included as part of an installed Chez Scheme. For example, imagine someone wants to run Chez Scheme on FreeBSD: upstream does not distribute BSD bootfiles, so they must be cross-compiled. Even though Guix doesn't have a C toolchain for FreeBSD (AFAIK), Guix could be used to reproducibly build the needed bootfiles and pack a "source" tarball to be used on a FreeBSD build machine. Also, the process for building bootfiles is largely orthogonal to building the actual `scheme` executable, and it seems like eventually it may be useful to be able to override options separately. There may be other ways to address these sorts of things, and it's true that a lot of this has more to do with my intuition of what might be work well in the future, rather than something that actually works right now. Is there a technical reason to prefer either repeating the home page, license, etc. or writing e.g. `(package-license chez-scheme-bootstrap-bootfiles)` rather than using inheritance? -Philip
Hi, Am Mittwoch, dem 16.02.2022 um 16:13 -0500 schrieb Philip McGrath: > Hi, > > On 2/14/22 09:54, Liliana Marie Prikler wrote: > > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > > > This might seem a bit silly in isolation, but it makes the > > > structure of the upstream Chez Scheme package the same as for the > > > Racket variant, it sets things up for (one day, hopefully) > > > actually being able to bootstrap the upstream Chez Scheme > > > bootfiles, and it may be useful for cross-compilation and adding > > > support for architectures without pre-built bootfiles from > > > upstream. > > > > > > * gnu/packages/chez-and-racket-bootstrap.scm > > > (chez-scheme-bootstrap-bootfiles): New variable. > > > (chez-scheme)[native-inputs]: Add it. > > > [arguments]: Add new phase 'unpack-bootfiles'. > > > [version, source, home-page]: Derive from 'chez-scheme-bootstrap- > > > bootfiles'. > > > --- > > While having chez-scheme-bootstrap-bootfiles (silly name) does make > > some kind of sense, making chez-scheme inherit from it does not. > > Given that we don't have a chez-scheme bootstrap tower at hand, you > > should probably make (chez-scheme-bootstrap) a procedure which > > takes chez-scheme's origin as argument and returns the full > > package. > > > Making a function is an interesting idea, but I'm not sure I'm quite > picturing what you have in mind. I will see if I can figure out > something that seems reasonable as I revise this series, if I don't > hear from you before then. I was picturing something like (define chez-bootfiles (chez ...) (package/inherit chez (inputs ...) (native-inputs ...) (build-system ...) (arguments ...))) > One reason I like making the bootfiles a package is that a set of > bootfiles includes artifacts in addition to the bootfiles themselves, > such as generated C headers describing the layout of Scheme objects > in memory, some of which are not included as part of an installed > Chez Scheme. For example, imagine someone wants to run Chez Scheme on > FreeBSD: upstream does not distribute BSD bootfiles, so they must be > cross-compiled. Even though Guix doesn't have a C toolchain for > FreeBSD (AFAIK), Guix could be used to reproducibly build the needed > bootfiles and pack a "source" tarball to be used on a FreeBSD build > machine. > > Also, the process for building bootfiles is largely orthogonal to > building the actual `scheme` executable, and it seems like eventually > it may be useful to be able to override options separately. Again, I'm with you on making chez-bootfiles a package and your rationale sounds reasonable, but I don't think it's correct to say that chez inherits from them. IIUC it is rather the other way around; the bootfiles contain precompiled versions of Chez among other things. > Is there a technical reason to prefer either repeating the home page, > license, etc. or writing e.g. `(package-license > chez-scheme-bootstrap-bootfiles)` rather than using inheritance? You should not write (package-license chez-scheme-bootstrap-files), that's the point! For one, that's exactly what inheritance would do unless you specify the field (technical reason), but more importantly, as a reader, using (package-license this-other-chez-thing) sends me on a journey to track down this-other-chez-thing while determining the license of chez! That's just silly (social reason). Cheers
Hi, On 2/17/22 02:10, Liliana Marie Prikler wrote: > Hi, > > Am Mittwoch, dem 16.02.2022 um 16:13 -0500 schrieb Philip McGrath: >> Hi, >> >> On 2/14/22 09:54, Liliana Marie Prikler wrote: >>> Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >>>> This might seem a bit silly in isolation, but it makes the >>>> structure of the upstream Chez Scheme package the same as for the >>>> Racket variant, it sets things up for (one day, hopefully) >>>> actually being able to bootstrap the upstream Chez Scheme >>>> bootfiles, and it may be useful for cross-compilation and adding >>>> support for architectures without pre-built bootfiles from >>>> upstream. >>>> >>>> * gnu/packages/chez-and-racket-bootstrap.scm >>>> (chez-scheme-bootstrap-bootfiles): New variable. >>>> (chez-scheme)[native-inputs]: Add it. >>>> [arguments]: Add new phase 'unpack-bootfiles'. >>>> [version, source, home-page]: Derive from 'chez-scheme-bootstrap- >>>> bootfiles'. >>>> --- >>> While having chez-scheme-bootstrap-bootfiles (silly name) does make >>> some kind of sense, making chez-scheme inherit from it does not. >>> Given that we don't have a chez-scheme bootstrap tower at hand, you >>> should probably make (chez-scheme-bootstrap) a procedure which >>> takes chez-scheme's origin as argument and returns the full >>> package. >>> >> Making a function is an interesting idea, but I'm not sure I'm quite >> picturing what you have in mind. I will see if I can figure out >> something that seems reasonable as I revise this series, if I don't >> hear from you before then. > I was picturing something like > > (define chez-bootfiles (chez ...) > (package/inherit chez > (inputs ...) > (native-inputs ...) > (build-system ...) > (arguments ...))) > Sorry, I still don't think I'm following. Would this rely on the `mative-inputs` being thunked to let the result of this function be an input to `chez-scheme`? What commonality is the function abstracting over, compared to having 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez-scheme-bootstrap-bootfiles'? (I'm using "-bootstrap-bootfiles" because there are also other kinds of bootfiles: applications can create their own bootfiles, e.g. "racket.boot", and using Chez as a cross-compiler also involves more bootfiles.) >> Is there a technical reason to prefer either repeating the home page, >> license, etc. or writing e.g. `(package-license >> chez-scheme-bootstrap-bootfiles)` rather than using inheritance? > You should not write (package-license chez-scheme-bootstrap-files), > that's the point! For one, that's exactly what inheritance would do > unless you specify the field (technical reason), but more importantly, > as a reader, using (package-license this-other-chez-thing) sends me on > a journey to track down this-other-chez-thing while determining the > license of chez! That's just silly (social reason). That makes some sense with respect to the license and home page, but what about 'package-source' and 'package-version'? -Philip
Hi, Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip McGrath: > Hi, > > On 2/17/22 02:10, Liliana Marie Prikler wrote: > > [...] > > I was picturing something like > > > > (define chez-bootfiles (chez ...) > > (package/inherit chez > > (inputs ...) > > (native-inputs ...) > > (build-system ...) > > (arguments ...))) > > > > Sorry, I still don't think I'm following. Would this rely on the > `mative-inputs` being thunked to let the result of this function be > an input to `chez-scheme`? Yes. > What commonality is the function abstracting over, compared to having > 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- > scheme-bootstrap-bootfiles'? At the moment version, source, home-page and license. I don't really think bootstrap files ought to be a part of chez' source, so if you wanted to do this really cleanly, you'd have to drop them from chez and add restrict chez-bootstrap to them, which would imply you'd have to use (version (package-version chez-scheme)) explicitly – for now I don't want to add too much burden to that patch and you can assume source to be the same between the two. > (I'm using "-bootstrap-bootfiles" because there are also other kinds > of bootfiles: applications can create their own bootfiles, e.g. > "racket.boot", and using Chez as a cross-compiler also involves more > bootfiles.) I have no idea how useful that feature is or how widely it is used, but if those are just binary blobs needed to get chez scheme running, we ought to treat them as that. That makes some sense with respect to the license and home page, but > > > That makes some sense with respect to the license and home page, but > what about 'package-source' and 'package-version'? Your patch currently makes them the same for both, so you tell me :P See above for long-term plans. Cheers
Hi, On 2/17/22 03:19, Liliana Marie Prikler wrote: > Hi, > > Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip McGrath: >> Hi, >> >> On 2/17/22 02:10, Liliana Marie Prikler wrote: >>> [...] >>> I was picturing something like >>> >>> (define chez-bootfiles (chez ...) >>> (package/inherit chez >>> (inputs ...) >>> (native-inputs ...) >>> (build-system ...) >>> (arguments ...))) >>> >> >> Sorry, I still don't think I'm following. Would this rely on the >> `mative-inputs` being thunked to let the result of this function be >> an input to `chez-scheme`? > Yes. > >> What commonality is the function abstracting over, compared to having >> 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- >> scheme-bootstrap-bootfiles'? > At the moment version, source, home-page and license. I don't really > think bootstrap files ought to be a part of chez' source, so if you > wanted to do this really cleanly, you'd have to drop them from chez and > add restrict chez-bootstrap to them, which would imply you'd have to > use (version (package-version chez-scheme)) explicitly – for now I > don't want to add too much burden to that patch and you can assume > source to be the same between the two. > Ok, this helps, I think. I'll give it a try. In <https://issues.guix.gnu.org/47153#9> you argued---and convinced me---that we should keep the pre-built bootfiles in the origin until we actually don't need them. With 'chez-scheme-for-racket', that's already true, and there aren't bootfiles in that origin anyway. When someday we can actually bootstrap upstream Chez Scheme, presumably we'll add a snippet to delete the pre-built bootfiles from the origin, at which point the it will still be the same origin for both. -Philip
Hi, Am Donnerstag, dem 17.02.2022 um 03:40 -0500 schrieb Philip McGrath: > Hi, > > On 2/17/22 03:19, Liliana Marie Prikler wrote: > > Hi, > > > > Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip > > McGrath: > > > Hi, > > > > > > On 2/17/22 02:10, Liliana Marie Prikler wrote: > > > > [...] > > > > I was picturing something like > > > > > > > > (define chez-bootfiles (chez ...) > > > > (package/inherit chez > > > > (inputs ...) > > > > (native-inputs ...) > > > > (build-system ...) > > > > (arguments ...))) > > > > > > > > > > Sorry, I still don't think I'm following. Would this rely on the > > > `mative-inputs` being thunked to let the result of this function > > > be > > > an input to `chez-scheme`? > > Yes. > > > > > What commonality is the function abstracting over, compared to > > > having > > > 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- > > > scheme-bootstrap-bootfiles'? > > At the moment version, source, home-page and license. I don't > > really > > think bootstrap files ought to be a part of chez' source, so if you > > wanted to do this really cleanly, you'd have to drop them from chez > > and > > add restrict chez-bootstrap to them, which would imply you'd have > > to > > use (version (package-version chez-scheme)) explicitly – for now I > > don't want to add too much burden to that patch and you can assume > > source to be the same between the two. > > > > Ok, this helps, I think. I'll give it a try. > > In <https://issues.guix.gnu.org/47153#9> you argued---and convinced > me---that we should keep the pre-built bootfiles in the origin until > we actually don't need them. With 'chez-scheme-for-racket', that's > already true, and there aren't bootfiles in that origin anyway. When > someday we can actually bootstrap upstream Chez Scheme, presumably > we'll add a snippet to delete the pre-built bootfiles from the > origin, at which point the it will still be the same origin for both. This concerns schez-scheme-for-racket, not the current chez-scheme for which we are packaging the bootfiles, am I right? Given that we build a set of bootfiles that would be enough to go forward, we no longer need the original bootfiles beyond that point, i.e. the "bootstrap bootfiles" would only be needed inside chez-bootstrap, but not chez itself (which can instead use the native-input). Am I missing something here?
Hi, Here is a v2! Liliana, I tried using a function to generate the bootfile packages as you suggested, but I didn't like the result---though it is very possible I still didn't properly understand what you had in mind. I hope what I've done in this version addresses the concerns you raised about inverted inheritance and such anyway: if you'd like to compare the two, in the repository at <https://gitlab.com/philip1/guix-patches> I've tagged this series as `guix-issue-53878-v2` and the alternate as `guix-issue-53878-v2-bootfiles-proc`. I'll also include the diff below. Other than that, I hope I've addressed all your comments. > diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm > index 3e90a15d94..cbdddb1e98 100644 > --- a/gnu/packages/chez-and-racket-bootstrap.scm > +++ b/gnu/packages/chez-and-racket-bootstrap.scm > @@ -720,21 +720,18 @@ (define* (stex-make #:optional (suffix "")) > and 32-bit PowerPC architectures.") > (license license:asl2.0))) > > -(define (bootfiles-for-chez chez) > - (package/inherit chez > - (outputs '("out")) > +(define-public chez-scheme-bootstrap-bootfiles > + (package > + (inherit chez-scheme) > + (name "chez-scheme-bootstrap-bootfiles") > (inputs '()) > (native-inputs '()) > + (outputs '("out")) > (build-system copy-build-system) > ;; TODO: cross compilation > (arguments > (list #:install-plan > - #~`(("boot/" "lib/chez-scheme-bootfiles")))))) > - > -(define-public chez-scheme-bootstrap-bootfiles > - (package > - (inherit (bootfiles-for-chez chez-scheme)) > - (name "chez-scheme-bootstrap-bootfiles") > + #~`(("boot/" "lib/chez-scheme-bootfiles")))) > (supported-systems > ;; Upstream only distributes pre-built bootfiles for > ;; arm32le and t?(i3|a6)(le|nt|osx) > @@ -822,28 +819,34 @@ (define-public chez-scheme-for-racket > (license license:asl2.0))) > > (define-public chez-scheme-for-racket-bootstrap-bootfiles > - (let ((chez (bootfiles-for-chez chez-scheme-for-racket))) > - (package > - (inherit (bootfiles-for-chez chez)) > - (name "chez-scheme-for-racket-bootstrap-bootfiles") > - (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) > - (arguments > - (substitute-keyword-arguments (package-arguments chez) > - ((#:phases those-phases #~%standard-phases) > - #~(modify-phases #$those-phases > - (add-after 'unpack 'chdir > - (lambda args > - (chdir "racket/src/ChezScheme"))) > - (add-after 'chdir 'unpack-nanopass+stex > - (lambda args > - #$unpack-nanopass+stex)) > - (add-before 'install 'build > - (lambda* (#:key native-inputs inputs #:allow-other-keys) > - (invoke (search-input-file (or native-inputs inputs) > - "/opt/racket-vm/bin/racket") > - "rktboot/main.rkt"))))))) > - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") > - (description "Chez Scheme is a self-hosting compiler: building it > + (package > + (inherit chez-scheme-bootstrap-bootfiles) > + (name "chez-scheme-for-racket-bootstrap-bootfiles") > + (version (package-version chez-scheme-for-racket)) > + (source (package-source chez-scheme-for-racket)) > + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) > + (arguments > + (substitute-keyword-arguments > + (package-arguments chez-scheme-bootstrap-bootfiles) > + ((#:phases those-phases #~%standard-phases) > + #~(modify-phases #$those-phases > + (add-after 'unpack 'chdir > + (lambda args > + (chdir "racket/src/ChezScheme"))) > + (add-after 'chdir 'unpack-nanopass+stex > + (lambda args > + #$unpack-nanopass+stex)) > + (add-before 'install 'build > + (lambda* (#:key native-inputs inputs #:allow-other-keys) > + (invoke (search-input-file (or native-inputs inputs) > + "/opt/racket-vm/bin/racket") > + "rktboot/main.rkt"))))))) > + (home-page "https://github.com/racket/ChezScheme") > + ;; ^ This is downstream of https://github.com/racket/racket, > + ;; but it's designed to be a friendly landing place for people > + ;; who want a ChezScheme-shaped repositroy. > + (synopsis "Chez Scheme bootfiles bootstrapped by Racket") > + (description "Chez Scheme is a self-hosting compiler: building it > requires ``bootfiles'' containing the Scheme-implemented portions compiled for > the current platform. (Chez can then cross-compile bootfiles for all other > supported platforms.) > @@ -857,7 +860,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles > > Note that the generated bootfiles are specific to Racket's fork of Chez > Scheme, and @code{cs-bootstrap} does not currently support building upstream > -Chez Scheme.")))) > +Chez Scheme."))) > > ;; > ;; Chez's bootstrap dependencies: -Philip Philip McGrath (15): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add racket-vm-cgc. gnu: Add racket-vm-bc. gnu: Add chez-scheme-for-racket. gnu: Add racket-vm-cs. gnu: chez-mit: Support chez-scheme-for-racket. gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. gnu: racket: Update to 8.4. gnu/local.mk | 5 +- gnu/packages/chez-and-racket-bootstrap.scm | 1070 ++++++++++++ gnu/packages/chez.scm | 628 +++---- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 +++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1553 +++++++++++------ 8 files changed, 2813 insertions(+), 942 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch
diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 90fd63b5ae..38708ab690 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -216,9 +216,9 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) -(define-public chez-scheme +(define-public chez-scheme-bootstrap-bootfiles (package - (name "chez-scheme") + (name "chez-scheme-bootstrap-bootfiles") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. (version "9.5.6") @@ -230,8 +230,45 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet unbundle-chez-submodules))) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((mach (nix-system->chez-machine system #:threads? #f))) + (or (equal? "arm32le" mach) + (and mach + (member (substring mach 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> mach) + '("le" "nt" "osx")))))) + %supported-systems)) + (home-page "https://cisco.github.io/ChezScheme/") + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upsream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source.") + (properties `((hidden? . #t))) + (license license:asl2.0))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version (package-version chez-scheme-bootstrap-bootfiles)) + (source (package-source chez-scheme-bootstrap-bootfiles)) (build-system gnu-build-system) (inputs (list @@ -242,7 +279,9 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) + (native-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,6 +302,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot"))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -345,7 +392,7 @@ (define* (stex-make #:optional (suffix "")) (not (eq? 'no-support (chez-machine->upstream-restriction mach)))))) %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") + (home-page (package-home-page chez-scheme-bootstrap-bootfiles)) (synopsis "R6RS Scheme compiler and run-time") (description "Chez Scheme is a compiler and run-time system for the language of the