From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qJTmNti1DmLhvQAAgWs5BA (envelope-from ) for ; Thu, 17 Feb 2022 21:53:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id APywL9i1DmKaswAAG6o9tA (envelope-from ) for ; Thu, 17 Feb 2022 21:53:44 +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 567A237ACE for ; Thu, 17 Feb 2022 21:53:44 +0100 (CET) Received: from localhost ([::1]:36630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKnmZ-0007KZ-Hb for larch@yhetil.org; Thu, 17 Feb 2022 15:53:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKnlw-0006ma-6o for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKnlv-0001dH-Sr for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKnlv-0003aD-SW for guix-patches@gnu.org; Thu, 17 Feb 2022 15:53:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v2 11/15] gnu: Add chez-scheme-for-racket. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Feb 2022 20:53: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 Cc: Philip McGrath , zimoun , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164513114413641 (code B ref 53878); Thu, 17 Feb 2022 20:53:03 +0000 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:24 +0000 Received: from localhost ([127.0.0.1]:52791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlI-0003Xr-5E for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:24 -0500 Received: from mail-vs1-f49.google.com ([209.85.217.49]:41801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlB-0003Wx-RJ for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:18 -0500 Received: by mail-vs1-f49.google.com with SMTP id y26so3786858vsq.8 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:17 -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=VOaybbGLJVdU27W9iEo9ekB9ot/Re1EERY/mio0sog4=; b=RAUfJHek+yBbvKmQSVy9hKVqlslRsQlNNiFZLfpwRWkHNvJkZ42DNkir7kYtwERGCH wBnMTvnxIrceAMhjDAXQSwkSXX5zDmzit2I5HiL5aS7mw6+8nwm7mEUAaeY5YiDrYty0 ASCSlImOaxhSZUC+oliLZ7F6+niMWj5IeghAVlsPwNAZ8O4X4U+ZsLhjwYlmiZB/J9Zp qCEQTdAMsIah5TyQCFFiqkdWgPXZgMDcchhZgVGpBzGq2a/BRTV6AA2pdHKBKAKObiJQ oxhWva1XAnbGd4/fY/4g+p2InYk86LCk86kUi4smrePyAmvHngNsmExhBwZfAm07mQ4+ GvAw== 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=VOaybbGLJVdU27W9iEo9ekB9ot/Re1EERY/mio0sog4=; b=yIHOByNvhsZX7XNAt7nWDZ6MiN0r4goG8I1+IfOIRIR4zGNE+sxOq1NSpQE6BjtYnh jfO22i8vYwy2z1rWSyHP6+H0gRW0W06JZpHJi4ucXVgqs0bjtdAQK7DK1TAdfVDhfbZo l/dWlJtwFhNGJWvmlo/6acx+cU+Y/qUMyc8Tf2rZyprP+CtQbLZ+cqwORF7rs1eRce8D CI6s2V3E2F4cJ/eJr7c+Olmn2Y0xQnnDop9v87umM8cDx7qXsvxL/CZ7WXQJ4UR6xE0M icoJdnteYHGlBEdFnfBEiI75fTLnEMQrpK7/ECM4vhThqCAcQjtkXwcIHSpbxr64lynu G1Qw== X-Gm-Message-State: AOAM531wysXCbBPTEfenPvNvQTc3c/oPdzZ3+G9GGmS69423c4WQbYR/ 1R7AiJAlODKGFRf+2IGArNvUvuP2iMuPO9Yf+uc= X-Google-Smtp-Source: ABdhPJzqoTJeNZG1rnErRPJH5G5y9DFgiwWaZTMAYdtsQCnqBevORQITfTSojqmpjf5JoJhpsK95GA== X-Received: by 2002:a05:6102:5494:b0:31b:7af4:1d5a with SMTP id bk20-20020a056102549400b0031b7af41d5amr2283868vsb.40.1645131132300; Thu, 17 Feb 2022 12:52:12 -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 y187sm1135721vkf.13.2022.02.17.12.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:12 -0800 (PST) From: Philip McGrath Date: Thu, 17 Feb 2022 15:50:44 -0500 Message-Id: <20220217205048.967383-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-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=1645131224; 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=VOaybbGLJVdU27W9iEo9ekB9ot/Re1EERY/mio0sog4=; b=lsc5MkDMHqVn4UVSCZmRHKtpqwJzvNioTSVG7aTaC3wGKNIergKCuchOno9GVcxWgLGxE8 qv2fGnYM0n8bXpR75CyPPDISOz3DgVr0nKi1OIgAbp9BcClNpY7atsy3YSXFD6Je8jl5Fu qOOheo7+0E8VJB9K1HzlG6Ph9zVXIwiN73B6tKVZmh0hv8Rcu2AKNBQp4fYeQz+YjBf7qV +j2CC2Zq5utTOuk/dVHlOLKeP+jYimidic4Xh+KgWYcPPjqpWhIp6RhOjliX71aBrX7mh8 H8sbgsJweLKbnDWsU8HD15eEa88b2iuq66MMNfsBPjj6BVnV7XOhCYAROgoDQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645131224; a=rsa-sha256; cv=none; b=NPL4H8IKa6rAAdB7oFt+ljHdvIzsQfo4R4ib4ku1CbhGn1f7OUAC4HMeyEmO4QuQIMNyi4 80sBPUwDKtWecotEF3lUCPwZzXfqxzG1xAuoKPsIFZdOAoc5jN5TraM2z45AbCv/8DCS4y hnBuCyrUiLJ0dCBbMWjjgyJxAXAupyRIy+lvrIGwLFhThvuqjhKH7Ol9AvLbEX1CpjNTgt ZFkhjyKW2iURDgYMYgHcFPN9HUzfp7r8CsvIOPDX1FrmluYpsg2x+G/AIuZuIbB1cxrJHf GBagutfovYbuWdQ3SyctcT4CkqMHj8oyhpm9e9xr5vJS00mKeLzNRuT+7I1fvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=RAUfJHek; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=RAUfJHek; 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: 567A237ACE X-Spam-Score: -0.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: rGCgG8IZeEj4 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 | 131 +++++++++++++++++++-- 1 file changed, 120 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index dc87e090cb..dea49b7e89 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -317,6 +317,19 @@ (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: ;; @@ -548,17 +561,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") @@ -688,6 +692,111 @@ (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 "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! + (source (package-source racket-vm-cgc)) + (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