Toggle diff (473 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 4fcaa6801a..8441fc6ad5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1796,7 +1796,7 @@ dist_patch_DATA = \
%D%/packages/patches/ripperx-missing-file.patch \
%D%/packages/patches/rpcbind-CVE-2017-8779.patch \
%D%/packages/patches/rtags-separate-rct.patch \
- %D%/packages/patches/racket-backport-8.6-zuo.patch \
+ %D%/packages/patches/racket-backport-8.7-pkg-strip.patch \
%D%/packages/patches/racket-chez-scheme-bin-sh.patch \
%D%/packages/patches/racket-rktio-bin-sh.patch \
%D%/packages/patches/racket-zuo-bin-sh.patch \
diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 5d152b3db5..0d22e2e20f 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -104,7 +104,7 @@ (define* (target-chez-arch #:optional (system
((target-ppc32? system)
"ppc32")
((target-riscv64? system)
- #f)
+ "rv64")
(else
#f)))
@@ -170,6 +170,7 @@ (define %chez-features-table
("a6" threads bootstrap-bootfiles)
("arm32" bootstrap-bootfiles)
("arm64" . #f)
+ ("rv64" . #f)
("ppc32" threads))
;; Hurd
("gnu"
@@ -466,8 +467,8 @@ (define-public chez-scheme-for-racket
(package
(inherit chez-scheme)
(name "chez-scheme-for-racket")
- (version "9.5.9.2")
- ;; The version should match `(scheme-fork-version-number)`.
+ (version "9.5.9.8")
+ ;; The version should match `scheme-version`.
;; 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.
@@ -492,12 +493,6 @@ (define-public chez-scheme-for-racket
(substitute-keyword-arguments (package-arguments chez-scheme)
((#:out-of-source? _ #f)
#t)
- ((#:tests? _ #t)
- ;; FIXME: There have been some flaky test failures. Some have been
- ;; fixed upstream post-release but have proven non-trivial to
- ;; backport; at least one issue remains. Re-enable tests once
- ;; https://github.com/racket/racket/issues/4359 is fixed.
- #f)
((#:configure-flags cfg-flags #~'())
#~`("--disable-x11"
"--threads" ;; ok to potentially duplicate
@@ -590,7 +585,7 @@ (define-public chez-scheme-for-racket
Main additions to Chez Scheme in the Racket variant:
@itemize @bullet
@item
-AArch64 code generation
+AArch64 and RV64G (RISC-V) code generation
@item
Portable bytecode (@code{pb}) mode, which is mainly useful for bootstrapping a
build on any platform, but can also be used on platforms without native-code
@@ -603,7 +598,7 @@ (define-public chez-scheme-for-racket
@item
Type reconstruction during optimization (especially for safe code)
@item
-Continuation attachments
+Continuation marks
@item
Parallel garbage collection, in-place garbage collection for old-generation
objects (instead of always copying), and reachability-based memory
@@ -611,6 +606,8 @@ (define-public chez-scheme-for-racket
@item
Ordered finalization, immobile (but collectable) objects, weak/ephemeron
generic hash tables, and reference bytevectors
+@item
+Easier bootstrapping via old versions of Chez Scheme
@end itemize")
(license asl2.0)))
@@ -695,7 +692,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles
#~(invoke
(search-input-file (or native-inputs inputs)
"/opt/racket-vm/bin/racket")
- "rktboot/main.rkt"
+ "../rktboot/main.rkt"
#$@(if (racket-cs-native-supported-system?)
#~()
(let ((m (nix-system->pbarch-machine-type)))
diff --git a/gnu/packages/patches/racket-backport-8.6-cross-install.patch b/gnu/packages/patches/racket-backport-8.6-cross-install.patch
deleted file mode 100644
index 2c4d8924ed..0000000000
--- a/gnu/packages/patches/racket-backport-8.6-cross-install.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From fbe2094f56fb81c888076c781e90fb0abbc0cc07 Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Sat, 30 Jul 2022 07:06:55 -0600
-Subject: [PATCH 1/2] CS makefiles: fix Unix-style install for cross
- compilation
-
-Closes #4377
-
-(cherry picked from commit 053be470e7c5454cdf48e934f3254d2d916bbbc5)
----
- racket/src/cs/c/build.zuo | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/racket/src/cs/c/build.zuo b/racket/src/cs/c/build.zuo
-index 8d3950bb27..d8b74c509d 100644
---- a/racket/src/cs/c/build.zuo
-+++ b/racket/src/cs/c/build.zuo
-@@ -1016,10 +1016,9 @@
- (define (setup)
- (call-with-dest-racket
- (lambda (bindir dest-racket)
-- (define copytree-racket (and cross? (config-bootstrap-racket)))
-+ (define copytree-racket (and cross? (hash-ref (config-bootstrap-racket) 'racket)))
- (maybe-copytree config dest-racket copytree-racket at-dir)
-- (run-raco-setup config dest-racket
-- (and cross? (hash-ref (config-bootstrap-racket) 'racket))
-+ (run-raco-setup config dest-racket copytree-racket
- ;; this can be redundant if it's also supplied via `SETUP_MACHINE_FLAGS`,
- ;; but redundant should be ok:
- (list "-MCR" (~a (at-dir "compiled") ":")
---
-2.32.0
-
-
-From 85802f4d515e310e657928707800ad709a676e2a Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Mon, 15 Aug 2022 10:37:01 +0800
-Subject: [PATCH 2/2] configure: adjust cross-build assumption for a pb build
-
-Don't assume a cross build for a pb target on a platform that's only
-supported via pb.
-
-(cherry picked from commit 70e484e885637c495be5481983dae2207fdd67bb)
-
-(Edited to remove unrelated tweak to comments in
-"racket/src/expander/expand/require+provide.rkt".)
----
- racket/src/cs/c/configure | 15 +++++++++++----
- racket/src/cs/c/configure.ac | 15 +++++++++++----
- 2 files changed, 22 insertions(+), 8 deletions(-)
-
-diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure
-index 454d79e11a..7e0fa5600d 100755
---- a/racket/src/cs/c/configure
-+++ b/racket/src/cs/c/configure
-@@ -4679,6 +4679,11 @@ case "$MACH_HOST_CPU" in
- ;;
- esac
-
-+if test "${MACH}" = "" ; then
-+ default_mach_was_empty=yes
-+else
-+ default_mach_was_empty=no
-+fi
-
- if test "${enable_mach}" != "" ; then
- MACH="${enable_mach}"
-@@ -4701,13 +4706,15 @@ elif test "$MACH" = "" -o "$MACH_OS" = "" ; then
- exit 1
- fi
-
--# For a pb build where Racket is supplied, force cross-build
--# mode on the assumption that the host is not a pb build
--# (because it should be created with default configure options)
-+# For a pb build where Racket is supplied and MACH was not originally
-+# empty, force cross-build mode on the assumption that the host is not
-+# a pb build (because it should be created with default configure options)
- if test "${enable_pb}" = "yes" ; then
- if test "${enable_racket}" != "" ; then
- if test "${enable_target}" = "" ; then
-- enable_target="${MACH}"
-+ if test "${default_mach_was_empty}" = "no" ; then
-+ enable_target="${MACH}"
-+ fi
- fi
- fi
- fi
-diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac
-index 5bce979c92..734c1e8feb 100644
---- a/racket/src/cs/c/configure.ac
-+++ b/racket/src/cs/c/configure.ac
-@@ -415,6 +415,11 @@ case "$MACH_HOST_CPU" in
- ;;
- esac
-
-+if test "${MACH}" = "" ; then
-+ default_mach_was_empty=yes
-+else
-+ default_mach_was_empty=no
-+fi
-
- if test "${enable_mach}" != "" ; then
- MACH="${enable_mach}"
-@@ -437,13 +442,15 @@ elif test "$MACH" = "" -o "$MACH_OS" = "" ; then
- exit 1
- fi
-
--# For a pb build where Racket is supplied, force cross-build
--# mode on the assumption that the host is not a pb build
--# (because it should be created with default configure options)
-+# For a pb build where Racket is supplied and MACH was not originally
-+# empty, force cross-build mode on the assumption that the host is not
-+# a pb build (because it should be created with default configure options)
- if test "${enable_pb}" = "yes" ; then
- if test "${enable_racket}" != "" ; then
- if test "${enable_target}" = "" ; then
-- enable_target="${MACH}"
-+ if test "${default_mach_was_empty}" = "no" ; then
-+ enable_target="${MACH}"
-+ fi
- fi
- fi
- fi
---
-2.32.0
-
diff --git a/gnu/packages/patches/racket-backport-8.6-docindex-write.patch b/gnu/packages/patches/racket-backport-8.6-docindex-write.patch
deleted file mode 100644
index abe1984507..0000000000
--- a/gnu/packages/patches/racket-backport-8.6-docindex-write.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 8b4d686a62fd66dedfc40ecdcf3698316993d614 Mon Sep 17 00:00:00 2001
-From: Philip McGrath <philip@philipmcgrath.com>
-Date: Sun, 17 Jul 2022 22:51:44 -0400
-Subject: [PATCH] racket-index: set write permission when copying
- `docindex.sqlite`
-
-Fixes https://github.com/racket/racket/issues/4357
-
-(cherry picked from commit 55b6cbdca1f36a4f37bab1519c1b658717d3cad2)
----
- pkgs/racket-index/setup/scribble.rkt | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/pkgs/racket-index/setup/scribble.rkt b/pkgs/racket-index/setup/scribble.rkt
-index 6694f0b793..e27a8fa348 100644
---- a/pkgs/racket-index/setup/scribble.rkt
-+++ b/pkgs/racket-index/setup/scribble.rkt
-@@ -252,7 +252,14 @@
- (unless (file-exists? db-file)
- (define-values (base name dir?) (split-path db-file))
- (make-directory* base)
-- (when copy-from (copy-file copy-from db-file))
-+ (when copy-from
-+ (copy-file copy-from db-file)
-+ ;; we might not have write permissions for the previous layer:
-+ ;; ensure that we do for the new file
-+ (define orig-mode (file-or-directory-permissions db-file 'bits))
-+ (define writeable-mode (bitwise-ior user-write-bit orig-mode))
-+ (unless (= writeable-mode orig-mode)
-+ (file-or-directory-permissions db-file writeable-mode)))
- (doc-db-disconnect
- (doc-db-file->connection db-file #t))))
- (when (or (ormap can-build*? main-docs)
---
-2.32.0
-
diff --git a/gnu/packages/patches/racket-backport-8.6-hurd.patch b/gnu/packages/patches/racket-backport-8.6-hurd.patch
deleted file mode 100644
index d593b01e62..0000000000
--- a/gnu/packages/patches/racket-backport-8.6-hurd.patch
+++ /dev/null
@@ -1,609 +0,0 @@
-From f17b030fa2f902bb3666913d4a3cd6ba9c146d22 Mon Sep 17 00:00:00 2001
-From: Philip McGrath <philip@philipmcgrath.com>
-Date: Wed, 3 Aug 2022 03:13:03 -0400
-Subject: [PATCH 1/3] Chez Scheme: Fix build on GNU/Hurd
-
-Mostly GNU/Hurd should take the same options as GNU/Linux. One
-difference is that the Hurd does not define macros such as `PATH_MAX` or
-`NOFILE`, because it avoids imposing arbitrary limits on such resources.
-This patch provides alternatives for localized uses of those constants,
-but it accepts the pervasive use of `PATH_MAX` in finding bootfiles for
-now. See https://www.gnu.org/software/hurd/hurd/porting/guidelines.html.
-
-(cherry picked from commit 87eee6e2adb8c6bc11e60619c706fa6295096085)
----
- racket/src/ChezScheme/README.md | 1 +
- racket/src/ChezScheme/c/number.c | 22 +++++++++----------
- racket/src/ChezScheme/c/prim5.c | 35 ++++++++++++++++++++++++++++--
- racket/src/ChezScheme/c/scheme.c | 34 +++++++++++++++++------------
- racket/src/ChezScheme/c/version.h | 7 ++++--
- racket/src/ChezScheme/configure | 17 ++++++++++-----
- racket/src/ChezScheme/s/cmacros.ss | 1 +
- racket/src/cs/c/configure | 14 ++++++++++--
- racket/src/cs/c/configure.ac | 14 ++++++++++--
- racket/src/cs/rumble/system.ss | 3 +++
- 10 files changed, 109 insertions(+), 39 deletions(-)
-
-diff --git a/racket/src/ChezScheme/README.md b/racket/src/ChezScheme/README.md
-index a4a11a5eef..25231dd9bb 100644
---- a/racket/src/ChezScheme/README.md
-+++ b/racket/src/ChezScheme/README.md
-@@ -13,6 +13,7 @@ Supported platforms (bytecode interpreter may work for others):
- * OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
- * NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
- * Solaris: x86, x86_64
-+ * GNU/Hurd: x86
- * Android: ARMv7, AArch64
- * iOS: AArch64
- * WebAssembly via Emscripten (bytecode interpreter only)
-diff --git a/racket/src/ChezScheme/c/number.c b/racket/src/ChezScheme/c/number.c
-index ede38cc626..e2bce0d2d3 100644
---- a/racket/src/ChezScheme/c/number.c
-+++ b/racket/src/ChezScheme/c/number.c
-@@ -1041,15 +1041,15 @@ floating-point operations
-
- #ifdef IEEE_DOUBLE
- /* exponent stored + 1024, hidden bit to left of decimal point */
--#define bias 1023
--#define bitstoright 52
--#define m1mask 0xf
--#ifdef WIN32
--#define hidden_bit 0x10000000000000
--#else
--#define hidden_bit 0x10000000000000ULL
--#endif
--#ifdef LITTLE_ENDIAN_IEEE_DOUBLE
-+# define bias 1023
-+# define bitstoright 52
-+# define m1mask 0xf
-+# ifdef WIN32
-+# define hidden_bit 0x10000000000000
-+# else
-+# define hidden_bit 0x10000000000000ULL
-+# endif
-+# ifdef LITTLE_ENDIAN_IEEE_DOUBLE
- struct dblflt {
- UINT m4: 16;
- UINT m3: 16;
-@@ -1058,7 +1058,7 @@ struct dblflt {
- UINT e: 11;
- UINT sign: 1;
- };
--#else
-+# else
- struct dblflt {
- UINT sign: 1;
- UINT e: 11;
-@@ -1067,7 +1067,7 @@ struct dblflt {
- UINT m3: 16;
- UINT m4: 16;
- };
--#endif
-+# endif
- #endif
-
- double S_random_double(U32 m1, U32 m2, U32 m3, U32 m4, double scale) {
-diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c
-index 124d1e049c..82bbf8d687 100644
---- a/racket/src/ChezScheme/c/prim5.c
-+++ b/racket/src/ChezScheme/c/prim5.c
-@@ -23,6 +23,10 @@
- #include <ctype.h>
- #include <math.h>
-
-+#if defined(__GNU__) /* Hurd */
-+#include <sys/resource.h>
-+#endif
-+
- /* locally defined functions */
- static INT s_errno(void);
- static IBOOL s_addr_in_heap(uptr x);
-@@ -58,7 +62,7 @@ static void s_showalloc(IBOOL show_dump, const char *outfn);
- static ptr s_system(const char *s);
- static ptr s_process(char *s, IBOOL stderrp);
- static I32 s_chdir(const char *inpath);
--#ifdef GETWD
-+#if defined(GETWD) || defined(__GNU__) /* Hurd */
- static char *s_getwd(void);
- #endif
- static ptr s_set_code_byte(ptr p, ptr n, ptr x);
-@@ -881,7 +885,18 @@ static ptr s_process(char *s, IBOOL stderrp) {
- CLOSE(0); if (dup(tofds[0]) != 0) _exit(1);
- CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1);
- CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1);
-+#ifndef __GNU__ /* Hurd */
- {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);}
-+#else /* __GNU__ Hurd: no NOFILE */
-+ {
-+ INT i;
-+ struct rlimit rlim;
-+ getrlimit(RLIMIT_NOFILE, &rlim);
-+ for (i = 3; i < rlim.rlim_cur; i++) {
-+ (void)CLOSE(i);
-+ }
-+ }
-+#endif /* __GNU__ Hurd */
- execl("/bin/sh", "/bin/sh", "-c", s, NULL);
- _exit(1) /* only if execl fails */;
- /*NOTREACHED*/
-@@ -927,6 +942,22 @@ static I32 s_chdir(const char *inpath) {
- static char *s_getwd() {
- return GETWD(TO_VOIDP(&BVIT(S_bytevector(PATH_MAX), 0)));
- }
-+#elif defined(__GNU__) /* Hurd: no PATH_MAX */
-+static char *s_getwd() {
-+ char *path;
-+ size_t len;
-+ ptr bv;
-+ path = getcwd(NULL, 0);
-+ if (NULL == path) {
-+ return NULL;
-+ } else {
-+ len = strlen(path);
-+ bv = S_bytevector(len);
-+ memcpy(TO_VOIDP(&BVIT(bv, 0)), path, len);
-+ free(path);
-+ return TO_VOIDP(&BVIT(bv, 0));
-+ }
-+}
- #endif /* GETWD */
-
- static ptr s_set_code_byte(ptr p, ptr n, ptr x) {
-@@ -1817,7 +1848,7 @@ void S_prim5_init(void) {
- Sforeign_symbol("(cs)s_rational", (void *)S_rational);
- Sforeign_symbol("(cs)sub", (void *)S_sub);
- Sforeign_symbol("(cs)rem", (void *)S_rem);
--#ifdef GETWD
-+#if defined(GETWD) || defined(__GNU__) /* Hurd */
- Sforeign_symbol("(cs)s_getwd", (void *)s_getwd);
- #endif
- Sforeign_symbol("(cs)s_chdir", (void *)s_chdir);
-diff --git a/racket/src/ChezScheme/c/scheme.c b/racket/src/ChezScheme/c/scheme.c
-index ed5564540b..0c40e3eaf0 100644
---- a/racket/src/ChezScheme/c/scheme.c
-+++ b/racket/src/ChezScheme/c/scheme.c
-@@ -458,6 +458,12 @@ static IBOOL next_path(char *path, const char *name, const char *ext, const char
- static const char *path_last(const char *path);
- static char *get_defaultheapdirs(void);
-
-+#ifdef PATH_MAX
-+# define BOOT_PATH_MAX PATH_MAX
-+#else /* hack for Hurd: better to remove the restriction */
-+# define BOOT_PATH_MAX 4096
-+#endif
-+
- static const char *path_last(const char *p) {
- const char *s;
- #ifdef WIN32
-@@ -483,7 +489,7 @@ static const char *path_last(const char *p) {
-
- static char *get_defaultheapdirs() {
- char *result;
-- wchar_t buf[PATH_MAX];
-+ wchar_t buf[BOOT_PATH_MAX];
- DWORD len = sizeof(buf);
- if (ERROR_SUCCESS != RegGetValueW(HKEY_LOCAL_MACHINE, L"Software\\Chez Scheme\\csv" VERSION, L"HeapSearchPath", RRF_RT_REG_SZ, NULL, buf, &len))
- return DEFAULT_HEAP_PATH;
-@@ -512,14 +518,14 @@ static char *get_defaultheapdirs() {
- * leaving the full path with name affixed in path and *sp / *dsp pointing
- * past the current entry. it returns 1 on success and 0 if at the end of
- * the search path. path should be a pointer to an unoccupied buffer
-- * PATH_MAX characters long. either or both of sp/dsp may be empty,
-+ * BOOT_PATH_MAX characters long. either or both of sp/dsp may be empty,
- * but neither may be null, i.e., (char *)0. */
- static IBOOL next_path(char *path, const char *name, const char *ext,
- const char **sp, const char **dsp) {
- char *p;
- const char *s, *t;
-
--#define setp(c) if (p >= path + PATH_MAX) { fprintf(stderr, "search path entr