summaryrefslogtreecommitdiff
path: root/gnu/packages/racket.scm
diff options
context:
space:
mode:
authorPhilip McGrath <philip@philipmcgrath.com>2022-08-27 14:55:52 -0400
committerLudovic Courtès <ludo@gnu.org>2022-09-04 23:10:12 +0200
commita15d72f8e1f301a1f63c363de0aab9eaa43c1664 (patch)
tree6f16b9b22e37261ae998d2ed9dc02d85a3a43e4d /gnu/packages/racket.scm
parentcb0d106590400eefb74c1d747805b3014fe645d0 (diff)
gnu: chez-scheme-for-racket: Support all systems.
On systems for which Racket's variant of Chez Scheme cannot generate native code, it can use a 'pbarch' machine type: a variant of the ``portable bytecode'' backend specialized to word size and endianness. This allows Racket CS to replace Racket BC on those systems while maintaining comparable performance. (Racket BC lacks JIT support for those systems anyway.) It also lets us provide a Chez Scheme package on all systems Guix supports. This patch adds 'pbarch' support to both 'chez-scheme-for-racket' and 'racket-vm-cs', but it does not change the Racket VM implementation used for the 'racket' and 'racket-minimal' packages. * gnu/packages/chez.scm (nix-system->pbarch-machine-type): New variable. (chez-scheme-for-racket)[inputs]: Use 'libffi' for non-native systems. [arguments]<#:configure-flags>: Always supply '-m='. Add applicable flags for non-native systems. [supported-systems]: Use '%supported-systems'. [description]: Update. (chez-scheme-for-racket-bootstrap-bootfiles)[arguments]<#:phases>: Adapt 'build' phase for non-native systems. * gnu/packages/racket.scm (racket-vm-bc)[description]: Update. (racket-vm-cs)[description]: Likewise. [inputs]: Use 'libffi' for non-native systems. [arguments]<#:configure-flags>: Add applicable flags for non-native systems. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/racket.scm')
-rw-r--r--gnu/packages/racket.scm26
1 files changed, 17 insertions, 9 deletions
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 4fcdd2f721..264b44b7fd 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -311,7 +311,7 @@ One of the early layers implements macros.")
(version %racket-version)
(source %racket-origin)
(inputs (list ncurses ;; <- common to all variants (for #%terminal)
- libffi)) ;; <- only for BC variants
+ libffi)) ;; <- for BC and non-native CS variants
(native-inputs (cons* zuo ;; <- for all variants
libtool ;; <- only for BC variants
(if (%current-target-system)
@@ -417,10 +417,8 @@ code to use the 3M garbage collector.")
(description "The Racket BC (``before Chez'' or ``bytecode'')
implementation was the default before Racket 8.0. It uses a compiler written
in C targeting architecture-independent bytecode, plus a JIT compiler on most
-platforms. Racket BC has a different C API and supports a slightly different
-set of architectures than the current default runtime system, Racket CS (based
-on ``Chez Scheme''). It is the recommended implementation for architectures
-that Racket CS doesn't support.
+platforms. Racket BC has a different C API than the current default runtime
+system, Racket CS (based on ``Chez Scheme'').
This package is the normal implementation of Racket BC with a precise garbage
collector, 3M (``Moving Memory Manager'').")
@@ -433,9 +431,12 @@ collector, 3M (``Moving Memory Manager'').")
(inherit racket-vm-bc)
(name "racket-vm-cs")
(inputs
- (modify-inputs (package-inputs racket-vm-cgc)
- (prepend zlib lz4)
- (delete "libffi")))
+ (let ((inputs (modify-inputs (package-inputs racket-vm-cgc)
+ (prepend zlib lz4))))
+ (if (racket-cs-native-supported-system?)
+ (modify-inputs inputs
+ (delete "libffi"))
+ inputs)))
(native-inputs
(let ((native-inputs (package-native-inputs racket-vm-cgc)))
(modify-inputs (if (%current-target-system)
@@ -464,12 +465,19 @@ collector, 3M (``Moving Memory Manager'').")
#+(this-package-native-input
"chez-scheme-for-racket")
"/bin/scheme")
+ #$@(if (racket-cs-native-supported-system?)
+ #~()
+ #~(#$(string-append "--enable-mach="
+ (nix-system->pbarch-machine-type))
+ "--enable-pb"))
#$racket-vm-common-configure-flags))))
(synopsis "Racket CS implementation")
(description "The Racket CS implementation, which uses ``Chez Scheme'' as
its core compiler and runtime system, has been the default Racket VM
implementation since Racket 8.0. It performs better than the Racket BC
-implementation for most programs.
+implementation for most programs. On systems for which Racket CS cannot
+generate machine code, this package uses a variant of its ``portable
+bytecode'' backend specialized for word size and endianness.
Using the Racket VM packages directly is not recommended: instead, install the
@code{racket-minimal} or @code{racket} packages.")