From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +H02DemTEGI+hAAAgWs5BA (envelope-from ) for ; Sat, 19 Feb 2022 07:53:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YIkBBumTEGLyWQAAG6o9tA (envelope-from ) for ; Sat, 19 Feb 2022 07:53:29 +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 932BF12354 for ; Sat, 19 Feb 2022 07:53:28 +0100 (CET) Received: from localhost ([::1]:43968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLJcT-0002Ji-Eb for larch@yhetil.org; Sat, 19 Feb 2022 01:53:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLJTW-00072r-Re for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLJTT-00083I-LP for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLJTT-0004o8-Jk for guix-patches@gnu.org; Sat, 19 Feb 2022 01:44:07 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v3 11/15] gnu: Add chez-scheme-for-racket. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Feb 2022 06:44:07 +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 Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164525304418417 (code B ref 53878); Sat, 19 Feb 2022 06:44:07 +0000 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:04 +0000 Received: from localhost ([127.0.0.1]:56749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTP-0004mm-8h for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:03 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:40803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTB-0004l2-HF for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:50 -0500 Received: by mail-qv1-f49.google.com with SMTP id v10so19200904qvk.7 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:49 -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=3jczH3c6u7DJ3//fjutZXsJPez8NGkdREoswIZMxpW8=; b=gzpMLt0tNY9uAP0yGRmliZq6/o3zyZLXSdZU5v3Lm1lOye+CUvoqfZlbNNWEPlHMaf 4AcKBeHlq6AvwO99h0Oj9HUZBGTb5oLeJv7b1lfYDFJNszCvpcb77IISMqf/3mHhNDoV OGg0wwl2kKzwffQRFZKaaKL06srKUvMNAaIxa6YGaxp/zRh85n0f/l/Vc4iMOZBIhISj CZGERCJq604M9EWCR2gNlBrwoidry7Ky3Le0glB4VYnT14F/7f96KcsQsnaOL0ieBOXJ dMBMEj/SDkXnjVV0MP10yzPmNLUucEL4xZDQuZsRJpfE5YFjYNGoP63G3eq6vO2jdqtB S0zQ== 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=3jczH3c6u7DJ3//fjutZXsJPez8NGkdREoswIZMxpW8=; b=uWd5ptrKMl+ZmgDOSu5FQ7jFcZTSqh4gfaBdQCIIQIlccemQ4lOE2L/YAlPyMz0Ayt 2G1FfH5j6VjxZvf+okYRg7IG4g392e+M9ONgZiEdrfaEGlzks6ZfrqheAc6ULu1glIZy YmefVmO9hhjQxTNQc8sTrUo1KgtpbhP5kIRTuhkjAjthWiuholJs7nF3VGX6/hxRKfBJ GNLQ4LBJQ3PRLY3r4NFxacpJzvRTpsovwj5tAB6ShYq1M79rVYISnNxtmCaxyG/qa38O 2mAsYZBRhVv51s0Ykd6y7qRBYOyOPlkwgEKC9Ddea6huOlCPPFwd8Ky+l8YwGR4+GAV/ dH1Q== X-Gm-Message-State: AOAM53232O41RN6+7KLbLrvwWbLdcrePQ+YjpGAP05FIz2qp/mBekmIo 9wzGeOJGaDBM8v2xR4/3GSfO7D3ZUuDmJsiTleg= X-Google-Smtp-Source: ABdhPJwSyRyZsUvxlgdTuEKaAtwHTmXpV1s+1ulWDoHVeEm511HR5APlb+PsU/KjaXz5jcP+DZq2Hg== X-Received: by 2002:a05:6214:5a3:b0:42c:2c13:759c with SMTP id by3-20020a05621405a300b0042c2c13759cmr8578652qvb.20.1645253023937; Fri, 18 Feb 2022 22:43:43 -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 y9sm17899091qtx.85.2022.02.18.22.43.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:43 -0800 (PST) From: Philip McGrath Date: Sat, 19 Feb 2022 01:42:24 -0500 Message-Id: <20220219064228.246917-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-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=1645253608; 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=3jczH3c6u7DJ3//fjutZXsJPez8NGkdREoswIZMxpW8=; b=aWnYpP+uMo+kiMb+EKY7C0JkgRCJMb92uJLBoRC2/rrAbtFZ90OIlNU24xJ78pMRCS5hzE L+ObyCpyvn0Jsdt5/79L7RBrNJgInpJcRRwgtCFRuWpAVv6Kbg6YDtSZPzZc7l44bfxezp 25OjIC+FEkare/n9ePVYFyHFUJgMSV4Z4mRX31ThZ1aQGTeJDp+A/TO8m25XK5JHuZI2eA 8mIDbzGAIPGLBWlti0oBruJTokwaW5JY8bySeYK9HdGfgm6riquzeIGceUs233yvLx9x13 zrRgTChkdQlxtMLOrNrrSipAfXZojsEXB+saZ87OkmHBs1jVl1uZ1o53iWgdGQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645253608; a=rsa-sha256; cv=none; b=aH2IncHdTH67bHG0coBFygTMQs6MutF2Um5p8bs1D0gy+YgwR+OobJV56Irqi3dweCqrEj BlnTbVm0zCe8UCmzKeuGkghSQKYWeH29VxkBsHKTaO/ke3nPPddvEZk2hJp602O2sFN+u/ ABamaBUo8vTupODfzmFrWz3R9By0MLrM2+nYKZ8cKfPC+qIS+SXux9saEAl1skYHuWrAjY 36tOre8feBtYrKEMep1eupkLs0FFtF9gghXACJ6aobVUEkOrfp8ckuagTxCD3zdJ4ubG8C yq4ilhcSPjJIIc6MNJqY05au2uBwiRAySC/UWPhc9sYDUOqOyeL/QCV6CipLtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=gzpMLt0t; 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.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=gzpMLt0t; 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: 932BF12354 X-Spam-Score: -0.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: /jk2t2whsRIR 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 ca76e78b1e..6eddc46e66 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -319,11 +319,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) @@ -551,17 +568,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") @@ -691,6 +699,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