[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#53878] [PATCH v6 22/24] gnu: Add chez-scheme-for-racket.
From: |
Philip McGrath |
Subject: |
[bug#53878] [PATCH v6 22/24] gnu: Add chez-scheme-for-racket. |
Date: |
Sat, 26 Feb 2022 21:34:48 -0500 |
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.
---
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 @@ (define-module (gnu packages chez)
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 @@ (define* (stex-make #:optional (suffix ""))
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 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles
(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 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles
(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 c96bebe325..98dab6f743 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -195,8 +195,7 @@ (define* (racket-vm-for-system #:optional
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
--
2.32.0
- [bug#53878] [PATCH v6 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path., (continued)
- [bug#53878] [PATCH v6 14/24] gnu: chez-scheme: Use new style for Chez packages., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 16/24] gnu: chez-scheme: Use shared zlib and lz4., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 17/24] gnu: chez-scheme: Use new package style., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 20/24] gnu: chez-scheme: Explicitly package bootstrap bootfiles., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 21/24] gnu: chez-mit: Support chez-scheme-for-racket., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 18/24] gnu: Add stex., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 19/24] gnu: Add chez-nanopass., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 24/24] gnu: racket-vm-cs: Build with "--enable-scheme"., Philip McGrath, 2022/02/26
- [bug#53878] [PATCH v6 22/24] gnu: Add chez-scheme-for-racket.,
Philip McGrath <=
- [bug#53878] [PATCH v6 23/24] gnu: chez: Add 'chez-scheme-for-system'., Philip McGrath, 2022/02/26
[bug#53878] [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 01/24] gnu: Use license prefix in (gnu packages racket)., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 03/24] gnu: racket: Use Git origins for Racket packages., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 05/24] gnu: racket-minimal: Don't configure non-existant catalogs., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 02/24] gnu: racket: Update to 8.4., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 06/24] gnu: racket-minimal: Change inheritance to follow bootstrapping., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 04/24] gnu: racket-minimal: Use new package style., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 07/24] gnu: racket-minimal: Adjust indentation., Philip McGrath, 2022/02/27
- [bug#53878] [PATCH v7 09/24] gnu: configure-layer.rkt: Adjust indentation., Philip McGrath, 2022/02/27