[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
22/25: gnu: Add chez-scheme-for-racket.
From: |
guix-commits |
Subject: |
22/25: gnu: Add chez-scheme-for-racket. |
Date: |
Fri, 4 Mar 2022 17:54:16 -0500 (EST) |
lilyp pushed a commit to branch master
in repository guix.
commit 61ca3d9a8483d91dd3a20d36d9e0c8081bd2fd2c
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Sun Feb 27 16:29:18 2022 -0500
gnu: Add chez-scheme-for-racket.
The Racket variant of Chez Scheme can be used to support platforms that
are not yet supported by upstream Chez Scheme.
* gnu/packages/chez.scm (chez-scheme-for-racket): New variable.
(chez-scheme-for-racket-bootstrap-bootfiles)[version]
[supported-systems]: Derive from 'chez-scheme-for-racket'.
* gnu/packages/racket.scm (%racket-version): Update comment.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
---
gnu/packages/chez.scm | 97 +++++++++++++++++++++++++++++++++++++++++++++----
gnu/packages/racket.scm | 3 +-
2 files changed, 91 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 5d5108a2b1..e7ddab0d1f 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -52,6 +52,21 @@
chez-machine->threaded
unpack-nanopass+stex))
+;; Commentary:
+;;
+;; The bootstrapping paths for Chez Scheme and Racket are closely
+;; entwined. Racket CS (the default Racket implementation) is based on (a fork
+;; of) Chez Scheme. Racket's variant of Chez Scheme shares sources for
+;; nanopass and stex with upstream Chez Scheme.
+;;
+;; Racket's variant of Chez Scheme can be bootstrapped by an older Racket
+;; implementation, Racket BC, which can be bootstrapped from C. Porting that
+;; code to work with upstream Chez Scheme (or finding an old version that
+;; does) is our best hope for some day bootstrapping upstream Chez Scheme from
+;; source.
+;;
+;; Code:
+
(define (chez-machine->nonthreaded machine)
"Given a string MACHINE naming a Chez Scheme machine type, returns a string
naming the nonthreaded machine type for the same architecture and OS as
@@ -327,6 +342,78 @@ generates native code for each target processor, with
support for x86, x86_64,
and 32-bit PowerPC architectures.")
(license asl2.0)))
+(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!
+ ;; When updating, remember to also update %racket-version in racket.scm.
+ (source #f) ; avoid problematic cycle with racket.scm
+ (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)
+ #~(let* ((those-phases #$those-phases)
+ (unpack (assoc-ref those-phases 'unpack)))
+ (modify-phases those-phases
+ (replace 'unpack
+ (lambda args
+ (unpack #:source #$(or (package-source this-package)
+ (package-source racket-vm-bc)))))
+ (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 asl2.0)))
+
+;;
+;; Bootfiles:
+;;
+
(define-public chez-scheme-bootstrap-bootfiles
(package
(inherit chez-scheme)
@@ -368,11 +455,7 @@ source.")))
(package
(inherit chez-scheme-bootstrap-bootfiles)
(name "chez-scheme-for-racket-bootstrap-bootfiles")
- (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!
- ;; When updating, remember to also update %racket-version in racket.scm.
+ (version (package-version chez-scheme-for-racket))
(source #f) ; avoid problematic cycle with racket.scm
(native-inputs (list chez-nanopass-bootstrap racket-vm-bc))
;; TODO: cross compilation
@@ -398,8 +481,8 @@ source.")))
(invoke (search-input-file (or native-inputs inputs)
"/opt/racket-vm/bin/racket")
"rktboot/main.rkt"))))))))
- (supported-systems (filter nix-system->chez-machine
- %supported-systems))
+ (supported-systems
+ (package-supported-systems chez-scheme-for-racket))
(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
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 716f3f72a1..d754e853a9 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -195,8 +195,7 @@
racket-vm-cs
racket-vm-bc))
-(define %racket-version "8.4")
-;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles!
+(define %racket-version "8.4") ; Remember to update chez-scheme-for-racket!
(define %racket-commit
(string-append "v" %racket-version))
(define %racket-origin
- 13/25: gnu: racket: Add 'racket-vm-for-system'., (continued)
- 13/25: gnu: racket: Add 'racket-vm-for-system'., guix-commits, 2022/03/04
- 12/25: gnu: chez: Add utilities for Chez machine types., guix-commits, 2022/03/04
- 15/25: gnu: chez-scheme: Use "lib/chez-scheme" for search path., guix-commits, 2022/03/04
- 09/25: gnu: configure-layer.rkt: Adjust indentation., guix-commits, 2022/03/04
- 16/25: gnu: chez-scheme: Use shared zlib and lz4., guix-commits, 2022/03/04
- 23/25: gnu: chez: Add 'chez-scheme-for-system'., guix-commits, 2022/03/04
- 19/25: gnu: Add chez-nanopass., guix-commits, 2022/03/04
- 04/25: gnu: racket-minimal: Use new package style., guix-commits, 2022/03/04
- 06/25: gnu: racket-minimal: Change inheritance to follow bootstrapping., guix-commits, 2022/03/04
- 10/25: gnu: racket-minimal: Separate from the Racket VM., guix-commits, 2022/03/04
- 22/25: gnu: Add chez-scheme-for-racket.,
guix-commits <=
- 01/25: gnu: Use license prefix in (gnu packages racket)., guix-commits, 2022/03/04
- 02/25: gnu: racket: Update to 8.4., guix-commits, 2022/03/04
- 21/25: gnu: chez-mit: Support chez-scheme-for-racket., guix-commits, 2022/03/04
- 24/25: gnu: racket-vm-cs: Build with "--enable-scheme"., guix-commits, 2022/03/04
- 20/25: gnu: chez-scheme: Explicitly package bootstrap bootfiles., guix-commits, 2022/03/04
- 17/25: gnu: chez-scheme: Use new package style., guix-commits, 2022/03/04
- 18/25: gnu: Add stex., guix-commits, 2022/03/04