From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sCBiE+DaEWKTJwEAgWs5BA (envelope-from ) for ; Sun, 20 Feb 2022 07:08:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qPTAEODaEWJTfgEA9RJhRA (envelope-from ) for ; Sun, 20 Feb 2022 07:08:32 +0100 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 0014D1C536 for ; Sun, 20 Feb 2022 07:08:31 +0100 (CET) Received: from localhost ([::1]:59788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLfOY-0006Uw-Uu for larch@yhetil.org; Sun, 20 Feb 2022 01:08:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLfOA-000639-Fu for guix-patches@gnu.org; Sun, 20 Feb 2022 01:08:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLfO7-00048w-FM for guix-patches@gnu.org; Sun, 20 Feb 2022 01:08:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLfO7-0005XL-Bk; Sun, 20 Feb 2022 01:08:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v4 11/15] gnu: Add chez-scheme-for-racket. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sun, 20 Feb 2022 06:08:03 +0000 Resent-Message-ID: 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, Liliana Marie Prikler , Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun , Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164533723721071 (code B ref 53878); Sun, 20 Feb 2022 06:08:03 +0000 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:17 +0000 Received: from localhost ([127.0.0.1]:59203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNM-0005Tg-BQ for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:16 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:42734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNB-0005Ma-1s for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:05 -0500 Received: by mail-qv1-f47.google.com with SMTP id e22so23827639qvf.9 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:05 -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=5PMC+szkO1rOVGCQARJBH0mRv7wpQ+x6PhOjZiSrMvI=; b=iBlM+i0f26pH/sin6RwAmsz56Ojx28Ui/Woue157VrdLa3Ui6f1Gzk52rd0voy4zCb 3Q9x1r+7DKeUgaovet/ktpAuJnaDfFwPnuFdc9Wseut8sf/9jFgRCE+1ifqoOjqScX1R YU5BM28fZ/pbGD5XDz1w6MA//HLqZ1JacJI/tcK/M1oiCJoQTGlFyJdkXBmRPfVQ9DL0 gGzULsHYZqSPSU98oBxOqJt3R/6+phto4s9NXBW7mlsuqmdIYzZLO509bxUMOtgyE9Gf mlVUzdELBClMQbDkNbxSnN7IwMaTIzZlWUp0nZqcoLdTYePIgovdJijPY5IlSxOknqh1 7EOg== 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=5PMC+szkO1rOVGCQARJBH0mRv7wpQ+x6PhOjZiSrMvI=; b=MsmoTmXEpIQRLsWgKdPUxfNU4O/EUMl9fJ5sVXKRQjNJvj0SXHaFvZNxF5bKF4pP0R 4lTyAPT3i1Gm4DkSmhpQJYcppBFOfnWFnbkDILwlP8OSTGgDdVTqvlSz4x5BAQeaIRWz 4SS6j66V2zh2QvwUqwwLmfo5rmbMTigemmcGVFiIhihDTg8mcNs8TizxoeHhkO/Y0Aw5 /dsOzIFnisMeGeGOW1F6AmzVQ+rq7lOpAiO/35U2ZZPola3QbYUbwmQztlY3Mcw5Xn/8 gbT8vBIJ7YbLDDEfcyGInhkIjmqRdJqC6TghwvvZGWbbUO58ZHSULcTSnH1P4LVDPp7d IZug== X-Gm-Message-State: AOAM5320bB4n3cvLTwtowHFzLklztl4V/QaseOtT8R8oDBZrQK5fmjJH 4eI/hatK4fUomHLh4uDWKSmEHpxN5sL7jgTY+FU= X-Google-Smtp-Source: ABdhPJxwzyncrofZqnFX33PR9pvKvqJf8lD8/YD2QPxlgYEX8gbV/loSqqxGa4ssPLCwM+YtruE1tw== X-Received: by 2002:ac8:5850:0:b0:2dd:9260:c4f9 with SMTP id h16-20020ac85850000000b002dd9260c4f9mr10657527qth.446.1645337219613; Sat, 19 Feb 2022 22:06:59 -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 c7sm9000089qtp.61.2022.02.19.22.06.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:59 -0800 (PST) From: Philip McGrath Date: Sun, 20 Feb 2022 01:06:06 -0500 Message-Id: <20220220060610.178131-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-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: 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645337312; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=5PMC+szkO1rOVGCQARJBH0mRv7wpQ+x6PhOjZiSrMvI=; b=Ipbpj6UIgsmxRPLt9O+SUxhBIC2FpM2TRoeAln3mVQQ56IlMckSNyhAhzPwycoLpvITuiz ZZR9tl87SwS4i8s2R7/WlYLptJDtwIIMVxHfaW5gW/u5l4rbpDnNcp3fr+k0WrJ/ag0TRW ojdGwp1Y7Hed1jywOMl9KvKIc6IcG9Aw5uazQ0h2xirqpAjUV/QQ/lAK83JtJQ2UWlXVVh +H5ARwkK6C76SwfwGPUwgDaUFBDEV3JwdZZxezkUl5FJpwXIfhJ3pOaLlxQL4CBuddWukj 1BD+n41RrtJ320oOGSzeI71Hn3aEnuT3HGofslXAn5t3YR1rCqMEWhhs+8/F5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645337312; a=rsa-sha256; cv=none; b=ecDug5hintlTLph3O6cdMNcUzdbvOAC0nOGjW5qnmFhkbkAZt+/am6/g6yQY4dAdsIawcV QPAFa3C+PHdirb9VmOy30/a3yGc12LngsrqReBEVlBPF8ctOrczmxaCMkVf3t+nor99RdE cH0gnLTS7/oEK2n9gkFpOC9hyxrKXArdnyKTZhNCAPE7iHl6B/nnpUrFdkucYYCIwG2hzV TZGHOOpdeA1I2u4/fB7SYQbEdw0O8qhVuynSbrPbxT/qIXrcoC0kpZcliy43JZlJVELoi3 7dgNPFZjT7JmBh9ZZFbbbC7IgpoF42Vm7+qyOKjU1xQWbxx/yjNUD+I9tuYCKw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=iBlM+i0f; dmarc=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: 0.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=iBlM+i0f; dmarc=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: 0014D1C536 X-Spam-Score: 0.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: m2hWOdfAZyzp The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. * gnu/packages/chez-and-racket-bootstrap.scm (unpack-nanopass+stex): (chez-scheme-for-racket): (chez-scheme-for-racket-bootstrap-bootfiles): New variables. (chez-scheme)[arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 132 +++++++++++++++++++-- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 2f649fe67f..25f1ff52f8 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -317,11 +317,28 @@ (define unbundle-chez-submodules "lz4" "zlib")))) +(define unpack-nanopass+stex + #~(begin + (copy-recursively + (dirname (search-input-file %build-inputs + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) + (mkdir-p "stex") + (with-output-to-file "stex/Mf-stex" + (lambda () + ;; otherwise, it will try to download submodules + (display "# to placate ../configure"))))) + ;; ;; Racket VM: ;; (define %racket-version "8.4") +(define %chez-scheme-for-racket-version "9.5.7.3") +;; The version should match `(scheme-fork-version-number)`. +;; See racket/src/ChezScheme/s/cmacros.ss c. line 360. +;; It will always be different than the upstream version! (define %racket-origin (origin (method git-fetch) @@ -549,17 +566,8 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (copy-recursively - (dirname (search-input-file (or native-inputs inputs) - "lib/chez-scheme/nanopass.ss")) - "nanopass" - #:keep-mtime? #t) - (mkdir-p "stex") - (with-output-to-file "stex/Mf-stex" - (lambda () - ;; otherwise, it will try to download submodules - (display "# to placate ../configure"))))) + (lambda args + #$unpack-nanopass+stex)) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (when (directory-exists? "boot") @@ -689,6 +697,108 @@ (define-public chez-scheme-bootstrap-bootfiles work with upstream Chez Scheme so that we can bootstrap these files from source."))) +(define-public chez-scheme-for-racket + (package + (inherit chez-scheme) + (name "chez-scheme-for-racket") + (version %chez-scheme-for-racket-version) + (source %racket-origin) + (inputs + (modify-inputs (package-inputs chez-scheme) + (delete "libx11" "util-linux:lib"))) + (native-inputs + (modify-inputs (package-native-inputs chez-scheme) + (replace "chez-scheme-bootstrap-bootfiles" + chez-scheme-for-racket-bootstrap-bootfiles))) + (arguments + (substitute-keyword-arguments (package-arguments chez-scheme) + ((#:configure-flags cfg-flags #~'()) + #~(cons "--disable-x11" #$cfg-flags)) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))))))) + (supported-systems (filter nix-system->chez-machine + %supported-systems)) + (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 "Variant of Chez Scheme extended for Racket") + (description "This variant of Chez Scheme is extended to support the +implementation of Racket. It may be useful on platforms that are not yet +supported by upstream Chez Scheme. + +Main additions to Chez Scheme in the Racket variant: +@itemize @bullet +@item +AArch64 support +@item +Portable bytes (@code{pb}) support, which is mainly useful for bootstrapping +a build on any supported platform +@item +Unboxed floating-point arithmetic and flvectors +@item +Type reconstruction during optimization (especially for safe code) +@item +Continuation attachments +@item +Parallel garbage collection, in-place garbage collection for old-generation +objects (instead of always copying), and reachability-based memory +accounting +@item +Ordered finalization, immobile (but collectable) objects, weak/ephemeron +generic hash tables, and reference bytevectors +@item +Faster multiplication and division for large exact numbers +@end itemize") + (license license:asl2.0))) + +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (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.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +Scheme compiler purely from source into Racket and apply the compiler to +itself, thus bootstrapping Chez Scheme. Bootstrapping takes about 10 times as +long as using an existing Chez Scheme, but @code{cs-bootstrap} supports Racket +7.1 and later, including the Racket BC variant. + +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's bootstrap dependencies: ;; -- 2.32.0