* [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. @ 2022-05-03 18:31 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5 Philip McGrath ` (7 more replies) 0 siblings, 8 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:31 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath Hi, This patch series contains Racket 8.5 and upstream Chez Scheme 9.5.8: both were re released since last week. For upstream Chez Scheme, armhf-linux has been deleted from `supported-systems` with a comment saying it's broken since before I started contributing to Guix. I haven't changed that, since I don't have access to an ARM system at the moment, and it doesn't have thread support upstream anyway, but I think it should be fixed by this point, if it hadn't been already. Could someone check? Two recent developments in the Racket world are notable from a packaging perspective: 1. After branching for this release, on HEAD Racket has adopted Zuo[1], a tiny Raket-like language for build scripting. The Zuo interpreter is a single C file that can be compiled as simply as `cc zuo.c`, and libraries written in Zuo implement a DSL like `make` or (more so) Shake[2] for build steps and tracking dependencies. Autoconf is still there, and `make` can still be used in all of the ways it could before (modulo bugs), but the makefiles actually just delegate to Zuo.[3] In theory, this shouldn't require any changes, but Guix is enough of a stress test that it's exposed some rough edges: many have already been fixed upstream, but a few will require changes to the Guix packaging---but I think all the changes make things nicer, anyway. I have a branch up at [4] based on Racket HEAD if anyone's interested: the only remaining Zuo-related issue is with the Chez Scheme test suite. Overall, I for one already find the Zuo build scripts much more comprehensible and hackable than the old makefiles. To pick just one example of the former complexity, there was a build script implementing a makefile-to-makefile compiler to support variable propagation for non-GNU `make`s. Zuo (and Racket's use of it) is also much more robust in dependency tracking. Formerly, you were often better off throwing away your build directory and starting again. I think this is an exciting step for anyone who builds Racket from source regularly, and Zuo might be interesting for other projects, too. 2. Racket's version of Chez Scheme has long had a “portable bytecode” backend as an alternative to native-code compilation. Up to this point it has primarily been a bootstrapping shortcut that didn't require distributing binaries for every platform. With this release, though, the implementation has improved: it now works even on platforms for which there isn't a native-code backend available --- for Guix, that includes powerpc64le-linux, riscv64-linux, mips64el-linux, and i586-gnu --- and it performs well enough on those platforms to make Racket CS viable instead of Racket BC (which didn't have JIT support for those platforms, anyway). For Guix, this also means that `(chez-scheme-for-system)` should be able to return a working Chez Scheme package for every system. Unfortunately, there are some issues with (at least) the `configure` scripts in the release such that building Racket for those systems doesn't quite work yet: see discussion at [5]. I'll be following up on that, and I might backport the fixes if they end up being small enough, but certainly it should work by Racket 8.6, scheduled for July. In the mean time, just knowing that this functionality is on its way helped with figuring out how much could be thrown out to simplify the follow-up to <https://issues.guix.gnu.org/54292> at the end of this patch series. -Philip [1]: https://docs.racket-lang.org/zuo/index.html [2]: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/03/hadrian.pdf [3]: https://docs.racket-lang.org/racket-build-guide/zuo.html [4]: https://gitlab.com/philip1/guix-patches/-/tree/zuo [5]: https://racket.discourse.group/t/chez-for-architectures-without-native-backends/950 Philip McGrath (7): gnu: racket: Update to 8.5. gnu: racket: Fix out-of-source build. gnu: chez-scheme: Update to 9.5.8. gnu: chez-scheme: Refactor documentation phases. gnu: chez-scheme: Refactor configure phase and fix '--threads'. gnu: stex: Get machine type dynamically. gnu: chez-scheme-for-system: Adjust support logic. gnu/local.mk | 2 - gnu/packages/chez.scm | 416 +++++++++------- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 106 ++-- 5 files changed, 292 insertions(+), 723 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch base-commit: 654f878f0b9d2136affa3e3d32da1639e6942a54 -- 2.32.0 ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-04 6:53 ` Liliana Marie Prikler 2022-05-03 18:33 ` [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build Philip McGrath ` (6 subsequent siblings) 7 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, gnu/packages/patches/racket-enable-scheme-backport.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. * gnu/packages/racket.scm (%racket-version): Update to 8.4.900. (%racket-origin)[sha256]: Update accordingly. [patches]: Remove obsolete patches. (racket-vm-common-configure-flags): Remove incorrect comment. (simple-racket-origin): Accept optional #:commit argument. (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, scribble, typed-racket, string-constants, syntax-color, web-server, xrepl>: Update checksums. <gui, srfi>: Likewise, and remove obsolete backports. --- gnu/local.mk | 2 - gnu/packages/chez.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 85 ++-- 5 files changed, 32 insertions(+), 550 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index ad7b0a1480..c812881809 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1757,8 +1757,6 @@ 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-enable-scheme-backport.patch \ - %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index d47225dbe5..a7f75a731a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot> -;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com> +;;; Copyright © 2021, 2022 Philip McGrath <philip@philipmcgrath.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -361,7 +361,7 @@ (define-public chez-scheme-for-racket (package (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.5.7.3") + (version "9.5.7.6") ;; 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! diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch deleted file mode 100644 index 3a5a4a3d82..0000000000 --- a/gnu/packages/patches/racket-enable-scheme-backport.patch +++ /dev/null @@ -1,465 +0,0 @@ -From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 10:36:09 -0700 -Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` - -(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) - -(Fixed conflicts by dropping pbchunks and pbarch changes.) ---- - racket/src/ChezScheme/configure | 15 ++++++++++++++- - racket/src/ChezScheme/s/Mf-base | 4 ++-- - racket/src/ChezScheme/s/Mf-cross | 4 +++- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure -index 4515ffc105..0098829091 100755 ---- a/racket/src/ChezScheme/configure -+++ b/racket/src/ChezScheme/configure -@@ -45,6 +45,7 @@ threads=yes - nothreads=no - temproot="" - help=no -+forceworkarea=no - gzipmanpages=yes - installowner="" - installgroup="" -@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do - --pb) - pb=yes - ;; -+ --force) -+ forceworkarea=yes -+ ;; - --installprefix=*) - installprefix=`echo $1 | sed -e 's/^--installprefix=//'` - ;; -@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then - echo " --toolprefix=<prefix> prefix tool (compiler, linker, ...) names" - echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" - echo " --workarea=<pathname> build directory ($w)" -+ echo " --force configure even without boot files" - echo " CC=<C compiler> C compiler" - echo " CPPFLAGS=<C preprocessor flags> C preprocessor flags" - echo " CFLAGS=<C compiler flags> C compiler flags" -@@ -721,8 +726,16 @@ case "${flagsmuni}" in - ;; - esac - -+if [ "$w" = "$m" ] ; then -+ configuringin="" -+else -+ configuringin=" in $w" -+fi -+ - if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then -- echo "Configuring for $m" -+ echo "Configuring for $m$configuringin" -+elif [ "$forceworkarea" = yes ] ; then -+ echo "Configuring for $m$configuringin despite missing boot files" - else - if [ "$m" = "" ] ; then - maybem="<machine type>" -diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base -index cc6178c973..1f4a967998 100644 ---- a/racket/src/ChezScheme/s/Mf-base -+++ b/racket/src/ChezScheme/s/Mf-base -@@ -94,7 +94,7 @@ endif - # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme - # implementation - Scheme = ../bin/$m/scheme${ExeSuffix} --export SCHEMEHEAPDIRS=../boot/%m -+export SCHEMEHEAPDIRS=../boot/$m - export CHEZSCHEMELIBDIRS=. - - # Define the libdirs separator character -@@ -691,4 +691,4 @@ reset-one: - - .PHONY: run - run: -- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) -+ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) -diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross -index d796cbb459..397af59a28 100644 ---- a/racket/src/ChezScheme/s/Mf-cross -+++ b/racket/src/ChezScheme/s/Mf-cross -@@ -43,5 +43,7 @@ x$(xm).$(m): - $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch - mv xpatch x$(xm).$(m) - -+ifneq ($(SCHEMEHEAPDIRS),:) - # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed --nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+endif --- -2.32.0 - - -From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 11:03:30 -0700 -Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable - -When the same Chez Scheme version as used by Racket is already -available, then `--enable-scheme=...` can supply an executable. For -cross builds, `--enable-scheme=...` can still supply a build -directory, instead, as before. - -(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) ---- - racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ - racket/src/README.txt | 30 +++++++++++--- - racket/src/configure | 8 +++- - racket/src/cs/README.txt | 6 ++- - racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- - racket/src/cs/c/configure | 24 +++++++++-- - racket/src/cs/c/configure.ac | 21 ++++++++-- - 7 files changed, 112 insertions(+), 24 deletions(-) - -diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in -index c396efc851..3998ef9ccd 100644 ---- a/racket/src/ChezScheme/makefiles/Makefile.in -+++ b/racket/src/ChezScheme/makefiles/Makefile.in -@@ -59,6 +59,9 @@ reset: - %.boot: - (cd $(workarea) && $(MAKE) $*.boot) - -+auto.boot: -+ (cd $(workarea) && $(MAKE) $(defaultm).boot) -+ - # <machine>.bootquick to build boot files for <machine> - # with o=3 d=0 for the cross compiler, and only after - # building the kernel for the configured machine -diff --git a/racket/src/README.txt b/racket/src/README.txt -index 98647aebce..d77310b4a4 100644 ---- a/racket/src/README.txt -+++ b/racket/src/README.txt -@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of - ======================================================================== - - Cross-compilation requires at least two flags to `configure`: -+`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) -+`--enable-scheme-SCHEME`. -+ -+More information: - - * `--host=OS`, where OS is something like `i386-gnu-linux` to - indicate the target platform. -@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: - run `configure` again (with no arguments) in a "local" subdirectory - to create a build for the current platform. - --An additional flag is needed for building Racket CS, unless the flag --`--enable-racket=auto` is used: -- -- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" -- directory where Chez Scheme is built for the host system. -+ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable -+ executable that runs on the build platform; the executable must be -+ the same version as used in Racket built for the target platform. -+ -+ Supplying `--enable-scheme=DIR` is also supported in cross-build -+ mode, where DIR is a path that has a "ChezScheme" directory where -+ Chez Scheme is built for the host system. -+ -+The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are -+allowed for non-cross builds, too: -+ -+ * For Racket CS, supplying either selects a Racket or Chez Scheme -+ implementation used to create boot files to the build platform. -+ Suppling Chez Scheme is a much more direct path, but when Racket is -+ supplied, its version does not have to match the version being -+ built. -+ -+ * For Racket BC, `--enable-racket=RACKET` selects a Racket for -+ prepare C sources to cooperate with garbage collection. Its version -+ needs to be close to the one being built, and potentially exactly -+ the same version. - - Some less commonly needed `configure` flags are for Racket BC: - -diff --git a/racket/src/configure b/racket/src/configure -index c9f3ba4419..1b53ec7ce2 100755 ---- a/racket/src/configure -+++ b/racket/src/configure -@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" - use_cs=maybe - use_bc=maybe - supplied_racket=no -+supplied_scheme=no - enable_boothelp= - - # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, -@@ -34,6 +35,9 @@ for arg in $*; do - --enable-racket=*) - supplied_racket=yes - ;; -+ --enable-scheme=*) -+ supplied_scheme=yes -+ ;; - --help | -h) - echo $0: - echo see --help-bc or --help-cs, since the Racket CS build and the -@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then - fi - - if test "$use_cs" = "yes" ; then -- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then -- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly -+ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then -+ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly - exit 1 - fi - -diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt -index 2ece417b78..8e6fc57b74 100644 ---- a/racket/src/cs/README.txt -+++ b/racket/src/cs/README.txt -@@ -39,6 +39,11 @@ build: - installed in the "../ChezScheme/boot/pb" directory as described by - "../ChezScheme/BUILDING". - -+ Supplying `--enable-scheme=...` is also an option if you alerady -+ have the same version of Chez Scheme built on the current platform. -+ Another build will be created, anyway, but more quickly than -+ without Chez Scheme. -+ - * Racket is needed to generate the files in the "schemified" - directory from the sources in sibling directories like "../io". The - Racket version must be practically the same as the current Racket -@@ -48,7 +53,6 @@ build: - Unlike Chez Scheme boot files, the files generated in "schemified" - are human-readable and -editable Scheme code. That provides a way - out of bootstrapping black holes, even without BC. -- - - - ======================================================================== -diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in -index 54a644a1d9..d73993f0fc 100644 ---- a/racket/src/cs/c/Makefile.in -+++ b/racket/src/cs/c/Makefile.in -@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ - SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) - SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme - SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) --SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_existing = @MAKE_SCHEME_SCHEME@ -+SCHEME = $(SCHEME@USE_SCHEME_MODE@) - - TARGET_MACH = @TARGET_MACH@ - SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) -@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. - @INCLUDEDEP@ @srcdir@/../../version/version.mak - - cs: -- $(MAKE) scheme@T_CROSS_MODE@ -+ $(MAKE) scheme@MAKE_SCHEME_MODE@ - $(MAKE) racket-so - cd rktio; $(MAKE) - $(MAKE) racketcs -@@ -121,9 +123,13 @@ racket-so: - - RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ - -+TARGET_MACH_built = $(TARGET_MACH) -+TARGET_MACH_existing = xc-$(TARGET_MACH) -+XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch -+ - CS_PROGS = SCHEME="$(SCHEME)" - CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ --CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" -+CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" - PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" - - build-racket-so: -@@ -163,6 +169,15 @@ pb-bootquick: - cd $(SCHEME_WORKAREA) && $(MAKE) reset - $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) - -+scheme-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot -+ $(MAKE) mach-make -+ -+$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: -+ mkdir -p $(SCHEME_WORKAREA) -+ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" -+ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all -+ - mach-make: - $(MAKE) config-scheme - cd $(SCHEME_WORKAREA) && $(MAKE) -@@ -182,24 +197,33 @@ config-scheme: - - scheme-cross: - env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt -+ $(MAKE) finish-scheme-cross -+ -+finish-scheme-cross: - $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) - cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t -- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+ $(MAKE) $(XPATCH_FILE) -+ -+scheme-cross-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) -+ $(MAKE) finish-scheme-cross - - # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older --# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files --XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+# than the build-<host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files -+XPATCH_DEPS_built = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -+ $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+XPATCH_DEPS_existing = -+XPATCH_DEPS = $(XPATCH_DEPS@USE_SCHEME_MODE@) - --$(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch: $(XPATCH_DEPS) -+$(XPATCH_FILE): $(XPATCH_DEPS) - $(MAKE) bounce TARGET=build-xpatch-using-host - - build-xpatch-using-host: - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/s && $(MAKE) -f Mf-cross m=$(MACH) xm=$(TARGET_MACH) Scheme="$(SCHEME_BIN)" SCHEMEHEAPDIRS="$(SCHEME_INC)" - - XPATCH = --XPATCHcross = --xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+XPATCHcross = --xpatch $(XPATCH_FILE) - - racket.boot: racket.so - $(SCHEME) --script $(srcdir)/convert-to-boot.ss @BOOT_COMPRESS_COMP@ $(XPATCH@CROSS_MODE@) racket.so racket.boot $(TARGET_MACH) -@@ -410,7 +434,7 @@ install-cross: - $(MAKE) compile-xpatch.$(TARGET_MACH) - $(MAKE) library-xpatch.$(TARGET_MACH) - --SCHEME_XPATCH = $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+SCHEME_XPATCH = $(XPATCH_FILE) - - CROSS_SERVE_DEPS = $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss \ - $(srcdir)/../expander/env.ss $(srcdir)/../linklet/config.ss -diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure -index 21695a431a..1eeef57753 100755 ---- a/racket/src/cs/c/configure -+++ b/racket/src/cs/c/configure -@@ -654,6 +654,9 @@ MINGW - NOT_OSX - OSX - SETUP_BOOT_MODE -+USE_SCHEME_MODE -+MAKE_SCHEME_SCHEME -+MAKE_SCHEME_MODE - TT_CROSS_MODE - T_CROSS_MODE - CROSS_MODE -@@ -1448,7 +1451,7 @@ Optional Features: - --enable-docs build docs on install (enabled by default) - --enable-usersetup setup user-specific files on install - --enable-racket=<path> use <path> as Racket for build; or "auto" to create -- --enable-scheme=<path> use <path> as host's build directory for cross -+ --enable-scheme=<path> use <path> as host build for cross - --enable-mach=<mach> use Chez Scheme machine type <mach> - --enable-target=<mach> cross-build for Chez Scheme machine type <mach> - --enable-portable prefer portable to host-specific -@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" - show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' - - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - show_explicitly_enabled "${enable_portable}" "portable" -@@ -4745,9 +4748,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags - - - -+ -+ -+ - - - -diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac -index 464ebe1760..aaee88156d 100644 ---- a/racket/src/cs/c/configure.ac -+++ b/racket/src/cs/c/configure.ac -@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev - AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) - m4_include(../ac/path_arg.m4) - AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket for build; or "auto" to create]) --AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host's build directory for cross]) -+AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host build for cross]) - AC_ARG_ENABLE(mach, [ --enable-mach=<mach> use Chez Scheme machine type <mach>]) - AC_ARG_ENABLE(target, [ --enable-target=<mach> cross-build for Chez Scheme machine type <mach>]) - m4_include(../ac/portable_arg.m4) -@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" - show_explicitly_enabled "${enable_xonx}" "Unix style" - m4_include(../ac/path_show.m4) - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - m4_include(../ac/portable_show.m4) -@@ -504,9 +504,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) - AC_SUBST(CROSS_MODE) - AC_SUBST(T_CROSS_MODE) - AC_SUBST(TT_CROSS_MODE) -+AC_SUBST(MAKE_SCHEME_MODE) -+AC_SUBST(MAKE_SCHEME_SCHEME) -+AC_SUBST(USE_SCHEME_MODE) - AC_SUBST(SETUP_BOOT_MODE) - AC_SUBST(OSX) - AC_SUBST(NOT_OSX) --- -2.32.0 - diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch deleted file mode 100644 index 1e018eaa79..0000000000 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Mon, 31 Jan 2022 15:31:22 -0700 -Subject: [PATCH] fix creation of tethered launchers - -Related to racket/racket#4133 - -(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) ---- - gui-lib/mred/installer.rkt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt -index b1691472..9ef06c53 100644 ---- a/gui-lib/mred/installer.rkt -+++ b/gui-lib/mred/installer.rkt -@@ -72,4 +72,5 @@ - (list "-A" (path->string (find-system-path 'addon-dir))))) - - (define (config-flags) -- (list "-G" (path->string (find-config-dir)))) -+ (list "-X" (path->string (find-collects-dir)) -+ "-G" (path->string (find-config-dir)))) --- -2.32.0 - diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 471a11dd48..adf3ccfd74 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -195,7 +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! +(define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -205,11 +205,9 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch" - ;; Remove by Racket 8.5: - "racket-enable-scheme-backport.patch")) + (patches (search-patches "racket-minimal-sh-via-rktio.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -248,8 +246,6 @@ (define (racket-vm-common-configure-flags) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) "--disable-strip" - ;; XXX: origtree layout is required by some other packages down the - ;; bootstrap chain. Remove these flags as soon as we can do without them. "--enable-origtree" ,(string-append "--prefix=" #$output "/opt/racket-vm"))) @@ -442,17 +438,18 @@ (define (racket-packages-origin name origin specs) #$name))) specs))))) -(define (simple-racket-origin repo hash specs) +(define* (simple-racket-origin repo hash specs #:key (commit %racket-commit)) "Like 'racket-packages-origin', but specialized for packages hosted at \"https://github.com/racket/REPO\" with sha256 checksum HASH. REPO is also -used to build the name of the resulting store item." +used to build the name of the resulting store item. If COMMIT is given, it is +used instead of %RACKET-COMMIT." (racket-packages-origin repo (origin (method git-fetch) (uri (git-reference (url (format #f "https://github.com/racket/~a" repo)) - (commit %racket-commit))) + (commit commit))) (sha256 hash) (file-name (git-file-name (string-append "racket-" repo) %racket-version))) @@ -589,7 +586,7 @@ (define-public racket racket-minimal ;; <-- TODO non-tethered layer (racket-vm-for-system) (simple-racket-origin - "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + "2d" (base32 "0fb5v6058ls08xw3zbmqyr2ym0psm119gl9ffgmhm9w8rs9i4dq7") '("2d" "2d-doc" "2d-lib")) (simple-racket-origin "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") @@ -622,22 +619,22 @@ (define-public racket "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin - "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") '(("datalog" "."))) (simple-racket-origin "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + "deinprogramm" (base32 "0g8flr1qg3bcyhdinqhs4w7dyisaqyailbxrjgd2a7zlqmdyicfr") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") '("distributed-places" "distributed-places-doc" "distributed-places-lib")) (simple-racket-origin - "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + "draw" (base32 "1fpk85rs2crd63bxnmwj2pysisd62pxcqaip01si67dv1ri8ff92") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + "drracket" (base32 "0dipnz92c63zxys9z1kl5215rm7arc35g9r8bs8ivp96p75mljnz") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -657,7 +654,7 @@ (define-public racket "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") '("errortrace" "errortrace-doc" "errortrace-lib")) (simple-racket-origin - "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + "expeditor" (base32 "0mjfwb4wzwsg5xj3k6cmik0va432n56rp5h7rxx1c2yy3prh1j7q") '("expeditor" "expeditor-doc" "expeditor-lib")) (simple-racket-origin "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") @@ -670,25 +667,14 @@ (define-public racket (simple-racket-origin "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") '(("games" "."))) - (racket-packages-origin - "gui" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/gui") - (commit %racket-commit))) - (sha256 (base32 - "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (file-name (git-file-name "racket-gui" %racket-version))) + (simple-racket-origin + "gui" (base32 "0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + "htdp" (base32 "199qchdq6db6m2n4j861hiy4nxd6hg1qva16lhhdbfj274qmcplg") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -756,7 +742,7 @@ (define-public racket "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + "pict" (base32 "0v7a3l77swsbh80mnb9rakdwgw7s66ji0mall7qcqfwyg1b4zmlv") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -771,7 +757,7 @@ (define-public racket "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") '("planet" "planet-doc" "planet-lib")) (simple-racket-origin - "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + "plot" (base32 "04871pspbm0q3bz5896sa3jw2rp9i6jf0b5aivrxfp56vxxd2ybb") '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) (simple-racket-origin "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") @@ -786,7 +772,7 @@ (define-public racket (url "https://github.com/Metaxal/quickscript") (commit %racket-commit))) (sha256 (base32 - "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + "00sf5nw09aacd0l4a4cknnffvcs95p596im3blsdvfz5ck6jdwl8")) (file-name (git-file-name "Metaxal-quickscript" %racket-version))) '(("quickscript" "."))) (simple-racket-origin @@ -807,10 +793,10 @@ (define-public racket (git-file-name "jeapostrophe-racket-cheat" %racket-version))) '(("racket-cheat" "."))) (simple-racket-origin - "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + "racklog" (base32 "0fbq0fpfb3l6h7h772dvkmlzlk2dnq5f8296xx1qxhhwypibqzr9") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + "rackunit" (base32 "0vfwcddzrgrdv5awjka7m0jzqhqvfc5wlkih83a670y96496a83n") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -826,7 +812,7 @@ (define-public racket "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + "redex" (base32 "0a1fl5s80k3j3xh3lri8886ql443m7pmgv18y7whzlmsd7x8rdpr") '("redex" "redex-benchmark" "redex-doc" @@ -841,7 +827,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + "scribble" (base32 "0fbb7xgz95y90247hfc1a19v7ry8m6blvv4y8irdgzhjvik70zb3") '("scribble" "scribble-doc" "scribble-html-lib" @@ -873,35 +859,24 @@ (define-public racket "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + "typed-racket" (base32 "05xlyjrx3m8xrrrw1xmfb1807qa5aqfl0zp9bdxwh2z7cfxaii09") '("source-syntax" "typed-racket" "typed-racket-compatibility" "typed-racket-doc" "typed-racket-lib" "typed-racket-more")) - (racket-packages-origin - "srfi" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/srfi") - ;; Includes an FSDG fix: return to %racket-commit in 8.5. - ;; See <https://github.com/racket/srfi/pull/15>. - (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) - (sha256 (base32 - "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) - ;; Use the relevant version for srfi-doc and srfi-lib, - ;; since we're using a newer commit than the v8.4 tag. - (file-name (git-file-name "racket-srfi" "1.1"))) + (simple-racket-origin + "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + "string-constants" (base32 "1rjs0gyw9hsiglwxnimz272v9xj1gwjxrnzh4qbsxkvdaphvi38m") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") '(("swindle" "."))) (simple-racket-origin - "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + "syntax-color" (base32 "1xf3rl8687c1nar4kkgkvyncwi0gl696rif0iqhffg730fk457gi") '("syntax-color" "syntax-color-doc" "syntax-color-lib")) (simple-racket-origin "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") @@ -910,13 +885,13 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + "web-server" (base32 "1g4x79ym3mgxv4f3z3z84j12355pf44pjlzlb7f0h6r0i7p0cbjd") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") '("wxme" "wxme-lib")) (simple-racket-origin - "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + "xrepl" (base32 "19svg0jfs656bld5ikqipz3a5szk5k02zq5fh43209qw527dnfbk") '("xrepl" "xrepl-doc" "xrepl-lib")))) (build-system gnu-build-system) (arguments -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-03 18:33 ` [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5 Philip McGrath @ 2022-05-04 6:53 ` Liliana Marie Prikler 2022-05-05 21:49 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-04 6:53 UTC (permalink / raw) To: Philip McGrath, 55248 Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, > gnu/packages/patches/racket-enable-scheme-backport.patch: Delete > files. > * gnu/local.mk (dist_patch_DATA): Remove them. LGTM. > * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. This... > * gnu/packages/racket.scm (%racket-version): Update to 8.4.900. ... and this might be done in different commits. Also, you typo'd in the ChangeLog, the version ought to be 8.5 > (%racket-origin)[sha256]: Update accordingly. You don't normally need to mention hash updates, but (*). > [patches]: Remove obsolete patches. LGTM. > (racket-vm-common-configure-flags): Remove incorrect comment. No. Unless you address the issue at hand (which I don't want to be a blocker for this series, mind you), it persists. If you don't like how the comment is written currently, you might suggest an alternative formulation, but people deserve to know that the origtree layout is a hack. > (simple-racket-origin): Accept optional #:commit argument. Is this used anywhere? If not, I suggest leaving it be for now. > (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, > expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, > scribble, typed-racket, string-constants, syntax-color, web-server, > xrepl>: Update checksums. (*) here it makes sense to document the checksum updates, because they'd otherwise be invisible. > <gui, srfi>: Likewise, and remove obsolete backports. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-04 6:53 ` Liliana Marie Prikler @ 2022-05-05 21:49 ` Philip McGrath 2022-05-06 6:37 ` Liliana Marie Prikler 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-05 21:49 UTC (permalink / raw) To: Liliana Marie Prikler, 55248, Maxime Devos Hi, On 5/4/22 02:53, Liliana Marie Prikler wrote: > Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: >> * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, >> gnu/packages/patches/racket-enable-scheme-backport.patch: Delete >> files. >> * gnu/local.mk (dist_patch_DATA): Remove them. > LGTM. >> * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. > This... >> * gnu/packages/racket.scm (%racket-version): Update to 8.4.900. > ... and this might be done in different commits. Since 'chez-scheme-for-racket' uses the same origin as the Racket VM packages, I think the versions have to be updated at the same time, short of having a commit where one of them is incorrect or doing something needlessly complicated. > Also, you typo'd in > the ChangeLog, the version ought to be 8.5 Thanks! (8.4.900 was the release candidate, from which I `git commit --amend`ed this patch.) >> (%racket-origin)[sha256]: Update accordingly. > You don't normally need to mention hash updates, but (*). Ok, will drop this but keep below. >> [patches]: Remove obsolete patches. > LGTM. >> (racket-vm-common-configure-flags): Remove incorrect comment. > No. Unless you address the issue at hand (which I don't want to be a > blocker for this series, mind you), it persists. If you don't like how > the comment is written currently, you might suggest an alternative > formulation, but people deserve to know that the origtree layout is a > hack. I understand that this is your opinion. I disagree. I don't want to make a big deal out of it, but I'm uncomfortable with the fact that `git blame` currently attributes to me a statement of opinion which I did not write and do not believe. I could write a lot of prose arguing in favor of --enable-origtree as a matter of opinion, but I'd rather spend my time trying to write a racket-build-system, which I expect will make its usefulness more obvious. For now, I'll limit myself to noting that, while Racket supports --enable-unix-style for those who insist on it (a group which formerly included me!), if you run the Racket installer script [1] with default options, it will install the files that 'racket-vm-cs' and similar place in "/opt/racket-vm/" in "/usr/racket". Optionally, the installer will then create symlinks is "/usr/bin" etc. pointing to a subset of the files that Guix's 'racket-minimal' installs into '#$output'. To the extent that there is an assertion of fact embedded in: > > - ;; XXX: origtree layout is required by some other packages down the > > - ;; bootstrap chain. Remove these flags as soon as we can do without them. it is not true. The packages which operate on a Racket installation with this layout (e.g. 'distro-build' and 'raco-cross') are not part of "the bootstrap chain", and the packages which are part of the bootstrap chain do not require --enable-origtree, except to the extent that e.g. it is a convenient way of telling apart multiple executables named "racket". >> (simple-racket-origin): Accept optional #:commit argument. > Is this used anywhere? If not, I suggest leaving it be for now. It isn't, but it was extremely useful for building the release candidate. That said, I'm ok with not changing it in Guix. >> (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, >> expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, >> scribble, typed-racket, string-constants, syntax-color, web-server, >> xrepl>: Update checksums. > (*) here it makes sense to document the checksum updates, because > they'd otherwise be invisible. >> <gui, srfi>: Likewise, and remove obsolete backports. -Philip [1]: https://download.racket-lang.org/releases/8.5/installers/racket-minimal-8.5-x86_64-linux-cs.sh ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-05 21:49 ` Philip McGrath @ 2022-05-06 6:37 ` Liliana Marie Prikler 2022-05-07 18:39 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-06 6:37 UTC (permalink / raw) To: Philip McGrath, 55248, Maxime Devos Hi, Am Donnerstag, dem 05.05.2022 um 17:49 -0400 schrieb Philip McGrath: > Hi, > > On 5/4/22 02:53, Liliana Marie Prikler wrote: > > Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: > > > * gnu/packages/patches/racket-gui-tethered-launcher- > > > backport.patch, > > > gnu/packages/patches/racket-enable-scheme-backport.patch: Delete > > > files. > > > * gnu/local.mk (dist_patch_DATA): Remove them. > > LGTM. > > > * gnu/packages/chez.scm (chez-scheme-for-racket): Update to > > > 9.5.7.6. > > This... > > > * gnu/packages/racket.scm (%racket-version): Update to 8.4.900. > > ... and this might be done in different commits. > > Since 'chez-scheme-for-racket' uses the same origin as the Racket VM > packages, I think the versions have to be updated at the same time, > short of having a commit where one of them is incorrect or doing > something needlessly complicated. Fair enough, go ahead. > > [...] > > > [patches]: Remove obsolete patches. > > LGTM. > > > > > (racket-vm-common-configure-flags): Remove incorrect comment. > > No. Unless you address the issue at hand (which I don't want to be > > a blocker for this series, mind you), it persists. If you don't > > like how the comment is written currently, you might suggest an > > alternative formulation, but people deserve to know that the > > origtree layout is a hack. > > I understand that this is your opinion. I disagree. I don't want to > make a big deal out of it, but I'm uncomfortable with the fact that > `git blame` currently attributes to me a statement of opinion which I > did not write and do not believe. Well, I'm uncomfortable with the fact that git assigns blame to people. The wording of the command name is (as many things in git) poorly chosen, but that's somewhat besides the point. I'm leaving open the option of writing a comment that you're more comfortable with, but I'm not leaving the option of silently removing it. > I could write a lot of prose arguing in favor of --enable-origtree as > a matter of opinion, but I'd rather spend my time trying to write a > racket-build-system, which I expect will make its usefulness more > obvious. You can argue in favour of it, but that doesn't change the fact that this layout breaks assumptions that are held elsewhere. "Dump everything into a single directory" has never been a good deployment strategy, and those who use it tend to regret their decision later. > For now, I'll limit myself to noting that, while Racket > supports --enable-unix-style for those who insist on it (a group > which formerly included me!), if you run the Racket installer script > [1] with default options, it will install the files that 'racket-vm- > cs' and similar place in "/opt/racket-vm/" in "/usr/racket". > Optionally, the installer will then create symlinks is "/usr/bin" > etc. pointing to a subset of the files that Guix's 'racket-minimal' > installs into'#$output'. This paragraph does not make as much sense to another person as you believe it does. If I'm counting correctly, we're talking about three different configurations right now. --enable-origtree, --enable-unix- style, and a default that uses neither of the two. I don't think we can easily draw inferences from either to the others. > To the extent that there is an assertion of fact embedded in: > > > > - ;; XXX: origtree layout is required by some other packages > > > down the > > > - ;; bootstrap chain. Remove these flags as soon as we can > > > do without them. > > it is not true. The packages which operate on a Racket installation > with this layout (e.g. 'distro-build' and 'raco-cross') are not part > of "the bootstrap chain", and the packages which are part of the > bootstrap chain do not require --enable-origtree, except to the > extent that e.g. it is a convenient way of telling apart multiple > executables named "racket". From my POV "the bootstrap chain" consists of everything from the first VM to the final racket package. In that sense, I am sure you communicated elsewhere that it is very important to get layers going, and I'm also fairly certain that we can't currently build the VM chain without origtree either -- at least it would require nontrivial modification of said packages. Again, if you have a formulation that is more factual, but doesn't span several pages like other comments in racket.scm do, you are free to replace it. However, for the sake of a racket-build-system even, I suggest that it would be better if racket's own layout was meaningful. In other words, why can't racket be more like guile and support RACKET_LOAD_PATH and RACKET_LOAD_COMPILED_PATH? > > Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-06 6:37 ` Liliana Marie Prikler @ 2022-05-07 18:39 ` Philip McGrath 2022-05-07 20:01 ` Maxime Devos 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-07 18:39 UTC (permalink / raw) To: Liliana Marie Prikler, 55248, Maxime Devos Hi, On 5/6/22 02:37, Liliana Marie Prikler wrote: > Hi, > > Am Donnerstag, dem 05.05.2022 um 17:49 -0400 schrieb Philip McGrath: >> Hi, >> >> On 5/4/22 02:53, Liliana Marie Prikler wrote: >>> Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: >>>> (racket-vm-common-configure-flags): Remove incorrect comment. >>> No. Unless you address the issue at hand (which I don't want to be >>> a blocker for this series, mind you), it persists. If you don't >>> like how the comment is written currently, you might suggest an >>> alternative formulation, but people deserve to know that the >>> origtree layout is a hack. >> >> I understand that this is your opinion. I disagree. I don't want to >> make a big deal out of it, but I'm uncomfortable with the fact that >> `git blame` currently attributes to me a statement of opinion which I >> did not write and do not believe. > Well, I'm uncomfortable with the fact that git assigns blame to people. > The wording of the command name is (as many things in git) poorly > chosen, but that's somewhat besides the point. I'm leaving open the > option of writing a comment that you're more comfortable with, but I'm > not leaving the option of silently removing it. > >> I could write a lot of prose arguing in favor of --enable-origtree as >> a matter of opinion, but I'd rather spend my time trying to write a >> racket-build-system, which I expect will make its usefulness more >> obvious. > You can argue in favour of it, but that doesn't change the fact that > this layout breaks assumptions that are held elsewhere. "Dump > everything into a single directory" has never been a good deployment > strategy, and those who use it tend to regret their decision later. > >> For now, I'll limit myself to noting that, while Racket >> supports --enable-unix-style for those who insist on it (a group >> which formerly included me!), if you run the Racket installer script >> [1] with default options, it will install the files that 'racket-vm- >> cs' and similar place in "/opt/racket-vm/" in "/usr/racket". >> Optionally, the installer will then create symlinks is "/usr/bin" >> etc. pointing to a subset of the files that Guix's 'racket-minimal' >> installs into'#$output'. > This paragraph does not make as much sense to another person as you > believe it does. If I'm counting correctly, we're talking about three > different configurations right now. --enable-origtree, --enable-unix- > style, and a default that uses neither of the two. I don't think we > can easily draw inferences from either to the others. > Given the vehemence of your opinion, I was assuming some familiarity with building Racket. There are various ways of ending up with a "Unix-style" installation as implemented by the 'setup/unixstyle-install' module, including `make unix-style` in the top-level directory, `./configure --enable-origtree=no` in the vm source directory, and the default answers to the installer script (which embeds an archive of the built files). There are some platform-specific details, but none that currently affect Guix. (E.g. when building for Mac, you can fine-tune the installation style and the use of GTK vs. Cocoa for `racket/gui`). An in-place installation (as produced by --enable-origtree) is self-contained and can be freely relocated. A Unix-style installation moves parts of an in-place build to better suit a shared FHS prefix (e.g. "etc/config.rktd" -> "etc/racket/config.rktd"; "collects" -> "share/racket/collects"), injects absolute paths to find parts of itself, and generates an uninstall script. But those things are not useful in this context: the `racket` executable from the VM packages should only be run to build the rest of Racket, and we want to build a Racket installation additive, not by mutating it. >> To the extent that there is an assertion of fact embedded in: >> >>>> - ;; XXX: origtree layout is required by some other packages >>>> down the >>>> - ;; bootstrap chain. Remove these flags as soon as we can >>>> do without them. >> >> it is not true. The packages which operate on a Racket installation >> with this layout (e.g. 'distro-build' and 'raco-cross') are not part >> of "the bootstrap chain", and the packages which are part of the >> bootstrap chain do not require --enable-origtree, except to the >> extent that e.g. it is a convenient way of telling apart multiple >> executables named "racket". > From my POV "the bootstrap chain" consists of everything from the first > VM to the final racket package. In that sense, I am sure you > communicated elsewhere that it is very important to get layers going, > and I'm also fairly certain that we can't currently build the VM chain > without origtree either -- at least it would require nontrivial > modification of said packages. > It is true that removing `--enable-origtree` would require nontrivial changes, primarily to `configure-layer.rkt`. > Again, if you have a formulation that is more factual, but doesn't span > several pages like other comments in racket.scm do, you are free to > replace it. I will try to write a strictly factual comment. > However, for the sake of a racket-build-system even, I > suggest that it would be better if racket's own layout was meaningful. > In other words, why can't racket be more like guile and support > RACKET_LOAD_PATH and RACKET_LOAD_COMPILED_PATH? > I mean, you are certainly free to dislike Racket's model of linking and compilation! And, in fact, Racket has enough configuration options and compatibility hooks that you could try to use it with e.g. PLTCOLLECTS, though it would not be recommended, well-tested, or useful for most Racketeers. With the caveat that all analogies are imprecise, why does Guix prefer to avoid relying on LD_LIBRARY_PATH for C libraries? From my perspective, Racket avoids at least several (maybe not all, but we shall see) of the weaknesses/restrictions described in [1]: > This is not the end of stat storms, though. Interpreters and language > run-time systems rely on search paths—GUILE_LOAD_PATH for Guile, > PYTHONPATH for Python, OCAMLPATH for OCaml, etc.—and are equally prone > to stormy application startups. Unlike ELF, they do not have a mechanism > akin to RUNPATH, let alone a run-time search path cache. We have yet to > find ways to address these. -Philip [1]: https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/ ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5. 2022-05-07 18:39 ` Philip McGrath @ 2022-05-07 20:01 ` Maxime Devos 0 siblings, 0 replies; 58+ messages in thread From: Maxime Devos @ 2022-05-07 20:01 UTC (permalink / raw) To: Philip McGrath, Liliana Marie Prikler, 55248 [-- Attachment #1: Type: text/plain, Size: 1368 bytes --] Philip McGrath schreef op za 07-05-2022 om 14:39 [-0400]: > With the caveat that all analogies are imprecise, why does Guix prefer > to avoid relying on LD_LIBRARY_PATH for C libraries? Because when using LD_LIBRARY_PATH, you not only need to install the binary in a profile, but also it library dependencies. Now, suppose that Guix didn't use RUNPATH or RPATH and instead relied on LD_LIBRARY_PATH. Now suppose you have a binary 'vlc' in /usr/bin (on a foreign distro) and 'openssl.so' in ~/.guix-profile/lib/... . Note that 'vlc' has 'openssl' as a dependency (for streaming over the Internet). Then suppose you run 'vlc'. The dynamic linker will see ‘we have a $LD_LIBRARY_PATH, let's use the openssl.so from ~/.guix-profile/lib instead of /usr/lib!’. However, it (could) turn out that the openssls from the two different locations have an incompatible ABI, causing a crash or such. Also, if you depend of LD_LIBRARY_PATH (without wrap-program), then you can't run things directly from /gnu/store. In the same manner, GUILE_LOAD_COMPILED_PATH (= Guile's mix of LD_LIBRARY_PATH (for 'guile') and LIBRARY_PATH (for Guile's compiler, e.g. the cross-module inlining) is a bit suboptimal, Guile binaries need to be wrapped (wrap-program / wrap-script). Would be nice to have a RUNPATH/RPATH equivalent ... Greetings, Maxime. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --] ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5 Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-04 9:29 ` Maxime Devos 2022-05-03 18:33 ` [bug#55248] [PATCH 3/7] gnu: chez-scheme: Update to 9.5.8 Philip McGrath ` (5 subsequent siblings) 7 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath * gnu/packages/racket.scm (racket-vm-cgc)[arguments]: Add a 'symlink-src' phase to put license files where 'install-license-files' expects to find them. Supply '#:out-of-source? #t'. --- gnu/packages/racket.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index adf3ccfd74..2f4f7cebd8 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -272,8 +272,8 @@ (define-public racket-vm-cgc ;; main-distribution-test that aren't part of the main ;; distribution. #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. + ;; Upstream recommends #:out-of-source?, and helps a lot with debugging + #:out-of-source? #t #:modules '((ice-9 match) (ice-9 regex) (guix build gnu-build-system) @@ -310,7 +310,15 @@ (define-public racket-vm-cgc #f))))))) (add-before 'configure 'chdir (lambda _ - (chdir "racket/src")))))) + (chdir "racket/src"))) + (add-after 'chdir 'symlink-src + ;; workaround for install-license-files + (lambda* (#:key out-of-source? #:allow-other-keys) + (when out-of-source? + (with-directory-excursion ".." + (symlink "src" + (package-name->name+version + (strip-store-file-name #$output)))))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-03 18:33 ` [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build Philip McGrath @ 2022-05-04 9:29 ` Maxime Devos 2022-05-05 18:53 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Maxime Devos @ 2022-05-04 9:29 UTC (permalink / raw) To: Philip McGrath, 55248 [-- Attachment #1: Type: text/plain, Size: 781 bytes --] Philip McGrath schreef op di 03-05-2022 om 14:33 [-0400]: > - ;; help with debugging, but it confuses `install-license-files`. [...] > + ;; workaround for install-license-files > + (lambda* (#:key out-of-source? #:allow-other-keys) > + (when out-of-source? > + (with-directory-excursion ".." > + (symlink "src" > + (package-name->name+version > + (strip-store-file-name #$output)))))))))) Surely we could fix this bug/limitation of install-license-files upstream (in this case, upstream=Guix)? Greetings, Maxime. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --] ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-04 9:29 ` Maxime Devos @ 2022-05-05 18:53 ` Philip McGrath 2022-05-05 19:52 ` Liliana Marie Prikler 2022-05-05 20:33 ` Maxime Devos 0 siblings, 2 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-05 18:53 UTC (permalink / raw) To: Maxime Devos, 55248, Liliana Marie Prikler, Liliana Marie Prikler Hi, On 5/4/22 05:29, Maxime Devos wrote: > Philip McGrath schreef op di 03-05-2022 om 14:33 [-0400]: >> - ;; help with debugging, but it confuses `install-license-files`. > [...] >> + ;; workaround for install-license-files >> + (lambda* (#:key out-of-source? #:allow-other-keys) >> + (when out-of-source? >> + (with-directory-excursion ".." >> + (symlink "src" >> + (package-name->name+version >> + (strip-store-file-name #$output)))))))))) > > Surely we could fix this bug/limitation of install-license-files > upstream (in this case, upstream=Guix)? > I'd certainly be in favor of that! I've never edited '(guix build gnu-build-system)' but I assume that would be a 'core-updates' change. I'm also not sure what the best solution would be in general. In Racket's specific case, the source directory for the Racket VM is (relative to the repository root), "racket/src/", where other notable directories present include "racket/collects/" and "pkgs/". An out-of-source build ends up happening in "racket/build/". The license files are in the source directory, which is what install-license-files expects, but the find-source-directory helper function fails to guess the location of the source directory: > (define (find-source-directory package) > ;; For an out-of-source build, guess the source directory location > ;; relative to the current directory. Return #f on failure. > (match (scandir ".." > (lambda (file) > (and (not (member file '("." ".." "build"))) > (file-is-directory? > (string-append "../" file))))) > (() ;hmm, no source > #f) > ((source) ;only one other file > (string-append "../" source)) > ((directories ...) ;pick the most likely one > ;; This happens for example with libstdc++, which lives within the GCC > ;; source tree. > (any (lambda (directory) > (and (string-prefix? package directory) > (string-append "../" directory))) > directories)))) Some possibilities I can imagine: * We could add a case to find-source-directory specifically for "src". * We could change configure to communicate the location of the source directory, e.g. via an environment variable, rather than trying to guess. * We could change install-license-files to do more searching in general, e.g. trying multiple directories or preferring a directory that contains at least one match for #:license-file-regexp. We'd have to consider the potential for false positives, too (e.g. sibling directories with projects under different licenses.) * We could add an argument to install-license-files to specify the directory explicitly, as a complement to #:license-file-regexp. Another scenario that might be worth considering is projects that follow the REUSE specification[1], which I don't think would be handled by the current install-license-files. But actually, for Racket, I forgot that a patch I'd sent upstream to handle this in `make install` should be in 8.5, so we may not need this patch at all: I'll confirm before I send v2. -Philip [1]: https://reuse.software/ [2]: https://github.com/racket/racket/pull/4127 ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-05 18:53 ` Philip McGrath @ 2022-05-05 19:52 ` Liliana Marie Prikler 2022-05-05 20:36 ` Maxime Devos 2022-05-05 20:33 ` Maxime Devos 1 sibling, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-05 19:52 UTC (permalink / raw) To: Philip McGrath, Maxime Devos, 55248 Am Donnerstag, dem 05.05.2022 um 14:53 -0400 schrieb Philip McGrath: > Hi, > > On 5/4/22 05:29, Maxime Devos wrote: > > Philip McGrath schreef op di 03-05-2022 om 14:33 [-0400]: > > > - ;; help with debugging, but it confuses `install-license- > > > files`. > > [...] > > > + ;; workaround for install-license-files > > > + (lambda* (#:key out-of-source? #:allow-other-keys) > > > + (when out-of-source? > > > + (with-directory-excursion ".." > > > + (symlink "src" > > > + (package-name->name+version > > > + (strip-store-file-name > > > #$output)))))))))) > > > > Surely we could fix this bug/limitation of install-license-files > > upstream (in this case, upstream=Guix)? > > > > I'd certainly be in favor of that! I've never edited '(guix build > gnu-build-system)' but I assume that would be a 'core-updates' change. > It would. > I'm also not sure what the best solution would be in general. > > In Racket's specific case, the source directory for the Racket VM is > (relative to the repository root), "racket/src/", where other notable > directories present include "racket/collects/" and "pkgs/". An > out-of-source build ends up happening in "racket/build/". The license > files are in the source directory, which is what install-license-files > expects, but the find-source-directory helper function fails to guess > the location of the source directory: I think the issue here is that we're in a chdir into the source, where the typical assumption that there's only a single directory besides it fails. > > (define (find-source-directory package) > > ;; For an out-of-source build, guess the source directory > > location > > ;; relative to the current directory. Return #f on failure. > > (match (scandir ".." > > (lambda (file) > > (and (not (member file '("." ".." "build"))) > > (file-is-directory? > > (string-append "../" file))))) > > (() ;hmm, no source > > #f) > > ((source) ;only one other > > file > > (string-append "../" source)) > > ((directories ...) ;pick the most > > likely one > > ;; This happens for example with libstdc++, which lives > > within the GCC > > ;; source tree. > > (any (lambda (directory) > > (and (string-prefix? package directory) > > (string-append "../" directory))) > > directories)))) I don't think (lambda (directory) (and (string-prefix? package directory) (string-append "../" directory))) does what we think it does. Even so, it's debatable whether that works for Racket. > Some possibilities I can imagine: > > * We could add a case to find-source-directory specifically for > "src". Not a fan personally. > * We could change configure to communicate the location of the > source directory, e.g. via an environment variable, rather than > trying to guess. That would work, but gratuitous environment variables could have unexpected consequences. However, note that the build systems themselves already need to capture the information of where the source directory lives! For gnu-build-system, you could check for abs_srcdir in the Makefile for instance. If this ever becomes necessary (reading ahead it doesn't seem to be, but let that if be an if), I'd suggest splitting install-license-files into a helper procedure that assumes we're in the correct directory and a top level procedure, that performs the guess. This top level procedure would need to be implemented once per build system, while the helper could be inherited. > * We could change install-license-files to do more searching in > general, e.g. trying multiple directories or preferring a > directory that contains at least one match for > #:license-file-regexp. We'd have to consider the potential for > false positives, too (e.g. sibling directories with projects > under different licenses.) > * We could add an argument to install-license-files to specify the > directory explicitly, as a complement to #:license-file-regexp. I would not do either. An alternative to adding another phase is wrapping install-license-files in a directory excursion within this package. That'd be less code which achieves the same thing. > Another scenario that might be worth considering is projects that > follow the REUSE specification[1], which I don't think would be > handled by the current install-license-files. I don't think we can rely on projects consistently following them, sadly. > But actually, for Racket, I forgot that a patch I'd sent upstream to > handle this in `make install` should be in 8.5, so we may not need > this patch at all: I'll confirm before I send v2. That is of course the best solution :) ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-05 19:52 ` Liliana Marie Prikler @ 2022-05-05 20:36 ` Maxime Devos 0 siblings, 0 replies; 58+ messages in thread From: Maxime Devos @ 2022-05-05 20:36 UTC (permalink / raw) To: Liliana Marie Prikler, Philip McGrath, 55248 [-- Attachment #1: Type: text/plain, Size: 814 bytes --] Liliana Marie Prikler schreef op do 05-05-2022 om 21:52 [+0200]: > > Another scenario that might be worth considering is projects that > > follow the REUSE specification[1], which I don't think would be > > handled by the current install-license-files. > I don't think we can rely on projects consistently following them, > sadly. There's plenty of projects that don't follow REUSE (e.g., Guix itself), and there might be some that have the .reuse/dep5 and LICENSES but aren't doing things 100% according to the spec, but I don't think it matters much to Guix if SPDX-License-Identifier is present in every file and such, given that all Guix has to do here is copy license files, so Guix could be taught to copy .reuse/dep5 and LICENSES (in addition to LICENSE, COPYING, ...). Greetings, Maxime [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --] ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-05 18:53 ` Philip McGrath 2022-05-05 19:52 ` Liliana Marie Prikler @ 2022-05-05 20:33 ` Maxime Devos 2022-05-05 21:55 ` Philip McGrath 1 sibling, 1 reply; 58+ messages in thread From: Maxime Devos @ 2022-05-05 20:33 UTC (permalink / raw) To: Philip McGrath, 55248, Liliana Marie Prikler, Liliana Marie Prikler [-- Attachment #1: Type: text/plain, Size: 498 bytes --] Philip McGrath schreef op do 05-05-2022 om 14:53 [-0400]: > Another scenario that might be worth considering is projects that follow > the REUSE specification[1], which I don't think would be handled by the > current install-license-files. It doesn't copy .reuse/dep5 and LICENSES yet, though that can be implemented: <https://issues.guix.gnu.org/54234#4>. I don't think that helps for this particular package though, given that Racket doesn't ship those files. Greetings, Maxime. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --] ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. 2022-05-05 20:33 ` Maxime Devos @ 2022-05-05 21:55 ` Philip McGrath 0 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-05 21:55 UTC (permalink / raw) To: Maxime Devos, 55248, Liliana Marie Prikler, Liliana Marie Prikler On 5/5/22 16:33, Maxime Devos wrote: > Philip McGrath schreef op do 05-05-2022 om 14:53 [-0400]: >> Another scenario that might be worth considering is projects that follow >> the REUSE specification[1], which I don't think would be handled by the >> current install-license-files. > > It doesn't copy .reuse/dep5 and LICENSES yet, though that can be > implemented: <https://issues.guix.gnu.org/54234#4>. I don't think that > helps for this particular package though, given that Racket doesn't > ship those files. > Right, it wouldn't help Racket, it was just another example of a case not handled by the current implementation. (Though I think it would be much more justifiable to add a special case for REUSE than for Racket.) Glad people are already thinking about it! -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 3/7] gnu: chez-scheme: Update to 9.5.8. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 4/7] gnu: chez-scheme: Refactor documentation phases Philip McGrath ` (4 subsequent siblings) 7 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath * gnu/packages/chez.scm (chez-scheme): Update to 9.5.8. --- gnu/packages/chez.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index a7f75a731a..34545b1f58 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -210,7 +210,7 @@ (define-public chez-scheme (name "chez-scheme") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. - (version "9.5.6") + (version "9.5.8") (source (origin (method git-fetch) (uri (git-reference @@ -218,7 +218,7 @@ (define-public chez-scheme (commit (string-append "v" version)))) (sha256 (base32 - "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) (file-name (git-file-name name version)) (snippet #~(begin (use-modules (guix build utils)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 4/7] gnu: chez-scheme: Refactor documentation phases. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (2 preceding siblings ...) 2022-05-03 18:33 ` [bug#55248] [PATCH 3/7] gnu: chez-scheme: Update to 9.5.8 Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 5/7] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath ` (3 subsequent siblings) 7 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath Patches merged in Racket's variant of Chez Scheme and submitted to the upstream variant will soon let us replace the 'install-docs' phase with just 'make install-docs'. Separating the 'link-doc-pdfs' phase (which won't change) leaves us well-prepared for the transition, regardless of whether Chez Scheme 9.5.10 or Racket 8.6 is released first. * gnu/packages/chez.scm (chez-scheme)[arguments]: Split 'install-doc' phase into 'install-docs' (matching the future 'make' target) and 'link-doc-pdfs'. --- gnu/packages/chez.scm | 64 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 34545b1f58..49051abd17 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -309,35 +309,43 @@ (define-public chez-scheme (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'install-symlink 'install-doc + (add-after 'install-symlink 'install-docs (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (match (assoc-ref outputs "doc") - (#f - (format #t "not installing docs~%")) - (doc-prefix - (let* ((chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))))) + (let* ((doc-prefix (or (assoc-ref outputs "doc") + (assoc-ref outputs "out"))) + (chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (define* (stex-make #:optional (suffix "")) + (invoke "make" "install" + (string-append "Scheme=" scheme) + (string-append "STEXLIB=" stexlib) + (string-append "installdir=" doc-dir suffix))) + (with-directory-excursion "csug" + (stex-make "/csug")) + (with-directory-excursion "release_notes" + (stex-make "/release_notes"))))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf"))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 5/7] gnu: chez-scheme: Refactor configure phase and fix '--threads'. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (3 preceding siblings ...) 2022-05-03 18:33 ` [bug#55248] [PATCH 4/7] gnu: chez-scheme: Refactor documentation phases Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically Philip McGrath ` (2 subsequent siblings) 7 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath Move Chez-specific logic into '#:configure-flags' and a new 'configure-environment-variables' phase, leaving the 'configure' phase as just a variant of the one from 'gnu-build-system' (including support for '#:out-of-source?') that doesn't add implicit Autoconf-style flags. In the process, do the right thing for "--threads", rather than assuming the only nonthreaded platform is broken. * gnu/packages/chez.scm (chez-scheme)[arguments]: Set configure flags in '#:configure-flags' and separate 'configure-environment-variables' from the residual 'configure' phase. More closely follow 'gnu-build-system'. Use 'chez-upstream-features-for-system' for "--threads". (chez-scheme-for-racket)[arguments]<#:configure-flags>: Add "--threads" unconditionally. --- gnu/packages/chez.scm | 63 ++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 49051abd17..785b6837c1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -258,8 +258,18 @@ (define-public chez-scheme (ice-9 ftw) (ice-9 match)) #:test-target "test" - ;; TODO when we fix armhf, it may not support --threads - #:configure-flags #~'("--threads") + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex @@ -273,26 +283,35 @@ (define-public chez-scheme (search-input-directory (or native-inputs inputs) "lib/chez-scheme-bootfiles") "boot"))) - ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; NOTE: The custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. (replace 'configure - (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) - ;; add flags which are always required: - (let ((flags (cons* (string-append "--installprefix=" #$output) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do compress-man-pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke "./configure" flags)))) + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) ;; The binary file name is called "scheme" as is the one from ;; MIT/GNU Scheme. We add a symlink to use in case both are ;; installed. @@ -385,7 +404,9 @@ (define-public chez-scheme-for-racket (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:configure-flags cfg-flags #~'()) - #~(cons "--disable-x11" #$cfg-flags)) + #~(cons* "--disable-x11" + "--threads" ;; ok to potentially duplicate + #$cfg-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) (unpack (assoc-ref those-phases 'unpack))) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (4 preceding siblings ...) 2022-05-03 18:33 ` [bug#55248] [PATCH 5/7] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-04 6:58 ` Liliana Marie Prikler 2022-05-03 18:33 ` [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 7 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine the machine type. --- gnu/packages/chez.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 785b6837c1..ea53cf5774 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -602,6 +602,10 @@ (define-public stex-bootstrap ("src" "lib/stex/") ("Mf-stex" "lib/stex/") ("Makefile.template" "lib/stex/")) + #:modules + '((guix build copy-build-system) + (guix build utils) + (ice-9 popen)) #:phases #~(modify-phases %standard-phases (add-before 'install 'patch-sources @@ -633,8 +637,12 @@ (define-public stex-bootstrap (define makefile (string-append (getcwd) "/Makefile")) (define machine - #$(and=> (nix-system->chez-machine) - chez-machine->threaded)) + (let ((pipe (open-pipe* OPEN_BOTH scheme "-q"))) + (write '(machine-type) pipe) + (force-output pipe) + (let ((sym (read pipe))) + (close-pipe pipe) + (symbol->string sym)))) (with-directory-excursion (search-input-directory outputs "/lib/stex") (invoke "make" -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically. 2022-05-03 18:33 ` [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically Philip McGrath @ 2022-05-04 6:58 ` Liliana Marie Prikler 2022-05-05 19:39 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-04 6:58 UTC (permalink / raw) To: Philip McGrath, 55248 Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: > * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine > the machine type. How is this beneficial? What about cross-compilation? ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically. 2022-05-04 6:58 ` Liliana Marie Prikler @ 2022-05-05 19:39 ` Philip McGrath 0 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-05 19:39 UTC (permalink / raw) To: Liliana Marie Prikler, 55248, Maxime Devos Hi, On 5/4/22 02:58, Liliana Marie Prikler wrote: > Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: >> * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine >> the machine type. > How is this beneficial? At some high level of generality, there are two ways we could determine the machine type:* 1. We could predict ahead of time what it will be; or 2. We can ask the `scheme` executable we actually have. Trying to predict is easy to get wrong, because there's more than one possible machine type for a given system: currently that's true due to "--threads", and it will be even more true with "portable bytecode" back-ends. The `scheme` executable we're compiling with knows the definitive answer. This lets us remove the only use of 'nix-system->chez-machine'. > What about cross-compilation? I remembered this backwards; it should be `(#%$target-machine)` rather than `(machine-type)`. I'll fix that. But note that upstream stex does not support cross-compilation (though I hope to fix that one day). For example, both `Makefile` and `Mf-stex` contain: m := $(shell echo '(machine-type)' | $(Scheme) -q) (* To some extent there's an XY problem here: we don't care about the machine type per se, we care about the extension of intermediate object files we don't want to have installed, analogous to ".o" files. I think [1] upstream may have incidentally fixed the issues that made us build in that odd way, but it hasn't been part of a release yet. I plan to reevaluate before Racket 8.6, when we'll need [2] anyway to fix a bug exposed by Zuo.) -Philip [1]: https://github.com/dybvig/stex/pull/5 [2]: https://github.com/dybvig/stex/pull/6 ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (5 preceding siblings ...) 2022-05-03 18:33 ` [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically Philip McGrath @ 2022-05-03 18:33 ` Philip McGrath 2022-05-04 7:21 ` Liliana Marie Prikler 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 7 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-03 18:33 UTC (permalink / raw) To: 55248; +Cc: Philip McGrath This is a follow-up to commit b8fc9169515ef1a6d6037c84e30ad308e5418b6f: see <https://issues.guix.gnu.org/54292>. Thanks to Liliana Marie Prikler for pointing out various issues, e.g. that being able to represent a Nix system as a Chez Scheme machine type does not necessarily mean the system is supported! Racket's variant of Chez Scheme does or will soon run even on systems for which native code generation is not supported: see discussion at <https://racket.discourse.group/t/950>. This helps us to eliminate unused functions (that may not have been quite right, anyway). * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, %nix-arch-to-chez-alist, %nix-os-to-chez-alist, chez-machine->nix-system, nix-system->chez-machine): Replace with ... (%chez-features-table, target-chez-arch, target-chez-os): ... these new variables. (chez-upstream-features-for-system): Adapt accordingly. (chez-scheme-bootstrap-bootfiles)[supported-systems]: Use enhanced 'chez-upstream-features-for-system'. (chez-scheme-for-system): Likewise, and use 'chez-scheme-for-racket' on systems without native code generation. (racket-cs-native-supported-system?): New variable. (chez-scheme-for-racket)[supported-systems]: Use it. * gnu/packages/racket.scm (racket-vm-for-system): Likewise. --- gnu/packages/chez.scm | 269 +++++++++++++++++++++++----------------- gnu/packages/racket.scm | 7 +- 2 files changed, 159 insertions(+), 117 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index ea53cf5774..a61146eb02 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,9 +48,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system - nix-system->chez-machine - chez-machine->nonthreaded - chez-machine->threaded + racket-cs-native-supported-system? unpack-nanopass+stex)) ;; Commentary: @@ -73,96 +71,17 @@ (define* (chez-scheme-for-system #:optional (%current-system)))) "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, including support for native threads." - (if (or - ;; full support upstream - (and=> (chez-upstream-features-for-system system) - (cut memq 'threads <>)) - ;; no support anywhere - (not (nix-system->chez-machine system))) + (if (and=> (chez-upstream-features-for-system system) + (lambda (features) + (every (cut memq <> features) + '(threads + ;; We can cross-compile for platforms without + ;; bootstrap bootfiles, but we can't self-host + ;; on them short of adding more binary seeds. + bootstrap-bootfiles)))) chez-scheme chez-scheme-for-racket)) -(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 -MACHINE. The returned string may share storage with MACHINE." - ;; Chez Scheme documentation consistently uses "nonthreaded" rather than - ;; e.g. "unthreaded" - (if (eqv? #\t (string-ref machine 0)) - (substring machine 1) - machine)) -(define (chez-machine->threaded machine) - "Like @code{chez-machine->nonthreaded}, but returns the threaded machine -type." - (if (eqv? #\t (string-ref machine 0)) - machine - (string-append "t" machine))) - -;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt -;; in https://github.com/racket/raco-cross. -;; For supported platforms, refer to release_notes/release_notes.stex in the -;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md -;; in https://github.com/racket/racket. -(define %nix-arch-to-chez-alist - `(("x86_64" . "a6") - ("i386" . "i3") - ("aarch64" . "arm64") - ("armhf" . "arm32") ;; Chez supports ARM v6+ - ("ppc" . "ppc32"))) -(define %nix-os-to-chez-alist - `(("w64-mingw32" . "nt") - ("darwin" . "osx") - ("linux" . "le") - ("freebsd" . "fb") - ("openbsd" . "ob") - ("netbsd" . "nb") - ("solaris" . "s2"))) - -(define (chez-machine->nix-system machine) - "Return the Nix system type corresponding to the Chez Scheme machine type -MACHINE. If MACHINE is not a string representing a known machine type, an -exception is raised. This function does not distinguish between threaded and -nonthreaded variants of MACHINE. - -Note that this function only handles Chez Scheme machine types in the -strictest sense, not other kinds of descriptors sometimes used in place of a -Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or -@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type -for the host system is often still relevant.)" - (let ((machine (chez-machine->nonthreaded machine))) - (let find-arch ((alist %nix-arch-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (string-prefix? chez machine) - (string-append - nix "-" (let ((machine-os - (substring machine (string-length chez)))) - (let find-os ((alist %nix-os-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (equal? chez machine-os) - nix - (find-os alist))))))) - (find-arch alist))))))) - -(define* (nix-system->chez-machine #:optional - (system (or (%current-target-system) - (%current-system)))) - "Return the Chez Scheme machine type corresponding to the Nix system -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme -machine type is undefined. - -It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type: when the distinction is relevant, use -@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust -the result." - (let* ((hyphen (string-index system #\-)) - (nix-arch (substring system 0 hyphen)) - (nix-os (substring system (+ 1 hyphen))) - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) - (and chez-arch chez-os (string-append chez-arch chez-os)))) - (define* (chez-upstream-features-for-system #:optional (system (or (%current-target-system) @@ -172,20 +91,150 @@ (define* (chez-upstream-features-for-system #:optional does not support SYSTEM at all. If native threads are supported, the returned list will include -@code{'threads}. Other feature symbols may be added in the future." +@code{'threads}. If bootstrap bootfiles for SYSTEM are distributed in the +upstream Chez Scheme repository, the returned list will include +@code{'bootstrap-bootfiles}. Other feature symbols may be added in the +future." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and=> (assoc-ref %chez-features-table chez-os) + (cut assoc-ref <> chez-arch)))) + +(define* (racket-cs-native-supported-system? #:optional + (system + (or (%current-target-system) + (%current-system)))) + "Can Racket's variant of Chez Scheme generate native code for SYSTEM? +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and (and=> (assoc-ref %chez-features-table chez-os) + ;; NOT assoc-ref: supported even if cdr is #f + (cut assoc chez-arch <>)) + #t))) + +(define %chez-features-table + ;; An alist of alists mapping: + ;; os -> arch -> (or/c #f (listof symbol?)) + ;; where: + ;; - `os` is a string for the OS part of a Chez Scheme machine type; and + ;; - `arch` is a string for the architecture part of a Chez machine type. + ;; + ;; The absence of an entry for a given arch--os pair means that neither + ;; upstream Chez Scheme nor the Racket variant can generate native code for + ;; that system. (The Racket variant can still provide support via its + ;; ``portable bytecode'' backends and optional compilation to C.) A value + ;; of `#f` means that upstream Chez Scheme does not support the arch--os + ;; pair at all, but the Racket variant does. A list has the same meaning as + ;; a result from `chez-upstream-features-for-system`. + ;; + ;; The arch--os pairs marked "commented out" have been commented out in the + ;; STeX source for the upstream release notes since the initial release as + ;; free software, but they are reported to work and/or have been described + ;; as supported by upstream maintainers. + ;; + ;; For this overall approach to make sense, we assume that Racket's variant + ;; of Chez Scheme can generate native code for a superset of the platforms + ;; supported upstream, supports threads on all platforms it supports at all + ;; (because they are needed for Racket), and doesn't need bootstrap + ;; bootfiles. Those assumptions have held for several years. + '(;; Linux + ("le" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm32" bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" threads)) + ;; FreeBSD + ("fb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenBSD + ("ob" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; NetBSD + ("nb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenSolaris / OpenIndiana / Illumos + ("s2" + ("i3" threads) ;; commented out + ("a6" threads)) ;; commented out + ;; Windows + ("nt" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ;; ^ threads "experiemental", but reportedly fine + ("arm64" . #f)) + ;; Darwin + ("osx" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" . #f)))) + +(define* (target-chez-arch #:optional (system + (or (%current-target-system) + (%current-system)))) + "Return a string representing the architecture of SYSTEM as used in Chez +Scheme machine types, or '#f' if none is defined." (cond - ((not (nix-system->chez-machine system)) - #f) + ((target-x86-64? system) + "a6") + ((target-x86-32? system) + "i3") ((target-aarch64? system) - #f) + "arm64") ((target-arm32? system) - (and (target-linux? system) - '())) + "arm32") + ((target-ppc64le? system) + #f) ((target-ppc32? system) - (and (target-linux? system) - '(threads))) + "ppc32") + ((target-riscv64? system) + #f) (else - '(threads)))) + #f))) + +(define* (target-chez-os #:optional (system (or (%current-target-system) + (%current-system)))) + "Return a string representing the operating system kernel of SYSTEM as used +in Chez Scheme machine types, or '#f' if none is defined." + ;; e.g. "le" includes both GNU/Linux and Android + (cond + ((target-linux? system) + "le") + ((target-hurd? system) + #f) + ((target-mingw? system) + "nt") + ;; missing (guix utils) predicates + ;; cf. https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix + ((string-suffix? "-darwin" system) + "osx") + ((string-suffix? "-freebsd" system) + "fb") + ((string-suffix? "-openbsd" system) + "ob") + ((string-suffix? "-netbsd" system) + "nb") + ;; Nix says "x86_64-solaris", but accommodate "-solaris2" + ((string-contains system "solaris") + "s2") + ;; unknown + (else + #f))) + ;; ;; Chez Scheme: @@ -365,14 +414,9 @@ (define-public chez-scheme ((pth) (symlink pth "csug.pdf"))))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. (supported-systems (delete - "armhf-linux" ;; <-- should work, but reportedly broken + "armhf-linux" ;; XXX is this still broken? (filter chez-upstream-features-for-system %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") @@ -418,7 +462,9 @@ (define-public chez-scheme-for-racket (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) - (supported-systems (filter nix-system->chez-machine + ;; TODO: How to build pbarch/pbchunks for other systems? + ;; See https://racket.discourse.group/t/950 + (supported-systems (filter racket-cs-native-supported-system? %supported-systems)) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, @@ -471,16 +517,9 @@ (define-public chez-scheme-bootstrap-bootfiles (list #:install-plan #~`(("boot/" "lib/chez-scheme-bootfiles")))) (supported-systems - ;; Upstream only distributes pre-built bootfiles for - ;; arm32le and t?(i3|a6)(le|nt|osx) (filter (lambda (system) - (let ((machine (and=> (nix-system->chez-machine system) - chez-machine->nonthreaded))) - (or (equal? "arm32le" machine) - (and machine - (member (substring machine 0 2) '("i3" "a6")) - (or-map (cut string-suffix? <> machine) - '("le" "nt" "osx")))))) + (and=> (chez-upstream-features-for-system system) + (cut memq 'bootstrap-bootfiles <>))) %supported-systems)) (synopsis "Chez Scheme bootfiles (binary seed)") (description diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 2f4f7cebd8..41f45f4215 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -190,8 +190,11 @@ (define-module (gnu packages racket) (define* (racket-vm-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." - (if (nix-system->chez-machine system) + "Return 'racket-vm-cs' we are able to build it for SYSTEM; 'racket-vm-bc' +otherwise." + ;; Once we figure out the issues in https://racket.discourse.group/t/950, + ;; we can use 'racket-vm-cs' everywhere. + (if (racket-cs-native-supported-system? system) racket-vm-cs racket-vm-bc)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic. 2022-05-03 18:33 ` [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic Philip McGrath @ 2022-05-04 7:21 ` Liliana Marie Prikler 2022-05-05 20:42 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-04 7:21 UTC (permalink / raw) To: Philip McGrath, 55248 Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: > This is a follow-up to commit > b8fc9169515ef1a6d6037c84e30ad308e5418b6f: > see <https://issues.guix.gnu.org/54292>. Thanks to Liliana Marie > Prikler for pointing out various issues, e.g. that being able to > represent a Nix system as a Chez Scheme machine type does not > necessarily mean the system is supported! The issue in that commit is a different one: nix-system->chez-machine can fail if there's no conversion. Anyway... > [...] > ;; Commentary: > @@ -73,96 +71,17 @@ (define* (chez-scheme-for-system #:optional > (%current-system)))) > "Return 'chez-scheme' unless only 'chez-scheme-for-racket' > supports SYSTEM, > including support for native threads." > - (if (or > - ;; full support upstream > - (and=> (chez-upstream-features-for-system system) > - (cut memq 'threads <>)) > - ;; no support anywhere > - (not (nix-system->chez-machine system))) > + (if (and=> (chez-upstream-features-for-system system) > + (lambda (features) > + (every (cut memq <> features) > + '(threads > + ;; We can cross-compile for platforms > without > + ;; bootstrap bootfiles, but we can't self- > host > + ;; on them short of adding more binary > seeds. > + bootstrap-bootfiles)))) > chez-scheme > chez-scheme-for-racket)) Does it make sense to require 'threads always? > > -(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 > -MACHINE. The returned string may share storage with MACHINE." > - ;; Chez Scheme documentation consistently uses "nonthreaded" > rather than > - ;; e.g. "unthreaded" > - (if (eqv? #\t (string-ref machine 0)) > - (substring machine 1) > - machine)) > -(define (chez-machine->threaded machine) > - "Like @code{chez-machine->nonthreaded}, but returns the threaded > machine > -type." > - (if (eqv? #\t (string-ref machine 0)) > - machine > - (string-append "t" machine))) > - > -;; Based on the implementation from raco-cross- > lib/private/cross/platform.rkt > -;; in https://github.com/racket/raco-cross. > -;; For supported platforms, refer to > release_notes/release_notes.stex in the > -;; upstream Chez Scheme repository or to > racket/src/ChezScheme/README.md > -;; in https://github.com/racket/racket. > -(define %nix-arch-to-chez-alist > - `(("x86_64" . "a6") > - ("i386" . "i3") > - ("aarch64" . "arm64") > - ("armhf" . "arm32") ;; Chez supports ARM v6+ > - ("ppc" . "ppc32"))) > -(define %nix-os-to-chez-alist > - `(("w64-mingw32" . "nt") > - ("darwin" . "osx") > - ("linux" . "le") > - ("freebsd" . "fb") > - ("openbsd" . "ob") > - ("netbsd" . "nb") > - ("solaris" . "s2"))) > - > -(define (chez-machine->nix-system machine) > - "Return the Nix system type corresponding to the Chez Scheme > machine type > -MACHINE. If MACHINE is not a string representing a known machine > type, an > -exception is raised. This function does not distinguish between > threaded and > -nonthreaded variants of MACHINE. > - > -Note that this function only handles Chez Scheme machine types in > the > -strictest sense, not other kinds of descriptors sometimes used in > place of a > -Chez Scheme machine type by Racket, such as @code{\"pb\"}, > @code{#f}, or > -@code{\"racket\"}. (When using such extensions, the Chez Scheme > machine type > -for the host system is often still relevant.)" > - (let ((machine (chez-machine->nonthreaded machine))) > - (let find-arch ((alist %nix-arch-to-chez-alist)) > - (match alist > - (((nix . chez) . alist) > - (if (string-prefix? chez machine) > - (string-append > - nix "-" (let ((machine-os > - (substring machine (string-length > chez)))) > - (let find-os ((alist %nix-os-to-chez-alist)) > - (match alist > - (((nix . chez) . alist) > - (if (equal? chez machine-os) > - nix > - (find-os alist))))))) > - (find-arch alist))))))) > - > -(define* (nix-system->chez-machine #:optional > - (system (or (%current-target- > system) > - (%current-system)))) > - "Return the Chez Scheme machine type corresponding to the Nix > system > -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a > Chez Scheme > -machine type is undefined. > - > -It is unspecified whether the resulting string will name a threaded > or a > -nonthreaded machine type: when the distinction is relevant, use > -@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to > adjust > -the result." > - (let* ((hyphen (string-index system #\-)) > - (nix-arch (substring system 0 hyphen)) > - (nix-os (substring system (+ 1 hyphen))) > - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) > - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) > - (and chez-arch chez-os (string-append chez-arch chez-os)))) > - The replacement code should go here for readability imho. At the very least I was confused why this was first above and now below. > (define* (chez-upstream-features-for-system #:optional > (system > (or (%current-target- > system) > @@ -172,20 +91,150 @@ (define* (chez-upstream-features-for-system > #:optional > does not support SYSTEM at all. > > If native threads are supported, the returned list will include > -@code{'threads}. Other feature symbols may be added in the future." > +@code{'threads}. If bootstrap bootfiles for SYSTEM are distributed > in the > +upstream Chez Scheme repository, the returned list will include > +@code{'bootstrap-bootfiles}. Other feature symbols may be added in > the > +future." > + (let ((chez-arch (target-chez-arch system)) > + (chez-os (target-chez-os system))) > + (and=> (assoc-ref %chez-features-table chez-os) > + (cut assoc-ref <> chez-arch)))) > + > +(define* (racket-cs-native-supported-system? #:optional > + (system > + (or (%current-target- > system) > + (%current- > system)))) > + "Can Racket's variant of Chez Scheme generate native code for > SYSTEM? > +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." > + (let ((chez-arch (target-chez-arch system)) > + (chez-os (target-chez-os system))) > + (and (and=> (assoc-ref %chez-features-table chez-os) > + ;; NOT assoc-ref: supported even if cdr is #f > + (cut assoc chez-arch <>)) > + #t))) > + > +(define %chez-features-table > + ;; An alist of alists mapping: > + ;; os -> arch -> (or/c #f (listof symbol?)) > + ;; where: > + ;; - `os` is a string for the OS part of a Chez Scheme machine > type; and > + ;; - `arch` is a string for the architecture part of a Chez > machine type. > + ;; > + ;; The absence of an entry for a given arch--os pair means that > neither > + ;; upstream Chez Scheme nor the Racket variant can generate native > code for > + ;; that system. (The Racket variant can still provide support via > its > + ;; ``portable bytecode'' backends and optional compilation to C.) > A value > + ;; of `#f` means that upstream Chez Scheme does not support the > arch--os > + ;; pair at all, but the Racket variant does. A list has the same > meaning as > + ;; a result from `chez-upstream-features-for-system`. > + ;; > + ;; The arch--os pairs marked "commented out" have been commented > out in the > + ;; STeX source for the upstream release notes since the initial > release as > + ;; free software, but they are reported to work and/or have been > described > + ;; as supported by upstream maintainers. > + ;; > + ;; For this overall approach to make sense, we assume that > Racket's variant > + ;; of Chez Scheme can generate native code for a superset of the > platforms > + ;; supported upstream, supports threads on all platforms it > supports at all > + ;; (because they are needed for Racket), and doesn't need > bootstrap > + ;; bootfiles. Those assumptions have held for several years. > + '(;; Linux > + ("le" > + ("i3" threads bootstrap-bootfiles) > + ("a6" threads bootstrap-bootfiles) > + ("arm32" bootstrap-bootfiles) > + ("arm64" . #f) > + ("ppc32" threads)) > + ;; FreeBSD > + ("fb" > + ("i3" threads) ;; commented out > + ("a6" threads) ;; commented out > + ("arm32" . #f) > + ("arm64" . #f) > + ("ppc32" . #f)) > + ;; OpenBSD > + ("ob" > + ("i3" threads) ;; commented out > + ("a6" threads) ;; commented out > + ("arm32" . #f) > + ("arm64" . #f) > + ("ppc32" . #f)) > + ;; NetBSD > + ("nb" > + ("i3" threads) ;; commented out > + ("a6" threads) ;; commented out > + ("arm32" . #f) > + ("arm64" . #f) > + ("ppc32" . #f)) > + ;; OpenSolaris / OpenIndiana / Illumos > + ("s2" > + ("i3" threads) ;; commented out > + ("a6" threads)) ;; commented out > + ;; Windows > + ("nt" > + ("i3" threads bootstrap-bootfiles) > + ("a6" threads bootstrap-bootfiles) > + ;; ^ threads "experiemental", but reportedly fine > + ("arm64" . #f)) > + ;; Darwin > + ("osx" > + ("i3" threads bootstrap-bootfiles) > + ("a6" threads bootstrap-bootfiles) > + ("arm64" . #f) > + ("ppc32" . #f)))) > + > +(define* (target-chez-arch #:optional (system > + (or (%current-target-system) > + (%current-system)))) > + "Return a string representing the architecture of SYSTEM as used > in Chez > +Scheme machine types, or '#f' if none is defined." > (cond > - ((not (nix-system->chez-machine system)) > - #f) > + ((target-x86-64? system) > + "a6") > + ((target-x86-32? system) > + "i3") > ((target-aarch64? system) > - #f) > + "arm64") > ((target-arm32? system) > - (and (target-linux? system) > - '())) > + "arm32") > + ((target-ppc64le? system) > + #f) > ((target-ppc32? system) > - (and (target-linux? system) > - '(threads))) > + "ppc32") > + ((target-riscv64? system) > + #f) > (else > - '(threads)))) > + #f))) > + > +(define* (target-chez-os #:optional (system (or (%current-target- > system) > + (%current-system)))) > + "Return a string representing the operating system kernel of > SYSTEM as used > +in Chez Scheme machine types, or '#f' if none is defined." > + ;; e.g. "le" includes both GNU/Linux and Android > + (cond > + ((target-linux? system) > + "le") > + ((target-hurd? system) > + #f) > + ((target-mingw? system) > + "nt") > + ;; missing (guix utils) predicates > + ;; cf. > https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix > + ((string-suffix? "-darwin" system) > + "osx") > + ((string-suffix? "-freebsd" system) > + "fb") > + ((string-suffix? "-openbsd" system) > + "ob") > + ((string-suffix? "-netbsd" system) > + "nb") > + ;; Nix says "x86_64-solaris", but accommodate "-solaris2" > + ((string-contains system "solaris") > + "s2") > + ;; unknown > + (else > + #f))) > + For the sake of completeness, we might want to still have nix-system- >chez-machine (with a threaded? argument) defined in terms of target- chez-arch and target-chez-os. See 6/7 for motivation. > > ;; > ;; Chez Scheme: > @@ -365,14 +414,9 @@ (define-public chez-scheme > ((pth) > (symlink pth > "csug.pdf"))))))))) > - ;; Chez Scheme does not have a MIPS backend. > - ;; FIXME: Debian backports patches to get armhf working. > - ;; We should too. It is the Chez machine type arm32le > - ;; (no threaded version upstream yet, though there is in > - ;; Racket's fork), more specifically (per the release notes) > ARMv6. > (supported-systems > (delete > - "armhf-linux" ;; <-- should work, but reportedly broken > + "armhf-linux" ;; XXX is this still broken? I'd say "XXX: reportedly broken, needs checking" > (filter chez-upstream-features-for-system > %supported-systems))) > (home-page "https://cisco.github.io/ChezScheme/") > @@ -418,7 +462,9 @@ (define-public chez-scheme-for-racket > (add-after 'unpack 'chdir > (lambda args > (chdir "racket/src/ChezScheme")))))))) > - (supported-systems (filter nix-system->chez-machine > + ;; TODO: How to build pbarch/pbchunks for other systems? > + ;; See https://racket.discourse.group/t/950 > + (supported-systems (filter racket-cs-native-supported-system? > %supported-systems)) > (home-page "https://github.com/racket/ChezScheme") > ;; ^ This is downstream of https://github.com/racket/racket, > @@ -471,16 +517,9 @@ (define-public chez-scheme-bootstrap-bootfiles > (list #:install-plan > #~`(("boot/" "lib/chez-scheme-bootfiles")))) > (supported-systems > - ;; Upstream only distributes pre-built bootfiles for > - ;; arm32le and t?(i3|a6)(le|nt|osx) > (filter (lambda (system) > - (let ((machine (and=> (nix-system->chez-machine > system) > - chez-machine->nonthreaded))) > - (or (equal? "arm32le" machine) > - (and machine > - (member (substring machine 0 2) '("i3" > "a6")) > - (or-map (cut string-suffix? <> machine) > - '("le" "nt" "osx")))))) > + (and=> (chez-upstream-features-for-system system) > + (cut memq 'bootstrap-bootfiles <>))) Yup, that's simpler. > %supported-systems)) > (synopsis "Chez Scheme bootfiles (binary seed)") > (description > diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm > index 2f4f7cebd8..41f45f4215 100644 > --- a/gnu/packages/racket.scm > +++ b/gnu/packages/racket.scm > @@ -190,8 +190,11 @@ (define-module (gnu packages racket) > (define* (racket-vm-for-system #:optional > (system (or (%current-target-system) > (%current-system)))) > - "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' > otherwise." > - (if (nix-system->chez-machine system) > + "Return 'racket-vm-cs' we are able to build it for SYSTEM; > 'racket-vm-bc' > +otherwise." > + ;; Once we figure out the issues in > https://racket.discourse.group/t/950, > + ;; we can use 'racket-vm-cs' everywhere. > + (if (racket-cs-native-supported-system? system) > racket-vm-cs > racket-vm-bc)) All in all, the individual logic of this patch seems fine, but overall it appears as though it's doing three separate things (chez-scheme-for- system, chez features, racket-cs stuff). IMO it would make sense to split this patch according to those lines. WDYT? Patches 2-5 mostly LGTM, at least I don't see any glaring issues in this iteration. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic. 2022-05-04 7:21 ` Liliana Marie Prikler @ 2022-05-05 20:42 ` Philip McGrath 2022-05-06 7:08 ` Liliana Marie Prikler 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-05 20:42 UTC (permalink / raw) To: Liliana Marie Prikler, 55248, Maxime Devos Hi, On 5/4/22 03:21, Liliana Marie Prikler wrote: > Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: >> This is a follow-up to commit >> b8fc9169515ef1a6d6037c84e30ad308e5418b6f: >> see <https://issues.guix.gnu.org/54292>. Thanks to Liliana Marie >> Prikler for pointing out various issues, e.g. that being able to >> represent a Nix system as a Chez Scheme machine type does not >> necessarily mean the system is supported! > The issue in that commit is a different one: nix-system->chez-machine > can fail if there's no conversion. Anyway... > The issue fixed in the commit is different, but this issue hadn't occurred to me until you wrote in <https://issues.guix.gnu.org/54292#6>: > I pushed that definition upstream, but a rewrite is still needed. I > also think this logic should be a little decoupled from the question of > whether or not a given nix-system is supported. While surely this > function returning #f means it's not, there are still other questions > to consider. >> [...] >> ;; Commentary: >> @@ -73,96 +71,17 @@ (define* (chez-scheme-for-system #:optional >> (%current-system)))) >> "Return 'chez-scheme' unless only 'chez-scheme-for-racket' >> supports SYSTEM, >> including support for native threads." >> - (if (or >> - ;; full support upstream >> - (and=> (chez-upstream-features-for-system system) >> - (cut memq 'threads <>)) >> - ;; no support anywhere >> - (not (nix-system->chez-machine system))) >> + (if (and=> (chez-upstream-features-for-system system) >> + (lambda (features) >> + (every (cut memq <> features) >> + '(threads >> + ;; We can cross-compile for platforms >> without >> + ;; bootstrap bootfiles, but we can't self- >> host >> + ;; on them short of adding more binary >> seeds. >> + bootstrap-bootfiles)))) >> chez-scheme >> chez-scheme-for-racket)) > Does it make sense to require 'threads always? > I guess there are a few notions of "always". In 'chez-scheme-for-racket', yes, because Racket CS needs thread support for "futures" and "places". (Racket BC had a notion of platforms where those features were not available, but AFAIK there isn't support for a non-threaded configuration of Racket CS.) For 'chez-scheme', every distribution I'm aware of packages the threaded version (only) on platforms where thread support is available. The only reason to use the nonthreaded version is if you know for sure that your application doesn't use threads---IIRC, that may even include any FFI libraries not using threads internally---AND the small performance gain from not implementing thread safety internally makes a difference. For 'chez-scheme-for-system', I don't have a strong view, but the fact that I think the benefits of thread support are significant makes me lean that way. Concretely, the answer to this question only affects armhf-linux, so I think we should not change this at least until we re-enable it in upstream Chez's 'supported-system'. >> -(define* (nix-system->chez-machine #:optional >> - (system (or (%current-target- >> system) >> - (%current-system)))) >> - "Return the Chez Scheme machine type corresponding to the Nix >> system >> -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a >> Chez Scheme >> -machine type is undefined. >> - >> -It is unspecified whether the resulting string will name a threaded >> or a >> -nonthreaded machine type: when the distinction is relevant, use >> -@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to >> adjust >> -the result." >> - (let* ((hyphen (string-index system #\-)) >> - (nix-arch (substring system 0 hyphen)) >> - (nix-os (substring system (+ 1 hyphen))) >> - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) >> - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) >> - (and chez-arch chez-os (string-append chez-arch chez-os)))) >> - > The replacement code should go here for readability imho. At the very > least I was confused why this was first above and now below. > Happy to move things. Specifically, do you want 'target-chez-arch' and 'target-chez-os' (and '%chez-features-table'?) before 'chez-upstream-features-for-system' and 'racket-cs-native-supported-system?'? >> + > For the sake of completeness, we might want to still have nix-system- >> chez-machine (with a threaded? argument) defined in terms of target- > chez-arch and target-chez-os. See 6/7 for motivation. > Eventually, I imagine we will want to have a function like 'nix-system->chez-machine', but I think it would be better to wait until we have a concrete use-case. In particular, what I'd written here: >> -Note that this function only handles Chez Scheme machine types in >> the >> -strictest sense, not other kinds of descriptors sometimes used in >> place of a >> -Chez Scheme machine type by Racket, such as @code{\"pb\"}, >> @code{#f}, or >> -@code{\"racket\"}. (When using such extensions, the Chez Scheme >> machine type >> -for the host system is often still relevant.)" is no longer necessarily true, thanks to the improvements in the "portable bytecode" backends. >> >> ;; >> ;; Chez Scheme: >> @@ -365,14 +414,9 @@ (define-public chez-scheme >> ((pth) >> (symlink pth >> "csug.pdf"))))))))) >> - ;; Chez Scheme does not have a MIPS backend. >> - ;; FIXME: Debian backports patches to get armhf working. >> - ;; We should too. It is the Chez machine type arm32le >> - ;; (no threaded version upstream yet, though there is in >> - ;; Racket's fork), more specifically (per the release notes) >> ARMv6. >> (supported-systems >> (delete >> - "armhf-linux" ;; <-- should work, but reportedly broken >> + "armhf-linux" ;; XXX is this still broken? > I'd say "XXX: reportedly broken, needs checking" That seems better, particularly given e.g. <https://github.com/cisco/ChezScheme/issues/622#issuecomment-1110290004>: > > it is likely musl-related since I assume that arm32le is well tested > in conjunction with glibc > > That's probably not the best assumption... arm32le is not tested in > GitHub automation, and the last work that I know for sure was done on > it was for a project that is now defunct. I'm sure it was working and > tested at some point, but bit rot may have set in. > > All in all, the individual logic of this patch seems fine, but overall > it appears as though it's doing three separate things (chez-scheme-for- > system, chez features, racket-cs stuff). IMO it would make sense to > split this patch according to those lines. WDYT? > I don't think I'm picturing what you have in mind. The way I've been thinking of this patch is replacing the Chez features and machine type functions based on '%chez-features-table', then updating other things accordingly. I guess there is a distinguishable change to the behavior of 'chez-scheme-for-system' for systems with no native-code backed. I could separate that, if you want. On the other hand, it continues to return a package that can't actually be built for the specified system, so the change seems mostly theoretical. In terms of "racket-cs stuff", 'racket-cs-native-supported-system?' seemed better than any name I could come up with based on 'chez-scheme-for-racket', but the answer is based only on Racket's variant of Chez scheme. The old version based on 'nix-system->chez-machine' was just wrong (it would falsely claim to support e.g. "powerpc-w64-mingw32"), and we didn't have a way to implement a correct function until adding the information in '%chez-features-table'. -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic. 2022-05-05 20:42 ` Philip McGrath @ 2022-05-06 7:08 ` Liliana Marie Prikler 2022-05-07 19:18 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-06 7:08 UTC (permalink / raw) To: Philip McGrath, 55248, Maxime Devos Am Donnerstag, dem 05.05.2022 um 16:42 -0400 schrieb Philip McGrath: > Hi, > > On 5/4/22 03:21, Liliana Marie Prikler wrote: > > Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: > > > > > This is a follow-up to commit > > > b8fc9169515ef1a6d6037c84e30ad308e5418b6f: > > > see <https://issues.guix.gnu.org/54292>. Thanks to Liliana Marie > > > Prikler for pointing out various issues, e.g. that being able to > > > represent a Nix system as a Chez Scheme machine type does not > > > necessarily mean the system is supported! > > The issue in that commit is a different one: nix-system->chez-machine > > can fail if there's no conversion. Anyway... > > > > The issue fixed in the commit is different, but this issue hadn't > occurred to me until you wrote in > <https://issues.guix.gnu.org/54292#6>: > > > I pushed that definition upstream, but a rewrite is still needed. I > > also think this logic should be a little decoupled from the > > question of whether or not a given nix-system is supported. While > > surely this function returning #f means it's not, there are still > > other questions to consider. Ahh, in that case the commit message is pointing people to the wrong location. I think this needs to be communicated more clearly, e.g. "This commit is a follow-up to b8fc9169515ef1a6d6037c84e30ad308e5418b6f. While that commit did fix a breaking build, this one addresses the assumptions that lead to the failure, see also <https://issues.guix.gnu.org/54292#6>." Thereafter go on to describe what's actually done. > > > [...] > > > ;; Commentary: > > > @@ -73,96 +71,17 @@ (define* (chez-scheme-for-system #:optional > > > (%current- > > > system)))) > > > "Return 'chez-scheme' unless only 'chez-scheme-for-racket' > > > supports SYSTEM, > > > including support for native threads." > > > - (if (or > > > - ;; full support upstream > > > - (and=> (chez-upstream-features-for-system system) > > > - (cut memq 'threads <>)) > > > - ;; no support anywhere > > > - (not (nix-system->chez-machine system))) > > > + (if (and=> (chez-upstream-features-for-system system) > > > + (lambda (features) > > > + (every (cut memq <> features) > > > + '(threads > > > + ;; We can cross-compile for platforms > > > without > > > + ;; bootstrap bootfiles, but we can't > > > self- > > > host > > > + ;; on them short of adding more binary > > > seeds. > > > + bootstrap-bootfiles)))) > > > chez-scheme > > > chez-scheme-for-racket)) > > Does it make sense to require 'threads always? > > > > I guess there are a few notions of "always". > > In 'chez-scheme-for-racket', yes, because Racket CS needs thread > support for "futures" and "places". (Racket BC had a notion of > platforms where those features were not available, but AFAIK there > isn't support for a non-threaded configuration of Racket CS.) > > For 'chez-scheme', every distribution I'm aware of packages the > threaded version (only) on platforms where thread support is > available. The only reason to use the nonthreaded version is if you > know for sure that your application doesn't use threads---IIRC, that > may even include any FFI libraries not using threads internally---AND > the small performance gain from not implementing thread safety > internally makes a difference. > > For 'chez-scheme-for-system', I don't have a strong view, but the > fact that I think the benefits of thread support are significant > makes me lean that way. Concretely, the answer to this question only > affects armhf-linux, so I think we should not change this at least > until we re-enable it in upstream Chez's 'supported-system'. In other words, there aren't that many uses of Chez scheme in embedded spaces, so we might as well always require threads? > > > -(define* (nix-system->chez-machine #:optional > > > - (system (or (%current-target- > > > system) > > > - (%current- > > > system)))) > > > - "Return the Chez Scheme machine type corresponding to the Nix > > > system > > > -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to > > > a > > > Chez Scheme > > > -machine type is undefined. > > > - > > > -It is unspecified whether the resulting string will name a > > > threaded > > > or a > > > -nonthreaded machine type: when the distinction is relevant, use > > > -@code{chez-machine->nonthreaded} or @code{chez-machine- > > > >threaded} to > > > adjust > > > -the result." > > > - (let* ((hyphen (string-index system #\-)) > > > - (nix-arch (substring system 0 hyphen)) > > > - (nix-os (substring system (+ 1 hyphen))) > > > - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix- > > > arch)) > > > - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) > > > - (and chez-arch chez-os (string-append chez-arch chez-os)))) > > > - > > The replacement code should go here for readability imho. At the > > very least I was confused why this was first above and now below. > > > > Happy to move things. Specifically, do you want 'target-chez-arch' > and 'target-chez-os' (and '%chez-features-table'?) before > 'chez-upstream-features-for-system' and > 'racket-cs-native-supported-system?'? This is my personal bias coming from a C background, but I read source files top to bottom with helper procedures at the top and the main thing at the bottom. If you look closely, much of Guix also follows that pattern. For instance, build systems have their phases declared at the bottom, "guix build" expects the last line to evaluate to a package, and so on. > > > + > > For the sake of completeness, we might want to still have nix- > > system- > > > chez-machine (with a threaded? argument) defined in terms of > > > target- > > chez-arch and target-chez-os. See 6/7 for motivation. > > > > Eventually, I imagine we will want to have a function like > 'nix-system->chez-machine', but I think it would be better to wait > until we have a concrete use-case. In particular, what I'd written > here: > > >> -Note that this function only handles Chez Scheme machine types > in > >> the > >> -strictest sense, not other kinds of descriptors sometimes used > in > >> place of a > >> -Chez Scheme machine type by Racket, such as @code{\"pb\"}, > >> @code{#f}, or > >> -@code{\"racket\"}. (When using such extensions, the Chez Scheme > >> machine type > >> -for the host system is often still relevant.)" > > is no longer necessarily true, thanks to the improvements in the > "portable bytecode" backends. In other words, nix-system->chez-scheme would get an extra #:features argument, which would be a sequence of 'threads and 'portable-bytecode, no? This question also has relevance w.r.t. 6/7 and potentially a chez-build-system, where this machine-type could actually be a discriminating factor. > > > [...] > > All in all, the individual logic of this patch seems fine, but > > overall it appears as though it's doing three separate things > > (chez-scheme-for-system, chez features, racket-cs stuff). IMO it > > would make sense to split this patch according to those lines. > > WDYT? > > > > I don't think I'm picturing what you have in mind. > > The way I've been thinking of this patch is replacing the Chez > features and machine type functions based on '%chez-features-table', > then updating other things accordingly. Sure, but if we retain nix-system->chez-machine as a function, I think we can make a cut here and proceed with the second patch thereafter. > I guess there is a distinguishable change to the behavior of > 'chez-scheme-for-system' for systems with no native-code backed. I > could separate that, if you want. On the other hand, it continues to > return a package that can't actually be built for the specified > system, so the change seems mostly theoretical. This should be the second patch imo. Regardless of theoreticness in value, I think the change itself is one that deserves its own commit message. It would also be easier to review and reason about later that way. > In terms of "racket-cs stuff", 'racket-cs-native-supported-system?' > seemed better than any name I could come up with based on > 'chez-scheme-for-racket', but the answer is based only on Racket's > variant of Chez scheme. The old version based on > 'nix-system->chez-machine' was just wrong (it would falsely claim to > support e.g. "powerpc-w64-mingw32"), and we didn't have a way to > implement a correct function until adding the information in > '%chez-features-table'. This would be the third patch according to my initial suggestion. That way, racket-cs-native-supported-system? would remain wrong for patch 7/9, but be corrected in patch 9/9, which imo would more clearly communicate that it was previously wrong. WDYT? ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic. 2022-05-06 7:08 ` Liliana Marie Prikler @ 2022-05-07 19:18 ` Philip McGrath 0 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-07 19:18 UTC (permalink / raw) To: Liliana Marie Prikler, 55248, Maxime Devos Hi, On 5/6/22 03:08, Liliana Marie Prikler wrote: > Am Donnerstag, dem 05.05.2022 um 16:42 -0400 schrieb Philip McGrath: >> Hi, >> >> On 5/4/22 03:21, Liliana Marie Prikler wrote: >>> Am Dienstag, dem 03.05.2022 um 14:33 -0400 schrieb Philip McGrath: >>> >>>> This is a follow-up to commit >>>> b8fc9169515ef1a6d6037c84e30ad308e5418b6f: >>>> see <https://issues.guix.gnu.org/54292>. Thanks to Liliana Marie >>>> Prikler for pointing out various issues, e.g. that being able to >>>> represent a Nix system as a Chez Scheme machine type does not >>>> necessarily mean the system is supported! >>> The issue in that commit is a different one: nix-system->chez-machine >>> can fail if there's no conversion. Anyway... >>> >> >> The issue fixed in the commit is different, but this issue hadn't >> occurred to me until you wrote in >> <https://issues.guix.gnu.org/54292#6>: >> >>> I pushed that definition upstream, but a rewrite is still needed. I >>> also think this logic should be a little decoupled from the >>> question of whether or not a given nix-system is supported. While >>> surely this function returning #f means it's not, there are still >>> other questions to consider. > Ahh, in that case the commit message is pointing people to the wrong > location. I think this needs to be communicated more clearly, e.g. > > "This commit is a follow-up to > b8fc9169515ef1a6d6037c84e30ad308e5418b6f. While that commit did fix a > breaking build, this one addresses the assumptions that lead to the > failure, see also <https://issues.guix.gnu.org/54292#6>." > > Thereafter go on to describe what's actually done. > Yes, that seems better. (I was trying to focus the summary on user-facing functions, rather than replaced internals, but I think it can be better.) > >>>> [...] >>>> ;; Commentary: >>>> @@ -73,96 +71,17 @@ (define* (chez-scheme-for-system #:optional >>>> (%current- >>>> system)))) >>>> "Return 'chez-scheme' unless only 'chez-scheme-for-racket' >>>> supports SYSTEM, >>>> including support for native threads." >>>> - (if (or >>>> - ;; full support upstream >>>> - (and=> (chez-upstream-features-for-system system) >>>> - (cut memq 'threads <>)) >>>> - ;; no support anywhere >>>> - (not (nix-system->chez-machine system))) >>>> + (if (and=> (chez-upstream-features-for-system system) >>>> + (lambda (features) >>>> + (every (cut memq <> features) >>>> + '(threads >>>> + ;; We can cross-compile for platforms >>>> without >>>> + ;; bootstrap bootfiles, but we can't >>>> self- >>>> host >>>> + ;; on them short of adding more binary >>>> seeds. >>>> + bootstrap-bootfiles)))) >>>> chez-scheme >>>> chez-scheme-for-racket)) >>> Does it make sense to require 'threads always? >>> >> >> I guess there are a few notions of "always". >> >> In 'chez-scheme-for-racket', yes, because Racket CS needs thread >> support for "futures" and "places". (Racket BC had a notion of >> platforms where those features were not available, but AFAIK there >> isn't support for a non-threaded configuration of Racket CS.) >> >> For 'chez-scheme', every distribution I'm aware of packages the >> threaded version (only) on platforms where thread support is >> available. The only reason to use the nonthreaded version is if you >> know for sure that your application doesn't use threads---IIRC, that >> may even include any FFI libraries not using threads internally---AND >> the small performance gain from not implementing thread safety >> internally makes a difference. >> >> For 'chez-scheme-for-system', I don't have a strong view, but the >> fact that I think the benefits of thread support are significant >> makes me lean that way. Concretely, the answer to this question only >> affects armhf-linux, so I think we should not change this at least >> until we re-enable it in upstream Chez's 'supported-system'. > In other words, there aren't that many uses of Chez scheme in embedded > spaces, so we might as well always require threads? > At least, I think it's a sufficiently niche use-case that its reasonable for those users to use a package transformation (and check that it works for all of the libraries they use) while allowing general Chez code to assume threads are available, since they are well supported overall. (I have heard stories about embedded Chez, e.g. to control a Disney World virtual reality ride.[1] But I'm not aware of any free software Chez projects that don't work with threads.) >>>> -(define* (nix-system->chez-machine #:optional >>>> - (system (or (%current-target- >>>> system) >>>> - (%current- >>>> system)))) >>>> - "Return the Chez Scheme machine type corresponding to the Nix >>>> system >>>> -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to >>>> a >>>> Chez Scheme >>>> -machine type is undefined. >>>> - >>>> -It is unspecified whether the resulting string will name a >>>> threaded >>>> or a >>>> -nonthreaded machine type: when the distinction is relevant, use >>>> -@code{chez-machine->nonthreaded} or @code{chez-machine- >>>>> threaded} to >>>> adjust >>>> -the result." >>>> - (let* ((hyphen (string-index system #\-)) >>>> - (nix-arch (substring system 0 hyphen)) >>>> - (nix-os (substring system (+ 1 hyphen))) >>>> - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix- >>>> arch)) >>>> - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) >>>> - (and chez-arch chez-os (string-append chez-arch chez-os)))) >>>> - >>> The replacement code should go here for readability imho. At the >>> very least I was confused why this was first above and now below. >>> >> >> Happy to move things. Specifically, do you want 'target-chez-arch' >> and 'target-chez-os' (and '%chez-features-table'?) before >> 'chez-upstream-features-for-system' and >> 'racket-cs-native-supported-system?'? > This is my personal bias coming from a C background, but I read source > files top to bottom with helper procedures at the top and the main > thing at the bottom. If you look closely, much of Guix also follows > that pattern. For instance, build systems have their phases declared > at the bottom, "guix build" expects the last line to evaluate to a > package, and so on. > My personal preference vacillates between defining helpers before using them and putting high-level or public definitions above internal utilities. >>>> + >>> For the sake of completeness, we might want to still have nix- >>> system- >>>> chez-machine (with a threaded? argument) defined in terms of >>>> target- >>> chez-arch and target-chez-os. See 6/7 for motivation. >>> >> >> Eventually, I imagine we will want to have a function like >> 'nix-system->chez-machine', but I think it would be better to wait >> until we have a concrete use-case. In particular, what I'd written >> here: >> >> >> -Note that this function only handles Chez Scheme machine types >> in >> >> the >> >> -strictest sense, not other kinds of descriptors sometimes used >> in >> >> place of a >> >> -Chez Scheme machine type by Racket, such as @code{\"pb\"}, >> >> @code{#f}, or >> >> -@code{\"racket\"}. (When using such extensions, the Chez Scheme >> >> machine type >> >> -for the host system is often still relevant.)" >> >> is no longer necessarily true, thanks to the improvements in the >> "portable bytecode" backends. > In other words, nix-system->chez-scheme would get an extra #:features > argument, which would be a sequence of 'threads and 'portable-bytecode, > no? This question also has relevance w.r.t. 6/7 and potentially a > chez-build-system, where this machine-type could actually be a > discriminating factor. > It may end up being more complex than that, depending on how many of the underlying options we want to expose via Guix. For example, there is "pb" for a fully machine-independent bytecode, but e.g. "tpb64l" for a specialized bytecode for 64-bit little-endian machines with threads. I also don't yet understand when, if ever, we might want to supply a native machine type (if one is defined) in addition to a pb-based machine types. The uncertainty is why I'd rather avoid nix-system->chez-machine until we actually need it. >>> >> [...] >>> All in all, the individual logic of this patch seems fine, but >>> overall it appears as though it's doing three separate things >>> (chez-scheme-for-system, chez features, racket-cs stuff). IMO it >>> would make sense to split this patch according to those lines. >>> WDYT? >>> >> >> I don't think I'm picturing what you have in mind. >> >> The way I've been thinking of this patch is replacing the Chez >> features and machine type functions based on '%chez-features-table', >> then updating other things accordingly. > Sure, but if we retain nix-system->chez-machine as a function, I think > we can make a cut here and proceed with the second patch thereafter. > I don't think we should retain nix-system->chez-machine beyond this series, but I guess we can delay removing it to split here. >> I guess there is a distinguishable change to the behavior of >> 'chez-scheme-for-system' for systems with no native-code backed. I >> could separate that, if you want. On the other hand, it continues to >> return a package that can't actually be built for the specified >> system, so the change seems mostly theoretical. > This should be the second patch imo. Regardless of theoreticness in > value, I think the change itself is one that deserves its own commit > message. It would also be easier to review and reason about later that > way. > This is the part that makes the most sense to me to put in its own commit. >> In terms of "racket-cs stuff", 'racket-cs-native-supported-system?' >> seemed better than any name I could come up with based on >> 'chez-scheme-for-racket', but the answer is based only on Racket's >> variant of Chez scheme. The old version based on >> 'nix-system->chez-machine' was just wrong (it would falsely claim to >> support e.g. "powerpc-w64-mingw32"), and we didn't have a way to >> implement a correct function until adding the information in >> '%chez-features-table'. > This would be the third patch according to my initial suggestion. That > way, racket-cs-native-supported-system? would remain wrong for patch > 7/9, but be corrected in patch 9/9, which imo would more clearly > communicate that it was previously wrong. > > WDYT? I will try to come up with a v2 more or less along these lines. -Philip [1]: https://groups.google.com/g/comp.lang.scheme/c/Xud6nGrF0Ss/m/BaJDopHMYYAJ ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (6 preceding siblings ...) 2022-05-03 18:33 ` [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 1/9] gnu: racket: Update to 8.5 Philip McGrath ` (8 more replies) 7 siblings, 9 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Hi, Here is v2! The workaround for install-license-files with an out-of-source build did turn out to still be needed: I've added a comment explaining. As requested, I split the final patch into three parts. I hope the organization makes sense. -Philip Philip McGrath (9): gnu: racket: Update to 8.5. gnu: racket: Fix out-of-source build. gnu: chez-scheme: Update to 9.5.8. gnu: chez-scheme: Refactor documentation phases. gnu: chez-scheme: Refactor configure phase and fix '--threads'. gnu: stex: Get machine type dynamically. gnu: chez-upstream-features-for-system: Improve implementation. gnu: chez-scheme-for-racket: Fix supported systems. gnu: chez-scheme-for-system: Adjust for bytecode backend. gnu/local.mk | 2 - gnu/packages/chez.scm | 426 +++++++++------- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 107 ++-- 5 files changed, 302 insertions(+), 724 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch base-commit: 668313e07fa2518fe02704b047237c173f63c6d4 -- 2.32.0 ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 1/9] gnu: racket: Update to 8.5. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build Philip McGrath ` (7 subsequent siblings) 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, gnu/packages/patches/racket-enable-scheme-backport.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. * gnu/packages/racket.scm (%racket-version): Update to 8.5. (%racket-origin)[patches]: Remove obsolete patches. (racket-vm-common-configure-flags): Correct comment. (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, scribble, typed-racket, string-constants, syntax-color, web-server, xrepl>: Update checksums. <gui, srfi>: Likewise, and remove obsolete backports. --- gnu/local.mk | 2 - gnu/packages/chez.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 82 ++- 5 files changed, 32 insertions(+), 547 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index bc9f976a39..d593aecfc2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1757,8 +1757,6 @@ 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-enable-scheme-backport.patch \ - %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index d47225dbe5..a7f75a731a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot> -;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com> +;;; Copyright © 2021, 2022 Philip McGrath <philip@philipmcgrath.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -361,7 +361,7 @@ (define-public chez-scheme-for-racket (package (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.5.7.3") + (version "9.5.7.6") ;; 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! diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch deleted file mode 100644 index 3a5a4a3d82..0000000000 --- a/gnu/packages/patches/racket-enable-scheme-backport.patch +++ /dev/null @@ -1,465 +0,0 @@ -From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 10:36:09 -0700 -Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` - -(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) - -(Fixed conflicts by dropping pbchunks and pbarch changes.) ---- - racket/src/ChezScheme/configure | 15 ++++++++++++++- - racket/src/ChezScheme/s/Mf-base | 4 ++-- - racket/src/ChezScheme/s/Mf-cross | 4 +++- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure -index 4515ffc105..0098829091 100755 ---- a/racket/src/ChezScheme/configure -+++ b/racket/src/ChezScheme/configure -@@ -45,6 +45,7 @@ threads=yes - nothreads=no - temproot="" - help=no -+forceworkarea=no - gzipmanpages=yes - installowner="" - installgroup="" -@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do - --pb) - pb=yes - ;; -+ --force) -+ forceworkarea=yes -+ ;; - --installprefix=*) - installprefix=`echo $1 | sed -e 's/^--installprefix=//'` - ;; -@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then - echo " --toolprefix=<prefix> prefix tool (compiler, linker, ...) names" - echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" - echo " --workarea=<pathname> build directory ($w)" -+ echo " --force configure even without boot files" - echo " CC=<C compiler> C compiler" - echo " CPPFLAGS=<C preprocessor flags> C preprocessor flags" - echo " CFLAGS=<C compiler flags> C compiler flags" -@@ -721,8 +726,16 @@ case "${flagsmuni}" in - ;; - esac - -+if [ "$w" = "$m" ] ; then -+ configuringin="" -+else -+ configuringin=" in $w" -+fi -+ - if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then -- echo "Configuring for $m" -+ echo "Configuring for $m$configuringin" -+elif [ "$forceworkarea" = yes ] ; then -+ echo "Configuring for $m$configuringin despite missing boot files" - else - if [ "$m" = "" ] ; then - maybem="<machine type>" -diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base -index cc6178c973..1f4a967998 100644 ---- a/racket/src/ChezScheme/s/Mf-base -+++ b/racket/src/ChezScheme/s/Mf-base -@@ -94,7 +94,7 @@ endif - # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme - # implementation - Scheme = ../bin/$m/scheme${ExeSuffix} --export SCHEMEHEAPDIRS=../boot/%m -+export SCHEMEHEAPDIRS=../boot/$m - export CHEZSCHEMELIBDIRS=. - - # Define the libdirs separator character -@@ -691,4 +691,4 @@ reset-one: - - .PHONY: run - run: -- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) -+ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) -diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross -index d796cbb459..397af59a28 100644 ---- a/racket/src/ChezScheme/s/Mf-cross -+++ b/racket/src/ChezScheme/s/Mf-cross -@@ -43,5 +43,7 @@ x$(xm).$(m): - $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch - mv xpatch x$(xm).$(m) - -+ifneq ($(SCHEMEHEAPDIRS),:) - # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed --nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+endif --- -2.32.0 - - -From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 11:03:30 -0700 -Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable - -When the same Chez Scheme version as used by Racket is already -available, then `--enable-scheme=...` can supply an executable. For -cross builds, `--enable-scheme=...` can still supply a build -directory, instead, as before. - -(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) ---- - racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ - racket/src/README.txt | 30 +++++++++++--- - racket/src/configure | 8 +++- - racket/src/cs/README.txt | 6 ++- - racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- - racket/src/cs/c/configure | 24 +++++++++-- - racket/src/cs/c/configure.ac | 21 ++++++++-- - 7 files changed, 112 insertions(+), 24 deletions(-) - -diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in -index c396efc851..3998ef9ccd 100644 ---- a/racket/src/ChezScheme/makefiles/Makefile.in -+++ b/racket/src/ChezScheme/makefiles/Makefile.in -@@ -59,6 +59,9 @@ reset: - %.boot: - (cd $(workarea) && $(MAKE) $*.boot) - -+auto.boot: -+ (cd $(workarea) && $(MAKE) $(defaultm).boot) -+ - # <machine>.bootquick to build boot files for <machine> - # with o=3 d=0 for the cross compiler, and only after - # building the kernel for the configured machine -diff --git a/racket/src/README.txt b/racket/src/README.txt -index 98647aebce..d77310b4a4 100644 ---- a/racket/src/README.txt -+++ b/racket/src/README.txt -@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of - ======================================================================== - - Cross-compilation requires at least two flags to `configure`: -+`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) -+`--enable-scheme-SCHEME`. -+ -+More information: - - * `--host=OS`, where OS is something like `i386-gnu-linux` to - indicate the target platform. -@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: - run `configure` again (with no arguments) in a "local" subdirectory - to create a build for the current platform. - --An additional flag is needed for building Racket CS, unless the flag --`--enable-racket=auto` is used: -- -- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" -- directory where Chez Scheme is built for the host system. -+ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable -+ executable that runs on the build platform; the executable must be -+ the same version as used in Racket built for the target platform. -+ -+ Supplying `--enable-scheme=DIR` is also supported in cross-build -+ mode, where DIR is a path that has a "ChezScheme" directory where -+ Chez Scheme is built for the host system. -+ -+The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are -+allowed for non-cross builds, too: -+ -+ * For Racket CS, supplying either selects a Racket or Chez Scheme -+ implementation used to create boot files to the build platform. -+ Suppling Chez Scheme is a much more direct path, but when Racket is -+ supplied, its version does not have to match the version being -+ built. -+ -+ * For Racket BC, `--enable-racket=RACKET` selects a Racket for -+ prepare C sources to cooperate with garbage collection. Its version -+ needs to be close to the one being built, and potentially exactly -+ the same version. - - Some less commonly needed `configure` flags are for Racket BC: - -diff --git a/racket/src/configure b/racket/src/configure -index c9f3ba4419..1b53ec7ce2 100755 ---- a/racket/src/configure -+++ b/racket/src/configure -@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" - use_cs=maybe - use_bc=maybe - supplied_racket=no -+supplied_scheme=no - enable_boothelp= - - # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, -@@ -34,6 +35,9 @@ for arg in $*; do - --enable-racket=*) - supplied_racket=yes - ;; -+ --enable-scheme=*) -+ supplied_scheme=yes -+ ;; - --help | -h) - echo $0: - echo see --help-bc or --help-cs, since the Racket CS build and the -@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then - fi - - if test "$use_cs" = "yes" ; then -- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then -- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly -+ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then -+ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly - exit 1 - fi - -diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt -index 2ece417b78..8e6fc57b74 100644 ---- a/racket/src/cs/README.txt -+++ b/racket/src/cs/README.txt -@@ -39,6 +39,11 @@ build: - installed in the "../ChezScheme/boot/pb" directory as described by - "../ChezScheme/BUILDING". - -+ Supplying `--enable-scheme=...` is also an option if you alerady -+ have the same version of Chez Scheme built on the current platform. -+ Another build will be created, anyway, but more quickly than -+ without Chez Scheme. -+ - * Racket is needed to generate the files in the "schemified" - directory from the sources in sibling directories like "../io". The - Racket version must be practically the same as the current Racket -@@ -48,7 +53,6 @@ build: - Unlike Chez Scheme boot files, the files generated in "schemified" - are human-readable and -editable Scheme code. That provides a way - out of bootstrapping black holes, even without BC. -- - - - ======================================================================== -diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in -index 54a644a1d9..d73993f0fc 100644 ---- a/racket/src/cs/c/Makefile.in -+++ b/racket/src/cs/c/Makefile.in -@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ - SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) - SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme - SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) --SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_existing = @MAKE_SCHEME_SCHEME@ -+SCHEME = $(SCHEME@USE_SCHEME_MODE@) - - TARGET_MACH = @TARGET_MACH@ - SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) -@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. - @INCLUDEDEP@ @srcdir@/../../version/version.mak - - cs: -- $(MAKE) scheme@T_CROSS_MODE@ -+ $(MAKE) scheme@MAKE_SCHEME_MODE@ - $(MAKE) racket-so - cd rktio; $(MAKE) - $(MAKE) racketcs -@@ -121,9 +123,13 @@ racket-so: - - RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ - -+TARGET_MACH_built = $(TARGET_MACH) -+TARGET_MACH_existing = xc-$(TARGET_MACH) -+XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch -+ - CS_PROGS = SCHEME="$(SCHEME)" - CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ --CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" -+CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" - PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" - - build-racket-so: -@@ -163,6 +169,15 @@ pb-bootquick: - cd $(SCHEME_WORKAREA) && $(MAKE) reset - $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) - -+scheme-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot -+ $(MAKE) mach-make -+ -+$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: -+ mkdir -p $(SCHEME_WORKAREA) -+ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" -+ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all -+ - mach-make: - $(MAKE) config-scheme - cd $(SCHEME_WORKAREA) && $(MAKE) -@@ -182,24 +197,33 @@ config-scheme: - - scheme-cross: - env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt -+ $(MAKE) finish-scheme-cross -+ -+finish-scheme-cross: - $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) - cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t -- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+ $(MAKE) $(XPATCH_FILE) -+ -+scheme-cross-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) -+ $(MAKE) finish-scheme-cross - - # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older --# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files --XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+# than the build-<host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files -+XPATCH_DEPS_built = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -+ $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+XPATCH_DEPS_existing = -+XPATCH_DEPS = $(XPATCH_DEPS@USE_SCHEME_MODE@) - --$(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch: $(XPATCH_DEPS) -+$(XPATCH_FILE): $(XPATCH_DEPS) - $(MAKE) bounce TARGET=build-xpatch-using-host - - build-xpatch-using-host: - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/s && $(MAKE) -f Mf-cross m=$(MACH) xm=$(TARGET_MACH) Scheme="$(SCHEME_BIN)" SCHEMEHEAPDIRS="$(SCHEME_INC)" - - XPATCH = --XPATCHcross = --xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+XPATCHcross = --xpatch $(XPATCH_FILE) - - racket.boot: racket.so - $(SCHEME) --script $(srcdir)/convert-to-boot.ss @BOOT_COMPRESS_COMP@ $(XPATCH@CROSS_MODE@) racket.so racket.boot $(TARGET_MACH) -@@ -410,7 +434,7 @@ install-cross: - $(MAKE) compile-xpatch.$(TARGET_MACH) - $(MAKE) library-xpatch.$(TARGET_MACH) - --SCHEME_XPATCH = $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+SCHEME_XPATCH = $(XPATCH_FILE) - - CROSS_SERVE_DEPS = $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss \ - $(srcdir)/../expander/env.ss $(srcdir)/../linklet/config.ss -diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure -index 21695a431a..1eeef57753 100755 ---- a/racket/src/cs/c/configure -+++ b/racket/src/cs/c/configure -@@ -654,6 +654,9 @@ MINGW - NOT_OSX - OSX - SETUP_BOOT_MODE -+USE_SCHEME_MODE -+MAKE_SCHEME_SCHEME -+MAKE_SCHEME_MODE - TT_CROSS_MODE - T_CROSS_MODE - CROSS_MODE -@@ -1448,7 +1451,7 @@ Optional Features: - --enable-docs build docs on install (enabled by default) - --enable-usersetup setup user-specific files on install - --enable-racket=<path> use <path> as Racket for build; or "auto" to create -- --enable-scheme=<path> use <path> as host's build directory for cross -+ --enable-scheme=<path> use <path> as host build for cross - --enable-mach=<mach> use Chez Scheme machine type <mach> - --enable-target=<mach> cross-build for Chez Scheme machine type <mach> - --enable-portable prefer portable to host-specific -@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" - show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' - - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - show_explicitly_enabled "${enable_portable}" "portable" -@@ -4745,9 +4748,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags - - - -+ -+ -+ - - - -diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac -index 464ebe1760..aaee88156d 100644 ---- a/racket/src/cs/c/configure.ac -+++ b/racket/src/cs/c/configure.ac -@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev - AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) - m4_include(../ac/path_arg.m4) - AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket for build; or "auto" to create]) --AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host's build directory for cross]) -+AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host build for cross]) - AC_ARG_ENABLE(mach, [ --enable-mach=<mach> use Chez Scheme machine type <mach>]) - AC_ARG_ENABLE(target, [ --enable-target=<mach> cross-build for Chez Scheme machine type <mach>]) - m4_include(../ac/portable_arg.m4) -@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" - show_explicitly_enabled "${enable_xonx}" "Unix style" - m4_include(../ac/path_show.m4) - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - m4_include(../ac/portable_show.m4) -@@ -504,9 +504,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) - AC_SUBST(CROSS_MODE) - AC_SUBST(T_CROSS_MODE) - AC_SUBST(TT_CROSS_MODE) -+AC_SUBST(MAKE_SCHEME_MODE) -+AC_SUBST(MAKE_SCHEME_SCHEME) -+AC_SUBST(USE_SCHEME_MODE) - AC_SUBST(SETUP_BOOT_MODE) - AC_SUBST(OSX) - AC_SUBST(NOT_OSX) --- -2.32.0 - diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch deleted file mode 100644 index 1e018eaa79..0000000000 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Mon, 31 Jan 2022 15:31:22 -0700 -Subject: [PATCH] fix creation of tethered launchers - -Related to racket/racket#4133 - -(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) ---- - gui-lib/mred/installer.rkt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt -index b1691472..9ef06c53 100644 ---- a/gui-lib/mred/installer.rkt -+++ b/gui-lib/mred/installer.rkt -@@ -72,4 +72,5 @@ - (list "-A" (path->string (find-system-path 'addon-dir))))) - - (define (config-flags) -- (list "-G" (path->string (find-config-dir)))) -+ (list "-X" (path->string (find-collects-dir)) -+ "-G" (path->string (find-config-dir)))) --- -2.32.0 - diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 471a11dd48..7d51707156 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -195,7 +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! +(define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -205,11 +205,9 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch" - ;; Remove by Racket 8.5: - "racket-enable-scheme-backport.patch")) + (patches (search-patches "racket-minimal-sh-via-rktio.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -248,8 +246,10 @@ (define (racket-vm-common-configure-flags) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) "--disable-strip" - ;; XXX: origtree layout is required by some other packages down the - ;; bootstrap chain. Remove these flags as soon as we can do without them. + ;; Using --enable-origtree lets us distinguish the VM from subsequent + ;; layers and produces a build with the shape expected by tools such as + ;; "distro-build" and "raco-cross". Removing these flags would require + ;; changes, especially to 'configure-layer.rkt' (defined below). "--enable-origtree" ,(string-append "--prefix=" #$output "/opt/racket-vm"))) @@ -589,7 +589,7 @@ (define-public racket racket-minimal ;; <-- TODO non-tethered layer (racket-vm-for-system) (simple-racket-origin - "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + "2d" (base32 "0fb5v6058ls08xw3zbmqyr2ym0psm119gl9ffgmhm9w8rs9i4dq7") '("2d" "2d-doc" "2d-lib")) (simple-racket-origin "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") @@ -622,22 +622,22 @@ (define-public racket "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin - "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") '(("datalog" "."))) (simple-racket-origin "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + "deinprogramm" (base32 "0g8flr1qg3bcyhdinqhs4w7dyisaqyailbxrjgd2a7zlqmdyicfr") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") '("distributed-places" "distributed-places-doc" "distributed-places-lib")) (simple-racket-origin - "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + "draw" (base32 "1fpk85rs2crd63bxnmwj2pysisd62pxcqaip01si67dv1ri8ff92") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + "drracket" (base32 "0dipnz92c63zxys9z1kl5215rm7arc35g9r8bs8ivp96p75mljnz") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -657,7 +657,7 @@ (define-public racket "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") '("errortrace" "errortrace-doc" "errortrace-lib")) (simple-racket-origin - "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + "expeditor" (base32 "0mjfwb4wzwsg5xj3k6cmik0va432n56rp5h7rxx1c2yy3prh1j7q") '("expeditor" "expeditor-doc" "expeditor-lib")) (simple-racket-origin "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") @@ -670,25 +670,14 @@ (define-public racket (simple-racket-origin "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") '(("games" "."))) - (racket-packages-origin - "gui" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/gui") - (commit %racket-commit))) - (sha256 (base32 - "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (file-name (git-file-name "racket-gui" %racket-version))) + (simple-racket-origin + "gui" (base32 "0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + "htdp" (base32 "199qchdq6db6m2n4j861hiy4nxd6hg1qva16lhhdbfj274qmcplg") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -756,7 +745,7 @@ (define-public racket "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + "pict" (base32 "0v7a3l77swsbh80mnb9rakdwgw7s66ji0mall7qcqfwyg1b4zmlv") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -771,7 +760,7 @@ (define-public racket "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") '("planet" "planet-doc" "planet-lib")) (simple-racket-origin - "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + "plot" (base32 "04871pspbm0q3bz5896sa3jw2rp9i6jf0b5aivrxfp56vxxd2ybb") '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) (simple-racket-origin "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") @@ -786,7 +775,7 @@ (define-public racket (url "https://github.com/Metaxal/quickscript") (commit %racket-commit))) (sha256 (base32 - "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + "00sf5nw09aacd0l4a4cknnffvcs95p596im3blsdvfz5ck6jdwl8")) (file-name (git-file-name "Metaxal-quickscript" %racket-version))) '(("quickscript" "."))) (simple-racket-origin @@ -807,10 +796,10 @@ (define-public racket (git-file-name "jeapostrophe-racket-cheat" %racket-version))) '(("racket-cheat" "."))) (simple-racket-origin - "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + "racklog" (base32 "0fbq0fpfb3l6h7h772dvkmlzlk2dnq5f8296xx1qxhhwypibqzr9") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + "rackunit" (base32 "0vfwcddzrgrdv5awjka7m0jzqhqvfc5wlkih83a670y96496a83n") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -826,7 +815,7 @@ (define-public racket "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + "redex" (base32 "0a1fl5s80k3j3xh3lri8886ql443m7pmgv18y7whzlmsd7x8rdpr") '("redex" "redex-benchmark" "redex-doc" @@ -841,7 +830,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + "scribble" (base32 "0fbb7xgz95y90247hfc1a19v7ry8m6blvv4y8irdgzhjvik70zb3") '("scribble" "scribble-doc" "scribble-html-lib" @@ -873,35 +862,24 @@ (define-public racket "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + "typed-racket" (base32 "05xlyjrx3m8xrrrw1xmfb1807qa5aqfl0zp9bdxwh2z7cfxaii09") '("source-syntax" "typed-racket" "typed-racket-compatibility" "typed-racket-doc" "typed-racket-lib" "typed-racket-more")) - (racket-packages-origin - "srfi" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/srfi") - ;; Includes an FSDG fix: return to %racket-commit in 8.5. - ;; See <https://github.com/racket/srfi/pull/15>. - (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) - (sha256 (base32 - "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) - ;; Use the relevant version for srfi-doc and srfi-lib, - ;; since we're using a newer commit than the v8.4 tag. - (file-name (git-file-name "racket-srfi" "1.1"))) + (simple-racket-origin + "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + "string-constants" (base32 "1rjs0gyw9hsiglwxnimz272v9xj1gwjxrnzh4qbsxkvdaphvi38m") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") '(("swindle" "."))) (simple-racket-origin - "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + "syntax-color" (base32 "1xf3rl8687c1nar4kkgkvyncwi0gl696rif0iqhffg730fk457gi") '("syntax-color" "syntax-color-doc" "syntax-color-lib")) (simple-racket-origin "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") @@ -910,13 +888,13 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + "web-server" (base32 "1g4x79ym3mgxv4f3z3z84j12355pf44pjlzlb7f0h6r0i7p0cbjd") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") '("wxme" "wxme-lib")) (simple-racket-origin - "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + "xrepl" (base32 "19svg0jfs656bld5ikqipz3a5szk5k02zq5fh43209qw527dnfbk") '("xrepl" "xrepl-doc" "xrepl-lib")))) (build-system gnu-build-system) (arguments -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 1/9] gnu: racket: Update to 8.5 Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-09 3:54 ` Liliana Marie Prikler 2022-05-08 20:07 ` [bug#55248] [PATCH v2 3/9] gnu: chez-scheme: Update " Philip McGrath ` (6 subsequent siblings) 8 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/racket.scm (racket-vm-cgc)[arguments]: Add phase 'symlink-license-src' to work around limitation in 'install-license-files'. Supply '#:out-of-source? #t'. --- gnu/packages/racket.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 7d51707156..904dfe9bef 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -276,8 +276,9 @@ (define-public racket-vm-cgc ;; main-distribution-test that aren't part of the main ;; distribution. #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. + ;; Upstream recommends #:out-of-source?, and it + ;; helps a lot with debugging. + #:out-of-source? #t #:modules '((ice-9 match) (ice-9 regex) (guix build gnu-build-system) @@ -314,7 +315,18 @@ (define-public racket-vm-cgc #f))))))) (add-before 'configure 'chdir (lambda _ - (chdir "racket/src")))))) + (chdir "racket/src"))) + (add-after 'chdir 'symlink-license-src + ;; Work around limitation of install-license-files by symlinking + ;; srcdir where it expects. (It doesn't handle this variant of + ;; #:out-of-source? and a subdirectory for srcdir.) Just running + ;; `make install` only puts them in Racket's 'share-dir'. + (lambda* (#:key out-of-source? #:allow-other-keys) + (when out-of-source? + (with-directory-excursion ".." + (symlink "src" + (package-name->name+version + (strip-store-file-name #$output)))))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build Philip McGrath @ 2022-05-09 3:54 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-09 3:54 UTC (permalink / raw) To: Philip McGrath, 55248; +Cc: Maxime Devos Hi Philip, Correct me if I'm wrong, but I think you didn't quite get the point I raised w.r.t. install-license-files. Instead of Am Sonntag, dem 08.05.2022 um 16:07 -0400 schrieb Philip McGrath: > + (add-after 'chdir 'symlink-license-src > + ;; Work around limitation of install-license-files by > symlinking > + ;; srcdir where it expects. (It doesn't handle this > variant of > + ;; #:out-of-source? and a subdirectory for srcdir.) > Just running > + ;; `make install` only puts them in Racket's 'share- > dir'. > + (lambda* (#:key out-of-source? #:allow-other-keys) > + (when out-of-source? > + (with-directory-excursion ".." > + (symlink "src" > + (package-name->name+version > + (strip-store-file-name > #$output)))))))))) you could (replace 'install-license-files (lambda args (with-directory-excursion ".." ; perhaps "../src" if needed (apply (assoc-ref %standard-phases 'install-license-files) args)))) If that doesn't work, you could fake an "in-source" build by appending "#:out-of-source? #f" to args. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. 2022-05-09 3:54 ` Liliana Marie Prikler @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 1/9] gnu: racket: Update to 8.5 Philip McGrath ` (10 more replies) 0 siblings, 11 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Hi, On 5/8/22 23:54, Liliana Marie Prikler wrote: > Hi Philip, > > Correct me if I'm wrong, but I think you didn't quite get the point I > raised w.r.t. install-license-files. Instead of > > Am Sonntag, dem 08.05.2022 um 16:07 -0400 schrieb Philip McGrath: >> + (add-after 'chdir 'symlink-license-src >> + ;; Work around limitation of install-license-files by >> symlinking >> + ;; srcdir where it expects. (It doesn't handle this >> variant of >> + ;; #:out-of-source? and a subdirectory for srcdir.) >> Just running >> + ;; `make install` only puts them in Racket's 'share- >> dir'. >> + (lambda* (#:key out-of-source? #:allow-other-keys) >> + (when out-of-source? >> + (with-directory-excursion ".." >> + (symlink "src" >> + (package-name->name+version >> + (strip-store-file-name >> #$output)))))))))) > you could > > (replace 'install-license-files > (lambda args > (with-directory-excursion ".." ; perhaps "../src" if needed > (apply (assoc-ref %standard-phases 'install-license-files) > args)))) > > If that doesn't work, you could fake an "in-source" build by appending > "#:out-of-source? #f" to args. > Yes, a variant of that works. I can't say I see the benefit, personally, but here's a v3 if you prefer it. -Philip Philip McGrath (9): gnu: racket: Update to 8.5. gnu: racket: Fix out-of-source build. gnu: chez-scheme: Update to 9.5.8. gnu: chez-scheme: Refactor documentation phases. gnu: chez-scheme: Refactor configure phase and fix '--threads'. gnu: stex: Get machine type dynamically. gnu: chez-upstream-features-for-system: Improve implementation. gnu: chez-scheme-for-racket: Fix supported systems. gnu: chez-scheme-for-system: Adjust for bytecode backend. gnu/local.mk | 2 - gnu/packages/chez.scm | 426 +++++++++------- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 107 ++-- 5 files changed, 302 insertions(+), 724 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch base-commit: 668313e07fa2518fe02704b047237c173f63c6d4 -- 2.32.0 ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 1/9] gnu: racket: Update to 8.5. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 2/9] gnu: racket: Fix out-of-source build Philip McGrath ` (9 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, gnu/packages/patches/racket-enable-scheme-backport.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. * gnu/packages/racket.scm (%racket-version): Update to 8.5. (%racket-origin)[patches]: Remove obsolete patches. (racket-vm-common-configure-flags): Correct comment. (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, scribble, typed-racket, string-constants, syntax-color, web-server, xrepl>: Update checksums. <gui, srfi>: Likewise, and remove obsolete backports. --- gnu/local.mk | 2 - gnu/packages/chez.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 82 ++- 5 files changed, 32 insertions(+), 547 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index bc9f976a39..d593aecfc2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1757,8 +1757,6 @@ 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-enable-scheme-backport.patch \ - %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index d47225dbe5..a7f75a731a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot> -;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com> +;;; Copyright © 2021, 2022 Philip McGrath <philip@philipmcgrath.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -361,7 +361,7 @@ (define-public chez-scheme-for-racket (package (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.5.7.3") + (version "9.5.7.6") ;; 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! diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch deleted file mode 100644 index 3a5a4a3d82..0000000000 --- a/gnu/packages/patches/racket-enable-scheme-backport.patch +++ /dev/null @@ -1,465 +0,0 @@ -From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 10:36:09 -0700 -Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` - -(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) - -(Fixed conflicts by dropping pbchunks and pbarch changes.) ---- - racket/src/ChezScheme/configure | 15 ++++++++++++++- - racket/src/ChezScheme/s/Mf-base | 4 ++-- - racket/src/ChezScheme/s/Mf-cross | 4 +++- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure -index 4515ffc105..0098829091 100755 ---- a/racket/src/ChezScheme/configure -+++ b/racket/src/ChezScheme/configure -@@ -45,6 +45,7 @@ threads=yes - nothreads=no - temproot="" - help=no -+forceworkarea=no - gzipmanpages=yes - installowner="" - installgroup="" -@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do - --pb) - pb=yes - ;; -+ --force) -+ forceworkarea=yes -+ ;; - --installprefix=*) - installprefix=`echo $1 | sed -e 's/^--installprefix=//'` - ;; -@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then - echo " --toolprefix=<prefix> prefix tool (compiler, linker, ...) names" - echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" - echo " --workarea=<pathname> build directory ($w)" -+ echo " --force configure even without boot files" - echo " CC=<C compiler> C compiler" - echo " CPPFLAGS=<C preprocessor flags> C preprocessor flags" - echo " CFLAGS=<C compiler flags> C compiler flags" -@@ -721,8 +726,16 @@ case "${flagsmuni}" in - ;; - esac - -+if [ "$w" = "$m" ] ; then -+ configuringin="" -+else -+ configuringin=" in $w" -+fi -+ - if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then -- echo "Configuring for $m" -+ echo "Configuring for $m$configuringin" -+elif [ "$forceworkarea" = yes ] ; then -+ echo "Configuring for $m$configuringin despite missing boot files" - else - if [ "$m" = "" ] ; then - maybem="<machine type>" -diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base -index cc6178c973..1f4a967998 100644 ---- a/racket/src/ChezScheme/s/Mf-base -+++ b/racket/src/ChezScheme/s/Mf-base -@@ -94,7 +94,7 @@ endif - # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme - # implementation - Scheme = ../bin/$m/scheme${ExeSuffix} --export SCHEMEHEAPDIRS=../boot/%m -+export SCHEMEHEAPDIRS=../boot/$m - export CHEZSCHEMELIBDIRS=. - - # Define the libdirs separator character -@@ -691,4 +691,4 @@ reset-one: - - .PHONY: run - run: -- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) -+ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) -diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross -index d796cbb459..397af59a28 100644 ---- a/racket/src/ChezScheme/s/Mf-cross -+++ b/racket/src/ChezScheme/s/Mf-cross -@@ -43,5 +43,7 @@ x$(xm).$(m): - $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch - mv xpatch x$(xm).$(m) - -+ifneq ($(SCHEMEHEAPDIRS),:) - # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed --nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+endif --- -2.32.0 - - -From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 11:03:30 -0700 -Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable - -When the same Chez Scheme version as used by Racket is already -available, then `--enable-scheme=...` can supply an executable. For -cross builds, `--enable-scheme=...` can still supply a build -directory, instead, as before. - -(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) ---- - racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ - racket/src/README.txt | 30 +++++++++++--- - racket/src/configure | 8 +++- - racket/src/cs/README.txt | 6 ++- - racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- - racket/src/cs/c/configure | 24 +++++++++-- - racket/src/cs/c/configure.ac | 21 ++++++++-- - 7 files changed, 112 insertions(+), 24 deletions(-) - -diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in -index c396efc851..3998ef9ccd 100644 ---- a/racket/src/ChezScheme/makefiles/Makefile.in -+++ b/racket/src/ChezScheme/makefiles/Makefile.in -@@ -59,6 +59,9 @@ reset: - %.boot: - (cd $(workarea) && $(MAKE) $*.boot) - -+auto.boot: -+ (cd $(workarea) && $(MAKE) $(defaultm).boot) -+ - # <machine>.bootquick to build boot files for <machine> - # with o=3 d=0 for the cross compiler, and only after - # building the kernel for the configured machine -diff --git a/racket/src/README.txt b/racket/src/README.txt -index 98647aebce..d77310b4a4 100644 ---- a/racket/src/README.txt -+++ b/racket/src/README.txt -@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of - ======================================================================== - - Cross-compilation requires at least two flags to `configure`: -+`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) -+`--enable-scheme-SCHEME`. -+ -+More information: - - * `--host=OS`, where OS is something like `i386-gnu-linux` to - indicate the target platform. -@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: - run `configure` again (with no arguments) in a "local" subdirectory - to create a build for the current platform. - --An additional flag is needed for building Racket CS, unless the flag --`--enable-racket=auto` is used: -- -- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" -- directory where Chez Scheme is built for the host system. -+ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable -+ executable that runs on the build platform; the executable must be -+ the same version as used in Racket built for the target platform. -+ -+ Supplying `--enable-scheme=DIR` is also supported in cross-build -+ mode, where DIR is a path that has a "ChezScheme" directory where -+ Chez Scheme is built for the host system. -+ -+The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are -+allowed for non-cross builds, too: -+ -+ * For Racket CS, supplying either selects a Racket or Chez Scheme -+ implementation used to create boot files to the build platform. -+ Suppling Chez Scheme is a much more direct path, but when Racket is -+ supplied, its version does not have to match the version being -+ built. -+ -+ * For Racket BC, `--enable-racket=RACKET` selects a Racket for -+ prepare C sources to cooperate with garbage collection. Its version -+ needs to be close to the one being built, and potentially exactly -+ the same version. - - Some less commonly needed `configure` flags are for Racket BC: - -diff --git a/racket/src/configure b/racket/src/configure -index c9f3ba4419..1b53ec7ce2 100755 ---- a/racket/src/configure -+++ b/racket/src/configure -@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" - use_cs=maybe - use_bc=maybe - supplied_racket=no -+supplied_scheme=no - enable_boothelp= - - # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, -@@ -34,6 +35,9 @@ for arg in $*; do - --enable-racket=*) - supplied_racket=yes - ;; -+ --enable-scheme=*) -+ supplied_scheme=yes -+ ;; - --help | -h) - echo $0: - echo see --help-bc or --help-cs, since the Racket CS build and the -@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then - fi - - if test "$use_cs" = "yes" ; then -- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then -- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly -+ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then -+ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly - exit 1 - fi - -diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt -index 2ece417b78..8e6fc57b74 100644 ---- a/racket/src/cs/README.txt -+++ b/racket/src/cs/README.txt -@@ -39,6 +39,11 @@ build: - installed in the "../ChezScheme/boot/pb" directory as described by - "../ChezScheme/BUILDING". - -+ Supplying `--enable-scheme=...` is also an option if you alerady -+ have the same version of Chez Scheme built on the current platform. -+ Another build will be created, anyway, but more quickly than -+ without Chez Scheme. -+ - * Racket is needed to generate the files in the "schemified" - directory from the sources in sibling directories like "../io". The - Racket version must be practically the same as the current Racket -@@ -48,7 +53,6 @@ build: - Unlike Chez Scheme boot files, the files generated in "schemified" - are human-readable and -editable Scheme code. That provides a way - out of bootstrapping black holes, even without BC. -- - - - ======================================================================== -diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in -index 54a644a1d9..d73993f0fc 100644 ---- a/racket/src/cs/c/Makefile.in -+++ b/racket/src/cs/c/Makefile.in -@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ - SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) - SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme - SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) --SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_existing = @MAKE_SCHEME_SCHEME@ -+SCHEME = $(SCHEME@USE_SCHEME_MODE@) - - TARGET_MACH = @TARGET_MACH@ - SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) -@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. - @INCLUDEDEP@ @srcdir@/../../version/version.mak - - cs: -- $(MAKE) scheme@T_CROSS_MODE@ -+ $(MAKE) scheme@MAKE_SCHEME_MODE@ - $(MAKE) racket-so - cd rktio; $(MAKE) - $(MAKE) racketcs -@@ -121,9 +123,13 @@ racket-so: - - RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ - -+TARGET_MACH_built = $(TARGET_MACH) -+TARGET_MACH_existing = xc-$(TARGET_MACH) -+XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch -+ - CS_PROGS = SCHEME="$(SCHEME)" - CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ --CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" -+CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" - PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" - - build-racket-so: -@@ -163,6 +169,15 @@ pb-bootquick: - cd $(SCHEME_WORKAREA) && $(MAKE) reset - $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) - -+scheme-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot -+ $(MAKE) mach-make -+ -+$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: -+ mkdir -p $(SCHEME_WORKAREA) -+ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" -+ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all -+ - mach-make: - $(MAKE) config-scheme - cd $(SCHEME_WORKAREA) && $(MAKE) -@@ -182,24 +197,33 @@ config-scheme: - - scheme-cross: - env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt -+ $(MAKE) finish-scheme-cross -+ -+finish-scheme-cross: - $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) - cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t -- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+ $(MAKE) $(XPATCH_FILE) -+ -+scheme-cross-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) -+ $(MAKE) finish-scheme-cross - - # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older --# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files --XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+# than the build-<host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files -+XPATCH_DEPS_built = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -+ $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+XPATCH_DEPS_existing = -+XPATCH_DEPS = $(XPATCH_DEPS@USE_SCHEME_MODE@) - --$(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch: $(XPATCH_DEPS) -+$(XPATCH_FILE): $(XPATCH_DEPS) - $(MAKE) bounce TARGET=build-xpatch-using-host - - build-xpatch-using-host: - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/s && $(MAKE) -f Mf-cross m=$(MACH) xm=$(TARGET_MACH) Scheme="$(SCHEME_BIN)" SCHEMEHEAPDIRS="$(SCHEME_INC)" - - XPATCH = --XPATCHcross = --xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+XPATCHcross = --xpatch $(XPATCH_FILE) - - racket.boot: racket.so - $(SCHEME) --script $(srcdir)/convert-to-boot.ss @BOOT_COMPRESS_COMP@ $(XPATCH@CROSS_MODE@) racket.so racket.boot $(TARGET_MACH) -@@ -410,7 +434,7 @@ install-cross: - $(MAKE) compile-xpatch.$(TARGET_MACH) - $(MAKE) library-xpatch.$(TARGET_MACH) - --SCHEME_XPATCH = $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+SCHEME_XPATCH = $(XPATCH_FILE) - - CROSS_SERVE_DEPS = $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss \ - $(srcdir)/../expander/env.ss $(srcdir)/../linklet/config.ss -diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure -index 21695a431a..1eeef57753 100755 ---- a/racket/src/cs/c/configure -+++ b/racket/src/cs/c/configure -@@ -654,6 +654,9 @@ MINGW - NOT_OSX - OSX - SETUP_BOOT_MODE -+USE_SCHEME_MODE -+MAKE_SCHEME_SCHEME -+MAKE_SCHEME_MODE - TT_CROSS_MODE - T_CROSS_MODE - CROSS_MODE -@@ -1448,7 +1451,7 @@ Optional Features: - --enable-docs build docs on install (enabled by default) - --enable-usersetup setup user-specific files on install - --enable-racket=<path> use <path> as Racket for build; or "auto" to create -- --enable-scheme=<path> use <path> as host's build directory for cross -+ --enable-scheme=<path> use <path> as host build for cross - --enable-mach=<mach> use Chez Scheme machine type <mach> - --enable-target=<mach> cross-build for Chez Scheme machine type <mach> - --enable-portable prefer portable to host-specific -@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" - show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' - - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - show_explicitly_enabled "${enable_portable}" "portable" -@@ -4745,9 +4748,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags - - - -+ -+ -+ - - - -diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac -index 464ebe1760..aaee88156d 100644 ---- a/racket/src/cs/c/configure.ac -+++ b/racket/src/cs/c/configure.ac -@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev - AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) - m4_include(../ac/path_arg.m4) - AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket for build; or "auto" to create]) --AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host's build directory for cross]) -+AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host build for cross]) - AC_ARG_ENABLE(mach, [ --enable-mach=<mach> use Chez Scheme machine type <mach>]) - AC_ARG_ENABLE(target, [ --enable-target=<mach> cross-build for Chez Scheme machine type <mach>]) - m4_include(../ac/portable_arg.m4) -@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" - show_explicitly_enabled "${enable_xonx}" "Unix style" - m4_include(../ac/path_show.m4) - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - m4_include(../ac/portable_show.m4) -@@ -504,9 +504,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) - AC_SUBST(CROSS_MODE) - AC_SUBST(T_CROSS_MODE) - AC_SUBST(TT_CROSS_MODE) -+AC_SUBST(MAKE_SCHEME_MODE) -+AC_SUBST(MAKE_SCHEME_SCHEME) -+AC_SUBST(USE_SCHEME_MODE) - AC_SUBST(SETUP_BOOT_MODE) - AC_SUBST(OSX) - AC_SUBST(NOT_OSX) --- -2.32.0 - diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch deleted file mode 100644 index 1e018eaa79..0000000000 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Mon, 31 Jan 2022 15:31:22 -0700 -Subject: [PATCH] fix creation of tethered launchers - -Related to racket/racket#4133 - -(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) ---- - gui-lib/mred/installer.rkt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt -index b1691472..9ef06c53 100644 ---- a/gui-lib/mred/installer.rkt -+++ b/gui-lib/mred/installer.rkt -@@ -72,4 +72,5 @@ - (list "-A" (path->string (find-system-path 'addon-dir))))) - - (define (config-flags) -- (list "-G" (path->string (find-config-dir)))) -+ (list "-X" (path->string (find-collects-dir)) -+ "-G" (path->string (find-config-dir)))) --- -2.32.0 - diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 471a11dd48..7d51707156 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -195,7 +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! +(define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -205,11 +205,9 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch" - ;; Remove by Racket 8.5: - "racket-enable-scheme-backport.patch")) + (patches (search-patches "racket-minimal-sh-via-rktio.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -248,8 +246,10 @@ (define (racket-vm-common-configure-flags) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) "--disable-strip" - ;; XXX: origtree layout is required by some other packages down the - ;; bootstrap chain. Remove these flags as soon as we can do without them. + ;; Using --enable-origtree lets us distinguish the VM from subsequent + ;; layers and produces a build with the shape expected by tools such as + ;; "distro-build" and "raco-cross". Removing these flags would require + ;; changes, especially to 'configure-layer.rkt' (defined below). "--enable-origtree" ,(string-append "--prefix=" #$output "/opt/racket-vm"))) @@ -589,7 +589,7 @@ (define-public racket racket-minimal ;; <-- TODO non-tethered layer (racket-vm-for-system) (simple-racket-origin - "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + "2d" (base32 "0fb5v6058ls08xw3zbmqyr2ym0psm119gl9ffgmhm9w8rs9i4dq7") '("2d" "2d-doc" "2d-lib")) (simple-racket-origin "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") @@ -622,22 +622,22 @@ (define-public racket "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin - "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") '(("datalog" "."))) (simple-racket-origin "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + "deinprogramm" (base32 "0g8flr1qg3bcyhdinqhs4w7dyisaqyailbxrjgd2a7zlqmdyicfr") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") '("distributed-places" "distributed-places-doc" "distributed-places-lib")) (simple-racket-origin - "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + "draw" (base32 "1fpk85rs2crd63bxnmwj2pysisd62pxcqaip01si67dv1ri8ff92") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + "drracket" (base32 "0dipnz92c63zxys9z1kl5215rm7arc35g9r8bs8ivp96p75mljnz") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -657,7 +657,7 @@ (define-public racket "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") '("errortrace" "errortrace-doc" "errortrace-lib")) (simple-racket-origin - "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + "expeditor" (base32 "0mjfwb4wzwsg5xj3k6cmik0va432n56rp5h7rxx1c2yy3prh1j7q") '("expeditor" "expeditor-doc" "expeditor-lib")) (simple-racket-origin "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") @@ -670,25 +670,14 @@ (define-public racket (simple-racket-origin "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") '(("games" "."))) - (racket-packages-origin - "gui" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/gui") - (commit %racket-commit))) - (sha256 (base32 - "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (file-name (git-file-name "racket-gui" %racket-version))) + (simple-racket-origin + "gui" (base32 "0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + "htdp" (base32 "199qchdq6db6m2n4j861hiy4nxd6hg1qva16lhhdbfj274qmcplg") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -756,7 +745,7 @@ (define-public racket "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + "pict" (base32 "0v7a3l77swsbh80mnb9rakdwgw7s66ji0mall7qcqfwyg1b4zmlv") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -771,7 +760,7 @@ (define-public racket "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") '("planet" "planet-doc" "planet-lib")) (simple-racket-origin - "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + "plot" (base32 "04871pspbm0q3bz5896sa3jw2rp9i6jf0b5aivrxfp56vxxd2ybb") '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) (simple-racket-origin "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") @@ -786,7 +775,7 @@ (define-public racket (url "https://github.com/Metaxal/quickscript") (commit %racket-commit))) (sha256 (base32 - "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + "00sf5nw09aacd0l4a4cknnffvcs95p596im3blsdvfz5ck6jdwl8")) (file-name (git-file-name "Metaxal-quickscript" %racket-version))) '(("quickscript" "."))) (simple-racket-origin @@ -807,10 +796,10 @@ (define-public racket (git-file-name "jeapostrophe-racket-cheat" %racket-version))) '(("racket-cheat" "."))) (simple-racket-origin - "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + "racklog" (base32 "0fbq0fpfb3l6h7h772dvkmlzlk2dnq5f8296xx1qxhhwypibqzr9") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + "rackunit" (base32 "0vfwcddzrgrdv5awjka7m0jzqhqvfc5wlkih83a670y96496a83n") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -826,7 +815,7 @@ (define-public racket "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + "redex" (base32 "0a1fl5s80k3j3xh3lri8886ql443m7pmgv18y7whzlmsd7x8rdpr") '("redex" "redex-benchmark" "redex-doc" @@ -841,7 +830,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + "scribble" (base32 "0fbb7xgz95y90247hfc1a19v7ry8m6blvv4y8irdgzhjvik70zb3") '("scribble" "scribble-doc" "scribble-html-lib" @@ -873,35 +862,24 @@ (define-public racket "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + "typed-racket" (base32 "05xlyjrx3m8xrrrw1xmfb1807qa5aqfl0zp9bdxwh2z7cfxaii09") '("source-syntax" "typed-racket" "typed-racket-compatibility" "typed-racket-doc" "typed-racket-lib" "typed-racket-more")) - (racket-packages-origin - "srfi" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/srfi") - ;; Includes an FSDG fix: return to %racket-commit in 8.5. - ;; See <https://github.com/racket/srfi/pull/15>. - (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) - (sha256 (base32 - "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) - ;; Use the relevant version for srfi-doc and srfi-lib, - ;; since we're using a newer commit than the v8.4 tag. - (file-name (git-file-name "racket-srfi" "1.1"))) + (simple-racket-origin + "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + "string-constants" (base32 "1rjs0gyw9hsiglwxnimz272v9xj1gwjxrnzh4qbsxkvdaphvi38m") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") '(("swindle" "."))) (simple-racket-origin - "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + "syntax-color" (base32 "1xf3rl8687c1nar4kkgkvyncwi0gl696rif0iqhffg730fk457gi") '("syntax-color" "syntax-color-doc" "syntax-color-lib")) (simple-racket-origin "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") @@ -910,13 +888,13 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + "web-server" (base32 "1g4x79ym3mgxv4f3z3z84j12355pf44pjlzlb7f0h6r0i7p0cbjd") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") '("wxme" "wxme-lib")) (simple-racket-origin - "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + "xrepl" (base32 "19svg0jfs656bld5ikqipz3a5szk5k02zq5fh43209qw527dnfbk") '("xrepl" "xrepl-doc" "xrepl-lib")))) (build-system gnu-build-system) (arguments -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 2/9] gnu: racket: Fix out-of-source build. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 1/9] gnu: racket: Update to 8.5 Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 3/9] gnu: chez-scheme: Update to 9.5.8 Philip McGrath ` (8 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/racket.scm (racket-vm-cgc)[arguments]: Supply '#:out-of-source? #t'. Wrap 'install-license-files' to work around limitation. --- gnu/packages/racket.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 7d51707156..8438945ba0 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -276,8 +276,9 @@ (define-public racket-vm-cgc ;; main-distribution-test that aren't part of the main ;; distribution. #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. + ;; Upstream recommends #:out-of-source?, and it + ;; helps a lot with debugging. + #:out-of-source? #t #:modules '((ice-9 match) (ice-9 regex) (guix build gnu-build-system) @@ -314,7 +315,18 @@ (define-public racket-vm-cgc #f))))))) (add-before 'configure 'chdir (lambda _ - (chdir "racket/src")))))) + (chdir "racket/src"))) + (replace 'install-license-files + ;; The #:out-of-source? mode for install-license-files fails + ;; to find the srcdir: as a workaround, navigate there ourselves. + (let ((install-license-files + (assoc-ref %standard-phases 'install-license-files))) + (lambda args + (with-directory-excursion "../src" + (apply install-license-files + `(,@args + ;; if there are duplicate keywords, last is used + #:out-of-source? #f))))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 3/9] gnu: chez-scheme: Update to 9.5.8. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 2/9] gnu: racket: Fix out-of-source build Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath ` (7 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/chez.scm (chez-scheme): Update to 9.5.8. --- gnu/packages/chez.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index a7f75a731a..34545b1f58 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -210,7 +210,7 @@ (define-public chez-scheme (name "chez-scheme") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. - (version "9.5.6") + (version "9.5.8") (source (origin (method git-fetch) (uri (git-reference @@ -218,7 +218,7 @@ (define-public chez-scheme (commit (string-append "v" version)))) (sha256 (base32 - "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) (file-name (git-file-name name version)) (snippet #~(begin (use-modules (guix build utils)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 4/9] gnu: chez-scheme: Refactor documentation phases. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (2 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 3/9] gnu: chez-scheme: Update to 9.5.8 Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath ` (6 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Patches merged in both upstream Chez Scheme and Racket's variant will soon let us replace the 'install-docs' phase with just 'make install-docs'. Separating the 'link-doc-pdfs' phase (which won't change) leaves us well-prepared for the transition, regardless of whether Chez Scheme 9.5.10 or Racket 8.6 is released first. * gnu/packages/chez.scm (chez-scheme)[arguments]: Split 'install-doc' phase into 'install-docs' (matching the future 'make' target) and 'link-doc-pdfs'. --- gnu/packages/chez.scm | 64 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 34545b1f58..49051abd17 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -309,35 +309,43 @@ (define-public chez-scheme (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'install-symlink 'install-doc + (add-after 'install-symlink 'install-docs (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (match (assoc-ref outputs "doc") - (#f - (format #t "not installing docs~%")) - (doc-prefix - (let* ((chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))))) + (let* ((doc-prefix (or (assoc-ref outputs "doc") + (assoc-ref outputs "out"))) + (chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (define* (stex-make #:optional (suffix "")) + (invoke "make" "install" + (string-append "Scheme=" scheme) + (string-append "STEXLIB=" stexlib) + (string-append "installdir=" doc-dir suffix))) + (with-directory-excursion "csug" + (stex-make "/csug")) + (with-directory-excursion "release_notes" + (stex-make "/release_notes"))))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf"))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads'. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (3 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 6/9] gnu: stex: Get machine type dynamically Philip McGrath ` (5 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Move Chez-specific logic into '#:configure-flags' and a new 'configure-environment-variables' phase, leaving the 'configure' phase as just a variant of the one from 'gnu-build-system' (including support for '#:out-of-source?') that doesn't add implicit Autoconf-style flags. In the process, do the right thing for "--threads", rather than assuming the only nonthreaded platform is broken. * gnu/packages/chez.scm (chez-scheme)[arguments]: Set configure flags in '#:configure-flags' and separate 'configure-environment-variables' from the residual 'configure' phase. More closely follow 'gnu-build-system'. Use 'chez-upstream-features-for-system' for "--threads". (chez-scheme-for-racket)[arguments]<#:configure-flags>: Add "--threads" unconditionally. --- gnu/packages/chez.scm | 63 ++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 49051abd17..785b6837c1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -258,8 +258,18 @@ (define-public chez-scheme (ice-9 ftw) (ice-9 match)) #:test-target "test" - ;; TODO when we fix armhf, it may not support --threads - #:configure-flags #~'("--threads") + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex @@ -273,26 +283,35 @@ (define-public chez-scheme (search-input-directory (or native-inputs inputs) "lib/chez-scheme-bootfiles") "boot"))) - ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; NOTE: The custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. (replace 'configure - (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) - ;; add flags which are always required: - (let ((flags (cons* (string-append "--installprefix=" #$output) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do compress-man-pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke "./configure" flags)))) + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) ;; The binary file name is called "scheme" as is the one from ;; MIT/GNU Scheme. We add a symlink to use in case both are ;; installed. @@ -385,7 +404,9 @@ (define-public chez-scheme-for-racket (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:configure-flags cfg-flags #~'()) - #~(cons "--disable-x11" #$cfg-flags)) + #~(cons* "--disable-x11" + "--threads" ;; ok to potentially duplicate + #$cfg-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) (unpack (assoc-ref those-phases 'unpack))) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 6/9] gnu: stex: Get machine type dynamically. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (4 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath ` (4 subsequent siblings) 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine the machine type. --- gnu/packages/chez.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 785b6837c1..dd485d37e1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -602,6 +602,10 @@ (define-public stex-bootstrap ("src" "lib/stex/") ("Mf-stex" "lib/stex/") ("Makefile.template" "lib/stex/")) + #:modules + '((guix build copy-build-system) + (guix build utils) + (ice-9 popen)) #:phases #~(modify-phases %standard-phases (add-before 'install 'patch-sources @@ -633,8 +637,14 @@ (define-public stex-bootstrap (define makefile (string-append (getcwd) "/Makefile")) (define machine - #$(and=> (nix-system->chez-machine) - chez-machine->threaded)) + (let ((pipe (open-pipe* OPEN_BOTH scheme "-q"))) + ;; try to not be wrong for cross-compilation + ;; (avoid #% reader abbreviation for Guile) + (write '(($primitive $target-machine)) pipe) + (force-output pipe) + (let ((sym (read pipe))) + (close-pipe pipe) + (symbol->string sym)))) (with-directory-excursion (search-input-directory outputs "/lib/stex") (invoke "make" -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (5 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 6/9] gnu: stex: Get machine type dynamically Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:21 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath ` (3 subsequent siblings) 10 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler This commit is a follow-up to b8fc9169515ef1a6d6037c84e30ad308e5418b6f. While that commit fixed a breaking build, this one begins to address the faulty assumptions that lead to the failure: see also <https://issues.guix.gnu.org/54292#6>. In this commit, we reimplement 'chez-upstream-features-for-system' using the new '%chez-features-table', which explicitly specifies platform support for both 'chez-scheme' and 'chez-scheme-for-racket', rather than assuming a non-false result from 'nix-system->chez-machine' means that the system is supported. The remaining uses of 'nix-system->chez-machine' still make that incorrect assumption and must be repaired in a future commit. * gnu/packages/chez.scm (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): Replace with ... (target-chez-arch, target-chez-os): ... these new variables. (nix-system->chez-machine): Rewrite using them. (%chez-features-table): New variable. (chez-upstream-features-for-system): Rewrite using it. (chez-scheme)[supported-systems]: Update armhf-linux comment. (chez-scheme-bootstrap-bootfiles)[supported-systems]: Use 'chez-upstream-features-for-system'. (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system): Remove unused functions. --- gnu/packages/chez.scm | 234 ++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 100 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dd485d37e1..41f083e0ac 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -49,8 +49,6 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system nix-system->chez-machine - chez-machine->nonthreaded - chez-machine->threaded unpack-nanopass+stex)) ;; Commentary: @@ -82,68 +80,57 @@ (define* (chez-scheme-for-system #:optional chez-scheme chez-scheme-for-racket)) -(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 -MACHINE. The returned string may share storage with MACHINE." - ;; Chez Scheme documentation consistently uses "nonthreaded" rather than - ;; e.g. "unthreaded" - (if (eqv? #\t (string-ref machine 0)) - (substring machine 1) - machine)) -(define (chez-machine->threaded machine) - "Like @code{chez-machine->nonthreaded}, but returns the threaded machine -type." - (if (eqv? #\t (string-ref machine 0)) - machine - (string-append "t" machine))) - -;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt -;; in https://github.com/racket/raco-cross. -;; For supported platforms, refer to release_notes/release_notes.stex in the -;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md -;; in https://github.com/racket/racket. -(define %nix-arch-to-chez-alist - `(("x86_64" . "a6") - ("i386" . "i3") - ("aarch64" . "arm64") - ("armhf" . "arm32") ;; Chez supports ARM v6+ - ("ppc" . "ppc32"))) -(define %nix-os-to-chez-alist - `(("w64-mingw32" . "nt") - ("darwin" . "osx") - ("linux" . "le") - ("freebsd" . "fb") - ("openbsd" . "ob") - ("netbsd" . "nb") - ("solaris" . "s2"))) - -(define (chez-machine->nix-system machine) - "Return the Nix system type corresponding to the Chez Scheme machine type -MACHINE. If MACHINE is not a string representing a known machine type, an -exception is raised. This function does not distinguish between threaded and -nonthreaded variants of MACHINE. +(define* (target-chez-arch #:optional (system + (or (%current-target-system) + (%current-system)))) + "Return a string representing the architecture of SYSTEM as used in Chez +Scheme machine types, or '#f' if none is defined." + (cond + ((target-x86-64? system) + "a6") + ((target-x86-32? system) + "i3") + ((target-aarch64? system) + "arm64") + ((target-arm32? system) + "arm32") + ((target-ppc64le? system) + #f) + ((target-ppc32? system) + "ppc32") + ((target-riscv64? system) + #f) + (else + #f))) -Note that this function only handles Chez Scheme machine types in the -strictest sense, not other kinds of descriptors sometimes used in place of a -Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or -@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type -for the host system is often still relevant.)" - (let ((machine (chez-machine->nonthreaded machine))) - (let find-arch ((alist %nix-arch-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (string-prefix? chez machine) - (string-append - nix "-" (let ((machine-os - (substring machine (string-length chez)))) - (let find-os ((alist %nix-os-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (equal? chez machine-os) - nix - (find-os alist))))))) - (find-arch alist))))))) +(define* (target-chez-os #:optional (system (or (%current-target-system) + (%current-system)))) + "Return a string representing the operating system kernel of SYSTEM as used +in Chez Scheme machine types, or '#f' if none is defined." + ;; e.g. "le" includes both GNU/Linux and Android + (cond + ((target-linux? system) + "le") + ((target-hurd? system) + #f) + ((target-mingw? system) + "nt") + ;; missing (guix utils) predicates + ;; cf. https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix + ((string-suffix? "-darwin" system) + "osx") + ((string-suffix? "-freebsd" system) + "fb") + ((string-suffix? "-openbsd" system) + "ob") + ((string-suffix? "-netbsd" system) + "nb") + ;; Nix says "x86_64-solaris", but accommodate "-solaris2" + ((string-contains system "solaris") + "s2") + ;; unknown + (else + #f))) (define* (nix-system->chez-machine #:optional (system (or (%current-target-system) @@ -153,16 +140,81 @@ (define* (nix-system->chez-machine #:optional machine type is undefined. It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type: when the distinction is relevant, use -@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust -the result." - (let* ((hyphen (string-index system #\-)) - (nix-arch (substring system 0 hyphen)) - (nix-os (substring system (+ 1 hyphen))) - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) +nonthreaded machine type." + (let* ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) (and chez-arch chez-os (string-append chez-arch chez-os)))) +(define %chez-features-table + ;; An alist of alists mapping: + ;; os -> arch -> (or/c #f (listof symbol?)) + ;; where: + ;; - `os` is a string for the OS part of a Chez Scheme machine type; and + ;; - `arch` is a string for the architecture part of a Chez machine type. + ;; + ;; The absence of an entry for a given arch--os pair means that neither + ;; upstream Chez Scheme nor the Racket variant can generate native code for + ;; that system. (The Racket variant can still provide support via its + ;; ``portable bytecode'' backends and optional compilation to C.) A value + ;; of `#f` means that upstream Chez Scheme does not support the arch--os + ;; pair at all, but the Racket variant does. A list has the same meaning as + ;; a result from `chez-upstream-features-for-system`. + ;; + ;; The arch--os pairs marked "commented out" have been commented out in the + ;; STeX source for the upstream release notes since the initial release as + ;; free software, but they are reported to work and/or have been described + ;; as supported by upstream maintainers. + ;; + ;; For this overall approach to make sense, we assume that Racket's variant + ;; of Chez Scheme can generate native code for a superset of the platforms + ;; supported upstream, supports threads on all platforms it supports at all + ;; (because they are needed for Racket), and doesn't need bootstrap + ;; bootfiles. Those assumptions have held for several years. + '(;; Linux + ("le" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm32" bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" threads)) + ;; FreeBSD + ("fb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenBSD + ("ob" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; NetBSD + ("nb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenSolaris / OpenIndiana / Illumos + ("s2" + ("i3" threads) ;; commented out + ("a6" threads)) ;; commented out + ;; Windows + ("nt" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ;; ^ threads "experiemental", but reportedly fine + ("arm64" . #f)) + ;; Darwin + ("osx" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" . #f)))) + (define* (chez-upstream-features-for-system #:optional (system (or (%current-target-system) @@ -172,20 +224,14 @@ (define* (chez-upstream-features-for-system #:optional does not support SYSTEM at all. If native threads are supported, the returned list will include -@code{'threads}. Other feature symbols may be added in the future." - (cond - ((not (nix-system->chez-machine system)) - #f) - ((target-aarch64? system) - #f) - ((target-arm32? system) - (and (target-linux? system) - '())) - ((target-ppc32? system) - (and (target-linux? system) - '(threads))) - (else - '(threads)))) +@code{'threads}. If bootstrap bootfiles for SYSTEM are distributed in the +upstream Chez Scheme repository, the returned list will include +@code{'bootstrap-bootfiles}. Other feature symbols may be added in the +future." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and=> (assoc-ref %chez-features-table chez-os) + (cut assoc-ref <> chez-arch)))) ;; ;; Chez Scheme: @@ -365,14 +411,9 @@ (define-public chez-scheme ((pth) (symlink pth "csug.pdf"))))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. (supported-systems (delete - "armhf-linux" ;; <-- should work, but reportedly broken + "armhf-linux" ;; XXX reportedly broken, needs checking (filter chez-upstream-features-for-system %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") @@ -471,16 +512,9 @@ (define-public chez-scheme-bootstrap-bootfiles (list #:install-plan #~`(("boot/" "lib/chez-scheme-bootfiles")))) (supported-systems - ;; Upstream only distributes pre-built bootfiles for - ;; arm32le and t?(i3|a6)(le|nt|osx) (filter (lambda (system) - (let ((machine (and=> (nix-system->chez-machine system) - chez-machine->nonthreaded))) - (or (equal? "arm32le" machine) - (and machine - (member (substring machine 0 2) '("i3" "a6")) - (or-map (cut string-suffix? <> machine) - '("le" "nt" "osx")))))) + (and=> (chez-upstream-features-for-system system) + (cut memq 'bootstrap-bootfiles <>))) %supported-systems)) (synopsis "Chez Scheme bootfiles (binary seed)") (description -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath @ 2022-05-09 6:21 ` Liliana Marie Prikler 2022-05-09 7:20 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-09 6:21 UTC (permalink / raw) To: Philip McGrath, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Am Montag, dem 09.05.2022 um 02:02 -0400 schrieb Philip McGrath: > In this commit, we reimplement 'chez-upstream-features-for-system' > using the new '%chez-features-table', which explicitly specifies > platform support for both 'chez-scheme' and 'chez-scheme-for-racket', > rather than assuming a non-false result from 'nix-system->chez-machine' > means that the system is supported. > > The remaining uses of 'nix-system->chez-machine' still make that > incorrect assumption and must be repaired in a future commit. Do they really? As far as I can see, we have a bijection between supported nix systems and chez-machines, with the behaviour when looking up unsupported systems being undefined. This means that nix- system->chez-machine is well-formed in contexts outside of supported- system, e.g. also for the 6/9 patch. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation. 2022-05-09 6:21 ` Liliana Marie Prikler @ 2022-05-09 7:20 ` Philip McGrath 2022-05-09 7:41 ` Liliana Marie Prikler 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-09 7:20 UTC (permalink / raw) To: Liliana Marie Prikler, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Hi, On 5/9/22 02:21, Liliana Marie Prikler wrote: > Am Montag, dem 09.05.2022 um 02:02 -0400 schrieb Philip McGrath: >> In this commit, we reimplement 'chez-upstream-features-for-system' >> using the new '%chez-features-table', which explicitly specifies >> platform support for both 'chez-scheme' and 'chez-scheme-for-racket', >> rather than assuming a non-false result from 'nix-system->chez-machine' >> means that the system is supported. >> >> The remaining uses of 'nix-system->chez-machine' still make that >> incorrect assumption and must be repaired in a future commit. > Do they really? As far as I can see, we have a bijection between > supported nix systems and chez-machines, with the behaviour when > looking up unsupported systems being undefined. This means that nix- > system->chez-machine is well-formed in contexts outside of supported- > system, e.g. also for the 6/9 patch. > I think a bijection happens to exist at the moment, but only by accident. For example, while it isn't packaged for Guix, apparently aarch64-w64-mingw32 is a thing. Racket's Chez Scheme only added tarm64nt support as of this release, but had previously supported aarch64 with other kernels and the NT kernel with other architectures. If Guix had added that system before Racket's Chez did, 'nix-system->chez-machine' would have known how to write it as a Chez machine type, but nonetheless it wouldn't have had a native code backend. We explicitly list the systems for which Racket's Chez has a native code backend in '%chez-features-table', so I really think we should just use it, rather than try to be clever with 'nix-system->chez-machine'. -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation. 2022-05-09 7:20 ` Philip McGrath @ 2022-05-09 7:41 ` Liliana Marie Prikler 0 siblings, 0 replies; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-09 7:41 UTC (permalink / raw) To: Philip McGrath, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Am Montag, dem 09.05.2022 um 03:20 -0400 schrieb Philip McGrath: > On 5/9/22 02:21, Liliana Marie Prikler wrote: > > As far as I can see, we have a bijection between *supported nix > > systems* and chez-machines, with the *behaviour when looking up > > unsupported systems* being *undefined*. > I think a bijection happens to exist at the moment, but only by > accident. Emphasis mine. Look more closely, it's a bijection + undefined, where undefined falls outside the realm of what should be reached outside of supported-system queries. In short, the specification for nix-system- >chez-machine is that for every *supported system* it returns the chez machine as a string. Otherwise, it may return a string or #f, we don't care. Thus, nix-system->chez-machine can serve as an upper bound for supported-system, but not as its implementation. > For example, while it isn't packaged for Guix, apparently > aarch64-w64-mingw32 is a thing. Racket's Chez Scheme only added > tarm64nt support as of this release, but had previously supported > aarch64 with other kernels and the NT kernel with other > architectures. If Guix had added that system before Racket's Chez > did, 'nix-system->chez-machine' would have known how to write it as > a Chez machine type, but nonetheless it wouldn't have had a native > code backend. That's irrelevant and not the purpose for having a conversion function. > We explicitly list the systems for which Racket's Chez has a native > code backend in '%chez-features-table', Do we really? > I think we should just use it, rather than try to be clever with > 'nix-system->chez-machine'. Well, that depends on what you're trying to use it for. Determining features? Sure. Determining system support? Okay. But that doesn't mean there's no valid use for nix-machine->chez-system – in particular I think you over-eagerly removed a valid one earlier. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (6 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 6:34 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath ` (2 subsequent siblings) 10 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler This commit fixes the treatment of systems like "powerpc-w64-mingw32", where the combination of architecture and kernel is not supported, even though both are supported in other combinations. The build failure fixed in b8fc9169515ef1a6d6037c84e30ad308e5418b6f highlighted this problem: see also <https://issues.guix.gnu.org/54292#6>. The correct support status is specified by '%chez-features-table', which was added to improve 'chez-upstream-features-for-system': this commit uses it to fix the repair. Once the issues in <https://racket.discourse.group/t/950> are resolved, 'chez-scheme-for-racket' and 'racket-vm-cs' will be able to run even on systems for which native code generation is not supported. It's not clear what behavior would be useful from 'nix-system->chez-machine': since the current implementation is flawed and easy to misuse, we remove it for now, replacing the remaining uses with 'racket-cs-native-supported-system?'. * gnu/packages/chez.scm (nix-system->chez-machine): Remove it. (racket-cs-native-supported-system?): New variable. (chez-scheme-for-racket)[supported-systems]: Use it. * gnu/packages/racket.scm (racket-vm-for-system): Likewise. --- gnu/packages/chez.scm | 32 +++++++++++++++++--------------- gnu/packages/racket.scm | 7 +++++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 41f083e0ac..cae17580f8 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system - nix-system->chez-machine + racket-cs-native-supported-system? unpack-nanopass+stex)) ;; Commentary: @@ -132,19 +132,6 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) (else #f))) -(define* (nix-system->chez-machine #:optional - (system (or (%current-target-system) - (%current-system)))) - "Return the Chez Scheme machine type corresponding to the Nix system -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme -machine type is undefined. - -It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type." - (let* ((chez-arch (target-chez-arch system)) - (chez-os (target-chez-os system))) - (and chez-arch chez-os (string-append chez-arch chez-os)))) - (define %chez-features-table ;; An alist of alists mapping: ;; os -> arch -> (or/c #f (listof symbol?)) @@ -233,6 +220,19 @@ (define* (chez-upstream-features-for-system #:optional (and=> (assoc-ref %chez-features-table chez-os) (cut assoc-ref <> chez-arch)))) +(define* (racket-cs-native-supported-system? #:optional + (system + (or (%current-target-system) + (%current-system)))) + "Can Racket's variant of Chez Scheme generate native code for SYSTEM? +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and (and=> (assoc-ref %chez-features-table chez-os) + ;; NOT assoc-ref: supported even if cdr is #f + (cut assoc chez-arch <>)) + #t))) + ;; ;; Chez Scheme: ;; @@ -459,7 +459,9 @@ (define-public chez-scheme-for-racket (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) - (supported-systems (filter nix-system->chez-machine + ;; TODO: How to build pbarch/pbchunks for other systems? + ;; See https://racket.discourse.group/t/950 + (supported-systems (filter racket-cs-native-supported-system? %supported-systems)) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 8438945ba0..f010cf3aa4 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -190,8 +190,11 @@ (define-module (gnu packages racket) (define* (racket-vm-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." - (if (nix-system->chez-machine system) + "Return 'racket-vm-cs' if we are able to build it for SYSTEM; 'racket-vm-bc' +otherwise." + ;; Once we figure out the issues in https://racket.discourse.group/t/950, + ;; we can use 'racket-vm-cs' everywhere. + (if (racket-cs-native-supported-system? system) racket-vm-cs racket-vm-bc)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath @ 2022-05-09 6:34 ` Liliana Marie Prikler 2022-05-09 7:55 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-09 6:34 UTC (permalink / raw) To: Philip McGrath, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Am Montag, dem 09.05.2022 um 02:02 -0400 schrieb Philip McGrath: > Once the issues in <https://racket.discourse.group/t/950> are > resolved, 'chez-scheme-for-racket' and 'racket-vm-cs' will be able to > run even on systems for which native code generation is not > supported. It's not clear what behavior would be useful from 'nix- > system->chez-machine': since the current implementation is flawed and > easy to misuse, we remove it for now, replacing the remaining uses > with 'racket-cs-native-supported-system?'. I think you're again making a wrong assumption here. nix-system->chez- scheme has purposes outside of solving supported-system. > +(define* (racket-cs-native-supported-system? #:optional > + (system > + (or (%current-target- > system) > + (%current- > system)))) > + "Can Racket's variant of Chez Scheme generate native code for > SYSTEM? > +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." > + (let ((chez-arch (target-chez-arch system)) > + (chez-os (target-chez-os system))) > + (and (and=> (assoc-ref %chez-features-table chez-os) > + ;; NOT assoc-ref: supported even if cdr is #f > + (cut assoc chez-arch <>)) > + #t))) I think this should rather be explicit in %chez-features-table. You can prefix features that only work inside racket with 'racket-. Then, this can be solved with memq just as with chez-scheme's supported- systems in 7/9. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-09 6:34 ` Liliana Marie Prikler @ 2022-05-09 7:55 ` Philip McGrath 2022-05-09 9:36 ` Liliana Marie Prikler 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-09 7:55 UTC (permalink / raw) To: Liliana Marie Prikler, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Hi, On 5/9/22 02:34, Liliana Marie Prikler wrote: > Am Montag, dem 09.05.2022 um 02:02 -0400 schrieb Philip McGrath: >> Once the issues in <https://racket.discourse.group/t/950> are >> resolved, 'chez-scheme-for-racket' and 'racket-vm-cs' will be able to >> run even on systems for which native code generation is not >> supported. It's not clear what behavior would be useful from 'nix- >> system->chez-machine': since the current implementation is flawed and >> easy to misuse, we remove it for now, replacing the remaining uses >> with 'racket-cs-native-supported-system?'. > I think you're again making a wrong assumption here. nix-system->chez- > scheme has purposes outside of solving supported-system. > Concretely, there are no other uses in Guix. I do not know a robust, correct way to use 'nix-system->chez-machine'---certainly not without it growing many additional features, like maybe computing endianness for pbarch backends when we are able to build them. For example, if we continued using it as we did in 'stex', you couldn't build a package graph for nonthreaded Chez simply by applying a package transformation to remove '--threads' from its '#:configure-flags', because that would change the machine type without updating the uses of 'nix-system->chez-machine'. >> +(define* (racket-cs-native-supported-system? #:optional >> + (system >> + (or (%current-target- >> system) >> + (%current- >> system)))) >> + "Can Racket's variant of Chez Scheme generate native code for >> SYSTEM? >> +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." >> + (let ((chez-arch (target-chez-arch system)) >> + (chez-os (target-chez-os system))) >> + (and (and=> (assoc-ref %chez-features-table chez-os) >> + ;; NOT assoc-ref: supported even if cdr is #f >> + (cut assoc chez-arch <>)) >> + #t))) > I think this should rather be explicit in %chez-features-table. You > can prefix features that only work inside racket with 'racket-. Then, > this can be solved with memq just as with chez-scheme's supported- > systems in 7/9. > I don't understand this. The presence of an entry in '%chez-features-table' explicitly means that 'chez-scheme-for-racket' can generate native code. The idea is that the "portable bytecode" backends should work, including thread support, on any system with a reasonably capable C compiler. There are no other "features" that vary among systems for 'chez-scheme-for-racket'. It doesn't rely on pre-built bootfiles for bootstrapping. Since the initial fork at the beginning of 2017, when support for new systems has been added, native threads have been supported immediately. Racket regularly merges all changes from upstream Chez (which has not added any supported systems during that time---not even the systems added already in Racket's variant). These conditions are documented in the comments on '%chez-features-table'. If they ever ceased to hold, it would mean that the relationship between 'chez-scheme-for-racket' and upstream 'chez-scheme' had changed significantly, and we would probably need to reevaluate more broadly which variant to use where. -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-09 7:55 ` Philip McGrath @ 2022-05-09 9:36 ` Liliana Marie Prikler 2022-05-12 5:26 ` Philip McGrath 0 siblings, 1 reply; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-09 9:36 UTC (permalink / raw) To: Philip McGrath, 55248; +Cc: Maxime Devos, Liliana Marie Prikler Hi, Am Montag, dem 09.05.2022 um 03:55 -0400 schrieb Philip McGrath: > Concretely, there are no other uses in Guix. > > I do not know a robust, correct way to use > 'nix-system->chez-machine'---certainly not without it growing many > additional features, like maybe computing endianness for pbarch > backends when we are able to build them. For example, if we continued > using it as we did in 'stex', you couldn't build a package graph for > nonthreaded Chez simply by applying a package transformation to > remove '--threads' from its '#:configure-flags', because that would > change the machine type without updating the uses of 'nix-system- > >chez-machine'. True, you would have to change the machine type, but I think I already noted that we might want to use this machine type as a distinguishing factor in packages built on top of chez (and later chez-build-system perhaps). You could do this the other way round by deriving flags from the given machine-type, e.g. stex for threaded chez machine is given -- threads, otherwise it's not. Since we have named symbols for these features, we could have a "package-with-chez-features" or similar transformer. Being able to specify this machine is a strength, not a weakness. > The presence of an entry in '%chez-features-table' explicitly means > that 'chez-scheme-for-racket' can generate native code. That is not explicit at all. There might be an explicit comment stating so somewhere, but in terms of actual code, it's super implicit. > The idea is that the "portable bytecode" backends should work, > including thread support, on any system with a reasonably capable C > compiler. The idea. In practice, what racket deems reasonably capable can change over time and might result in them dropping some architectures currently supported. What do you do then? > There are no other "features" that vary among systems for > 'chez-scheme-for-racket'. It doesn't rely on pre-built bootfiles for > bootstrapping. Since the initial fork at the beginning of 2017, when > support for new systems has been added, native threads have been > supported immediately. Racket regularly merges all changes from > upstream Chez (which has not added any supported systems during that > time---not even the systems added already in Racket's variant). I'd still make "supported-by-racket" or however else you decide to name that feature an explicit part of that table rather than an implicit one, or use a separate "table" for platforms supported by racket. Note that none of the racket-vm packages appear to currently carry supported-systems, which seems dubious. > These conditions are documented in the comments on '%chez-features- > table'. See above. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-09 9:36 ` Liliana Marie Prikler @ 2022-05-12 5:26 ` Philip McGrath 2022-05-12 8:04 ` Liliana Marie Prikler 0 siblings, 1 reply; 58+ messages in thread From: Philip McGrath @ 2022-05-12 5:26 UTC (permalink / raw) To: Liliana Marie Prikler, 55248 Cc: Ludovic Courtès, Maxime Devos, Liliana Marie Prikler Hi, On 5/9/22 05:36, Liliana Marie Prikler wrote: > Hi, > > Am Montag, dem 09.05.2022 um 03:55 -0400 schrieb Philip McGrath: >> Concretely, there are no other uses in Guix. >> >> I do not know a robust, correct way to use >> 'nix-system->chez-machine'---certainly not without it growing many >> additional features, like maybe computing endianness for pbarch >> backends when we are able to build them. For example, if we continued >> using it as we did in 'stex', you couldn't build a package graph for >> nonthreaded Chez simply by applying a package transformation to >> remove '--threads' from its '#:configure-flags', because that would >> change the machine type without updating the uses of 'nix-system- >>> chez-machine'. > True, you would have to change the machine type, but I think I already > noted that we might want to use this machine type as a distinguishing > factor in packages built on top of chez (and later chez-build-system > perhaps). You could do this the other way round by deriving flags from > the given machine-type, e.g. stex for threaded chez machine is given -- > threads, otherwise it's not. Since we have named symbols for these > features, we could have a "package-with-chez-features" or similar > transformer. Being able to specify this machine is a strength, not a > weakness. > I can imagine something like this might be useful eventually. My problem is that, right now, 'nix-system->chez-machine' is an attractive nuisance: it sounds useful, but I don't know any way of using it that wouldn't be subtly wrong. I don't even feel certain even about what cases 'nix-system->chez-machine' would need to cover to be correct and useful: a fair amount seems to depend on what turns out to be necessary for cross-compilation and the portable bytecode architectures (which I hope to work out by July). >> The idea is that the "portable bytecode" backends should work, >> including thread support, on any system with a reasonably capable C >> compiler. > The idea. In practice, what racket deems reasonably capable can change > over time and might result in them dropping some architectures > currently supported. What do you do then? > I mean, "over time", at the extreme, anything "might" happen, but I don't think that's worth worrying about. Racket has an extremely strong commitment to backwards compatibility. To pick one example, support libraries for racket/draw and racket/gui are still maintained for ppc-macosx, which the vendor hasn't released any software for in a decade or more (depending on how you prefer to count). The C code deliberately does not require C99 support. >> The presence of an entry in '%chez-features-table' explicitly means >> that 'chez-scheme-for-racket' can generate native code. > That is not explicit at all. There might be an explicit comment > stating so somewhere, but in terms of actual code, it's super > implicit. > >> There are no other "features" that vary among systems for >> 'chez-scheme-for-racket'. It doesn't rely on pre-built bootfiles for >> bootstrapping. Since the initial fork at the beginning of 2017, when >> support for new systems has been added, native threads have been >> supported immediately. Racket regularly merges all changes from >> upstream Chez (which has not added any supported systems during that >> time---not even the systems added already in Racket's variant). > I'd still make "supported-by-racket" or however else you decide to name > that feature an explicit part of that table rather than an implicit > one, or use a separate "table" for platforms supported by racket. I really don't understand how this would be helpful. I don't think it would make sense for a list returned by chez-upstream-features-for-system to include a symbol supported-by-racket, which has nothing to do with *upstream* features. Aside from that, we would be adding this symbol to every single entry in %chez-features-table. That would imply turning all of the #f entries into (supported-by-racket), and then we would need some other solution for identifying platforms with no support upstream. > Note > that none of the racket-vm packages appear to currently carry > supported-systems, which seems dubious. > The only constraint on the systems supported by 'racket-vm-cs' is from 'chez-scheme-for-racket'---i.e., the trouble with `configure` for systems without a native-code backend, which should be fixed by the next release, if not before. I expect the fact that the 'chez-scheme-for-racket' input is not supported to work as an alternative to duplicating the filtering in its supported-systems field (which I think would create a cyclic dependency issue). AFAIK, 'racket-vm-cgc' and 'racket-vm-bc' should work everywhere (though possibly without the JIT, futures, and/or places) except that support for aarch64-macosx is prohibitively poor (IIUC due to W^X issues), which is fairly irrelevant for Guix. -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-12 5:26 ` Philip McGrath @ 2022-05-12 8:04 ` Liliana Marie Prikler 0 siblings, 0 replies; 58+ messages in thread From: Liliana Marie Prikler @ 2022-05-12 8:04 UTC (permalink / raw) To: Philip McGrath, 55248 Cc: Ludovic Courtès, Maxime Devos, Liliana Marie Prikler Hi, Am Donnerstag, dem 12.05.2022 um 01:26 -0400 schrieb Philip McGrath: > > True, you would have to change the machine type, but I think I > > already noted that we might want to use this machine type as a > > distinguishing factor in packages built on top of chez (and later > > chez-build-system perhaps). You could do this the other way round by > > deriving flags from the given machine-type, e.g. stex for threaded > > chez machine is given -- threads, otherwise it's not. Since we have > > named symbols for these features, we could have a "package-with-chez- > > features" or similar transformer. Being able to specify this machine > > is a strength, not a weakness. > > > > I can imagine something like this might be useful eventually. My > problem is that, right now, 'nix-system->chez-machine' is an attractive > nuisance: it sounds useful, but I don't know any way of using it that > wouldn't be subtly wrong. Your 6/9 patch imho erases a use that wouldn't have been wrong. Certainly not if we add extra features to it or use inference at build time. For instance (let* ((base-system #$(nix-system->chez-machine (or (%current-target-system) (%current-system)))) (threaded? (member "--threads" configure-flags)) (portable-bytecode? [however you would determine that]) (actual-machine (string-append ...))) [code that uses actual-machine]) would be an alternative if you want actual-machine inferred by compile options rather than earlier on. > I don't even feel certain even about what cases 'nix-system->chez- > machine' would need to cover to be correct > and useful: a fair amount seems to depend on what turns out to be > necessary for cross-compilation and the portable bytecode > architectures (which I hope to work out by July). From my POV it is already enough if we can do the basic translation with nix-system->chez-machine. Additional features like threads or portable bytecode would be nice to have, but if you feel that it'd be "subtly wrong" to add them (or not to add them), you can feel free to add or omit them as you like. > > I'd still make "supported-by-racket" or however else you decide to > > name that feature an explicit part of that table rather than an > > implicit one, or use a separate "table" for platforms supported by > > racket. > > I really don't understand how this would be helpful. I don't think it > would make sense for a list returned by > chez-upstream-features-for-system to include a symbol > supported-by-racket, which has nothing to do with *upstream* > features. For one, that procedure would be free to filter features as it needs so that it doesn't return racket-specific symbols, but more importantly if you do feel that using this table to report racket support explicitly is abuse, how is it not abuse if you report it implicitly? > Aside from that, we would be adding this symbol to every single entry > in %chez-features-table. That would imply turning all of the #f > entries into (supported-by-racket), and then we would need some other > solution for identifying platforms with no support upstream. If I read this table correctly, there is no entry, that does not have either 'threads or 'bootstrap-bootfiles. So null? after filtering racket features would work. If this is ever violated, e.g. we find an arch that has neither bootstrap nor threads, but is still supported by upstream, we could add an explicit 'basic-upstream-support feature to the table. > > Note that none of the racket-vm packages appear to currently carry > > supported-systems, which seems dubious. > > The only constraint on the systems supported by 'racket-vm-cs' is > from 'chez-scheme-for-racket'---i.e., the trouble with `configure` > for systems without a native-code backend, which should be fixed by > the next release, if not before. Let's just assume that to be true. Even if so, why is "supported by racket" the condition for which we check rather than "not supported by upstream"? Seems kinda counterintuitive if racket supposedly supports all arches while chez itself does not. > I expect the fact that the 'chez-scheme-for-racket' input is not > supported to work as an alternative to duplicating the filtering in > its supported-systems field (which I think would create a cyclic > dependency issue). You might want to rephrase that sentence. I have no idea what you're trying to get across here. Cheers ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v3 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (7 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath @ 2022-05-09 6:02 ` Philip McGrath 2022-05-09 9:44 ` [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 2022-05-12 10:32 ` bug#55248: [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 10 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-09 6:02 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Change 'chez-scheme-for-system' to return 'chez-scheme-for-racket' in two cases when it previously returned 'chez-scheme': 1. When 'chez-scheme' is not distributed with bootstrap bootfiles, since we can only cross-compile 'chez-scheme' for those systems; and 2. When neither 'chez-scheme' nor 'chez-scheme-for-racket' supports native code generation, since we will be able to use the ``portable bytecode'' backends of 'chez-scheme-for-racket' as soon as the issues in <https://racket.discourse.group/t/950> are resolved. * gnu/packages/chez.scm (chez-scheme-for-racket): Change condition. --- gnu/packages/chez.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index cae17580f8..7e6273f26a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -69,14 +69,17 @@ (define-module (gnu packages chez) (define* (chez-scheme-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, -including support for native threads." - (if (or - ;; full support upstream - (and=> (chez-upstream-features-for-system system) - (cut memq 'threads <>)) - ;; no support anywhere - (not (nix-system->chez-machine system))) + "Return 'chez-scheme' if it fully supports SYSTEM, including support for +bootstrapping and native threads. Otherwise, return +'chez-scheme-for-racket'." + (if (and=> (chez-upstream-features-for-system system) + (lambda (features) + (every (cut memq <> features) + '(threads + ;; We can cross-compile for platforms without + ;; bootstrap bootfiles, but we can't self-host + ;; on them short of adding more binary seeds. + bootstrap-bootfiles)))) chez-scheme chez-scheme-for-racket)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (8 preceding siblings ...) 2022-05-09 6:02 ` [bug#55248] [PATCH v3 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath @ 2022-05-09 9:44 ` Ludovic Courtès 2022-05-12 3:50 ` Philip McGrath 2022-05-12 3:59 ` [bug#55248] [PATCH v4 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-12 10:32 ` bug#55248: [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 10 siblings, 2 replies; 58+ messages in thread From: Ludovic Courtès @ 2022-05-09 9:44 UTC (permalink / raw) To: Philip McGrath Cc: Liliana Marie Prikler, Maxime Devos, Liliana Marie Prikler, 55248 Hi Philip, Philip McGrath <philip@philipmcgrath.com> skribis: > gnu: racket: Update to 8.5. > gnu: racket: Fix out-of-source build. > gnu: chez-scheme: Update to 9.5.8. > gnu: chez-scheme: Refactor documentation phases. > gnu: chez-scheme: Refactor configure phase and fix '--threads'. > gnu: stex: Get machine type dynamically. > gnu: chez-upstream-features-for-system: Improve implementation. > gnu: chez-scheme-for-racket: Fix supported systems. > gnu: chez-scheme-for-system: Adjust for bytecode backend. I applied the whole series (great work!), but stumbled upon this: --8<---------------cut here---------------start------------->8--- r:sha256 hash mismatch for /gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout: expected hash: 0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi actual hash: 0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx hash mismatch for store item '/gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout' build of /gnu/store/xsbp1m2bh5wn4h0pxc7rr5pz4w88jfns-racket-gui-8.5-checkout.drv failed --8<---------------cut here---------------end--------------->8--- Could it be that the v8.5 tag on that repo was modified in place? You can resent just this one patch if you want, if it’s just a matter of changing the hash. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. 2022-05-09 9:44 ` [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès @ 2022-05-12 3:50 ` Philip McGrath 2022-05-12 3:59 ` [bug#55248] [PATCH v4 1/9] gnu: racket: Update to 8.5 Philip McGrath 1 sibling, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-12 3:50 UTC (permalink / raw) To: Ludovic Courtès Cc: Liliana Marie Prikler, Maxime Devos, Liliana Marie Prikler, 55248 Hi, On 5/9/22 05:44, Ludovic Courtès wrote: > Hi Philip, > > Philip McGrath <philip@philipmcgrath.com> skribis: > >> gnu: racket: Update to 8.5. >> gnu: racket: Fix out-of-source build. >> gnu: chez-scheme: Update to 9.5.8. >> gnu: chez-scheme: Refactor documentation phases. >> gnu: chez-scheme: Refactor configure phase and fix '--threads'. >> gnu: stex: Get machine type dynamically. >> gnu: chez-upstream-features-for-system: Improve implementation. >> gnu: chez-scheme-for-racket: Fix supported systems. >> gnu: chez-scheme-for-system: Adjust for bytecode backend. > > I applied the whole series (great work!), but stumbled upon this: > > --8<---------------cut here---------------start------------->8--- > r:sha256 hash mismatch for /gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout: > expected hash: 0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi > actual hash: 0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx > hash mismatch for store item '/gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout' > build of /gnu/store/xsbp1m2bh5wn4h0pxc7rr5pz4w88jfns-racket-gui-8.5-checkout.drv failed > --8<---------------cut here---------------end--------------->8--- > > Could it be that the v8.5 tag on that repo was modified in place? > > You can resent just this one patch if you want, if it’s just a matter of > changing the hash. > Thanks for finding this! I will send the single revised patch in a separate email. The hashes for the "gui", "htdp", "redex", "typed-racket", "string-constants", and "syntax-color" origins needed to be updated. The v8.5 tags were not modified, but it looks like the v8.5 tags for those repositories included additional commits added after the first release candidate, which I had built early on. (The tag is created only when the release is actually released.) My best guess is that, somewhere in the process of amending this patch series, I had done a build with the commit and checksum for the first release candidate, but with the origin file name as though it were the 8.5 release. When I then changed these origins to point at the tag, I must not have changed the hashes, and I guess Guix saw that it already had store items with the correct name and hash and didn't try to download them again. I confirmed that this works by building on a computer where I hadn't built any of the earlier versions of this series (which took a little bit to set up). I'm not sure if there's a better way to prevent or check for this sort of problem in general. Just to be extra explicit, here's the diff between v3 and what I'm about to send as v4 1/9: > diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm > index 1f020f1276..c4183be210 100644 > --- a/gnu/packages/racket.scm > +++ b/gnu/packages/racket.scm > @@ -686,13 +686,13 @@ (define-public racket > "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") > '(("games" "."))) > (simple-racket-origin > - "gui" (base32 "0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi") > + "gui" (base32 "0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx") > '("gui" "gui-doc" "gui-lib" "tex-table")) > (simple-racket-origin > "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") > '("gui-pkg-manager-lib")) > (simple-racket-origin > - "htdp" (base32 "199qchdq6db6m2n4j861hiy4nxd6hg1qva16lhhdbfj274qmcplg") > + "htdp" (base32 "19xqixrqbwdxph17w9jga19008j88harb5wgml4hpqj3x0apx9g3") > '("htdp" "htdp-doc" "htdp-lib")) > (simple-racket-origin > "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") > @@ -830,7 +830,7 @@ (define-public racket > "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") > '(("realm" "."))) > (simple-racket-origin > - "redex" (base32 "0a1fl5s80k3j3xh3lri8886ql443m7pmgv18y7whzlmsd7x8rdpr") > + "redex" (base32 "18rn8ddsqh1s7hdlb2cb9wxln63bz0wysjssaf9v92r712xnnv8i") > '("redex" > "redex-benchmark" > "redex-doc" > @@ -877,7 +877,7 @@ (define-public racket > "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") > '("snip" "snip-lib")) > (simple-racket-origin > - "typed-racket" (base32 "05xlyjrx3m8xrrrw1xmfb1807qa5aqfl0zp9bdxwh2z7cfxaii09") > + "typed-racket" (base32 "0z6bagp6qiw0i3slhvq035y5hqgq664xw3bdlvdayad0bgbg0mdc") > '("source-syntax" > "typed-racket" > "typed-racket-compatibility" > @@ -888,13 +888,13 @@ (define-public racket > "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") > '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) > (simple-racket-origin > - "string-constants" (base32 "1rjs0gyw9hsiglwxnimz272v9xj1gwjxrnzh4qbsxkvdaphvi38m") > + "string-constants" (base32 "0b1ji31pv6bjb0a2bh9sqp5abvf91gn2rai8r4c4nkar1fzfwfac") > '("string-constants" "string-constants-doc" "string-constants-lib")) > (simple-racket-origin > "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") > '(("swindle" "."))) > (simple-racket-origin > - "syntax-color" (base32 "1xf3rl8687c1nar4kkgkvyncwi0gl696rif0iqhffg730fk457gi") > + "syntax-color" (base32 "17lb2403ymz6sflw4vs3gsh2y7kgsf0gn8sncsxjhi16rpj3a9vm") > '("syntax-color" "syntax-color-doc" "syntax-color-lib")) > (simple-racket-origin > "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") -Philip ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v4 1/9] gnu: racket: Update to 8.5. 2022-05-09 9:44 ` [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 2022-05-12 3:50 ` Philip McGrath @ 2022-05-12 3:59 ` Philip McGrath 1 sibling, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-12 3:59 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Ludovic Courtès, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, gnu/packages/patches/racket-enable-scheme-backport.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/chez.scm (chez-scheme-for-racket): Update to 9.5.7.6. * gnu/packages/racket.scm (%racket-version): Update to 8.5. (%racket-origin)[patches]: Remove obsolete patches. (racket-vm-common-configure-flags): Correct comment. (racket)[inputs]<2d, datalog, deinprogramm, draw, drracket, expeditor, htdp, pict, plot, quickscript, racklog, rackunit, redex, scribble, typed-racket, string-constants, syntax-color, web-server, xrepl>: Update checksums. <gui, srfi>: Likewise, and remove obsolete backports. --- gnu/local.mk | 2 - gnu/packages/chez.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 ------------------ ...acket-gui-tethered-launcher-backport.patch | 26 - gnu/packages/racket.scm | 82 ++- 5 files changed, 32 insertions(+), 547 deletions(-) delete mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch delete mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index ed901a5ba8..d7788796cc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1757,8 +1757,6 @@ 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-enable-scheme-backport.patch \ - %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index d47225dbe5..a7f75a731a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot> -;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com> +;;; Copyright © 2021, 2022 Philip McGrath <philip@philipmcgrath.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -361,7 +361,7 @@ (define-public chez-scheme-for-racket (package (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.5.7.3") + (version "9.5.7.6") ;; 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! diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch deleted file mode 100644 index 3a5a4a3d82..0000000000 --- a/gnu/packages/patches/racket-enable-scheme-backport.patch +++ /dev/null @@ -1,465 +0,0 @@ -From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 10:36:09 -0700 -Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` - -(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) - -(Fixed conflicts by dropping pbchunks and pbarch changes.) ---- - racket/src/ChezScheme/configure | 15 ++++++++++++++- - racket/src/ChezScheme/s/Mf-base | 4 ++-- - racket/src/ChezScheme/s/Mf-cross | 4 +++- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure -index 4515ffc105..0098829091 100755 ---- a/racket/src/ChezScheme/configure -+++ b/racket/src/ChezScheme/configure -@@ -45,6 +45,7 @@ threads=yes - nothreads=no - temproot="" - help=no -+forceworkarea=no - gzipmanpages=yes - installowner="" - installgroup="" -@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do - --pb) - pb=yes - ;; -+ --force) -+ forceworkarea=yes -+ ;; - --installprefix=*) - installprefix=`echo $1 | sed -e 's/^--installprefix=//'` - ;; -@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then - echo " --toolprefix=<prefix> prefix tool (compiler, linker, ...) names" - echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" - echo " --workarea=<pathname> build directory ($w)" -+ echo " --force configure even without boot files" - echo " CC=<C compiler> C compiler" - echo " CPPFLAGS=<C preprocessor flags> C preprocessor flags" - echo " CFLAGS=<C compiler flags> C compiler flags" -@@ -721,8 +726,16 @@ case "${flagsmuni}" in - ;; - esac - -+if [ "$w" = "$m" ] ; then -+ configuringin="" -+else -+ configuringin=" in $w" -+fi -+ - if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then -- echo "Configuring for $m" -+ echo "Configuring for $m$configuringin" -+elif [ "$forceworkarea" = yes ] ; then -+ echo "Configuring for $m$configuringin despite missing boot files" - else - if [ "$m" = "" ] ; then - maybem="<machine type>" -diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base -index cc6178c973..1f4a967998 100644 ---- a/racket/src/ChezScheme/s/Mf-base -+++ b/racket/src/ChezScheme/s/Mf-base -@@ -94,7 +94,7 @@ endif - # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme - # implementation - Scheme = ../bin/$m/scheme${ExeSuffix} --export SCHEMEHEAPDIRS=../boot/%m -+export SCHEMEHEAPDIRS=../boot/$m - export CHEZSCHEMELIBDIRS=. - - # Define the libdirs separator character -@@ -691,4 +691,4 @@ reset-one: - - .PHONY: run - run: -- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) -+ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) -diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross -index d796cbb459..397af59a28 100644 ---- a/racket/src/ChezScheme/s/Mf-cross -+++ b/racket/src/ChezScheme/s/Mf-cross -@@ -43,5 +43,7 @@ x$(xm).$(m): - $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch - mv xpatch x$(xm).$(m) - -+ifneq ($(SCHEMEHEAPDIRS),:) - # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed --nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot -+endif --- -2.32.0 - - -From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Sun, 6 Feb 2022 11:03:30 -0700 -Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable - -When the same Chez Scheme version as used by Racket is already -available, then `--enable-scheme=...` can supply an executable. For -cross builds, `--enable-scheme=...` can still supply a build -directory, instead, as before. - -(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) ---- - racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ - racket/src/README.txt | 30 +++++++++++--- - racket/src/configure | 8 +++- - racket/src/cs/README.txt | 6 ++- - racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- - racket/src/cs/c/configure | 24 +++++++++-- - racket/src/cs/c/configure.ac | 21 ++++++++-- - 7 files changed, 112 insertions(+), 24 deletions(-) - -diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in -index c396efc851..3998ef9ccd 100644 ---- a/racket/src/ChezScheme/makefiles/Makefile.in -+++ b/racket/src/ChezScheme/makefiles/Makefile.in -@@ -59,6 +59,9 @@ reset: - %.boot: - (cd $(workarea) && $(MAKE) $*.boot) - -+auto.boot: -+ (cd $(workarea) && $(MAKE) $(defaultm).boot) -+ - # <machine>.bootquick to build boot files for <machine> - # with o=3 d=0 for the cross compiler, and only after - # building the kernel for the configured machine -diff --git a/racket/src/README.txt b/racket/src/README.txt -index 98647aebce..d77310b4a4 100644 ---- a/racket/src/README.txt -+++ b/racket/src/README.txt -@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of - ======================================================================== - - Cross-compilation requires at least two flags to `configure`: -+`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) -+`--enable-scheme-SCHEME`. -+ -+More information: - - * `--host=OS`, where OS is something like `i386-gnu-linux` to - indicate the target platform. -@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: - run `configure` again (with no arguments) in a "local" subdirectory - to create a build for the current platform. - --An additional flag is needed for building Racket CS, unless the flag --`--enable-racket=auto` is used: -- -- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" -- directory where Chez Scheme is built for the host system. -+ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable -+ executable that runs on the build platform; the executable must be -+ the same version as used in Racket built for the target platform. -+ -+ Supplying `--enable-scheme=DIR` is also supported in cross-build -+ mode, where DIR is a path that has a "ChezScheme" directory where -+ Chez Scheme is built for the host system. -+ -+The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are -+allowed for non-cross builds, too: -+ -+ * For Racket CS, supplying either selects a Racket or Chez Scheme -+ implementation used to create boot files to the build platform. -+ Suppling Chez Scheme is a much more direct path, but when Racket is -+ supplied, its version does not have to match the version being -+ built. -+ -+ * For Racket BC, `--enable-racket=RACKET` selects a Racket for -+ prepare C sources to cooperate with garbage collection. Its version -+ needs to be close to the one being built, and potentially exactly -+ the same version. - - Some less commonly needed `configure` flags are for Racket BC: - -diff --git a/racket/src/configure b/racket/src/configure -index c9f3ba4419..1b53ec7ce2 100755 ---- a/racket/src/configure -+++ b/racket/src/configure -@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" - use_cs=maybe - use_bc=maybe - supplied_racket=no -+supplied_scheme=no - enable_boothelp= - - # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, -@@ -34,6 +35,9 @@ for arg in $*; do - --enable-racket=*) - supplied_racket=yes - ;; -+ --enable-scheme=*) -+ supplied_scheme=yes -+ ;; - --help | -h) - echo $0: - echo see --help-bc or --help-cs, since the Racket CS build and the -@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then - fi - - if test "$use_cs" = "yes" ; then -- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then -- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly -+ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then -+ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly - exit 1 - fi - -diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt -index 2ece417b78..8e6fc57b74 100644 ---- a/racket/src/cs/README.txt -+++ b/racket/src/cs/README.txt -@@ -39,6 +39,11 @@ build: - installed in the "../ChezScheme/boot/pb" directory as described by - "../ChezScheme/BUILDING". - -+ Supplying `--enable-scheme=...` is also an option if you alerady -+ have the same version of Chez Scheme built on the current platform. -+ Another build will be created, anyway, but more quickly than -+ without Chez Scheme. -+ - * Racket is needed to generate the files in the "schemified" - directory from the sources in sibling directories like "../io". The - Racket version must be practically the same as the current Racket -@@ -48,7 +53,6 @@ build: - Unlike Chez Scheme boot files, the files generated in "schemified" - are human-readable and -editable Scheme code. That provides a way - out of bootstrapping black holes, even without BC. -- - - - ======================================================================== -diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in -index 54a644a1d9..d73993f0fc 100644 ---- a/racket/src/cs/c/Makefile.in -+++ b/racket/src/cs/c/Makefile.in -@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ - SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) - SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme - SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) --SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot -+SCHEME_existing = @MAKE_SCHEME_SCHEME@ -+SCHEME = $(SCHEME@USE_SCHEME_MODE@) - - TARGET_MACH = @TARGET_MACH@ - SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) -@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. - @INCLUDEDEP@ @srcdir@/../../version/version.mak - - cs: -- $(MAKE) scheme@T_CROSS_MODE@ -+ $(MAKE) scheme@MAKE_SCHEME_MODE@ - $(MAKE) racket-so - cd rktio; $(MAKE) - $(MAKE) racketcs -@@ -121,9 +123,13 @@ racket-so: - - RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ - -+TARGET_MACH_built = $(TARGET_MACH) -+TARGET_MACH_existing = xc-$(TARGET_MACH) -+XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch -+ - CS_PROGS = SCHEME="$(SCHEME)" - CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ --CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" -+CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" - PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" - - build-racket-so: -@@ -163,6 +169,15 @@ pb-bootquick: - cd $(SCHEME_WORKAREA) && $(MAKE) reset - $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) - -+scheme-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot -+ $(MAKE) mach-make -+ -+$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: -+ mkdir -p $(SCHEME_WORKAREA) -+ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" -+ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all -+ - mach-make: - $(MAKE) config-scheme - cd $(SCHEME_WORKAREA) && $(MAKE) -@@ -182,24 +197,33 @@ config-scheme: - - scheme-cross: - env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt -+ $(MAKE) finish-scheme-cross -+ -+finish-scheme-cross: - $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) - cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t -- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+ $(MAKE) $(XPATCH_FILE) -+ -+scheme-cross-via-scheme: -+ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) -+ $(MAKE) finish-scheme-cross - - # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older --# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files --XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+# than the build-<host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files -+XPATCH_DEPS_built = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ -+ $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot -+XPATCH_DEPS_existing = -+XPATCH_DEPS = $(XPATCH_DEPS@USE_SCHEME_MODE@) - --$(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch: $(XPATCH_DEPS) -+$(XPATCH_FILE): $(XPATCH_DEPS) - $(MAKE) bounce TARGET=build-xpatch-using-host - - build-xpatch-using-host: - cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/s && $(MAKE) -f Mf-cross m=$(MACH) xm=$(TARGET_MACH) Scheme="$(SCHEME_BIN)" SCHEMEHEAPDIRS="$(SCHEME_INC)" - - XPATCH = --XPATCHcross = --xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+XPATCHcross = --xpatch $(XPATCH_FILE) - - racket.boot: racket.so - $(SCHEME) --script $(srcdir)/convert-to-boot.ss @BOOT_COMPRESS_COMP@ $(XPATCH@CROSS_MODE@) racket.so racket.boot $(TARGET_MACH) -@@ -410,7 +434,7 @@ install-cross: - $(MAKE) compile-xpatch.$(TARGET_MACH) - $(MAKE) library-xpatch.$(TARGET_MACH) - --SCHEME_XPATCH = $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch -+SCHEME_XPATCH = $(XPATCH_FILE) - - CROSS_SERVE_DEPS = $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss \ - $(srcdir)/../expander/env.ss $(srcdir)/../linklet/config.ss -diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure -index 21695a431a..1eeef57753 100755 ---- a/racket/src/cs/c/configure -+++ b/racket/src/cs/c/configure -@@ -654,6 +654,9 @@ MINGW - NOT_OSX - OSX - SETUP_BOOT_MODE -+USE_SCHEME_MODE -+MAKE_SCHEME_SCHEME -+MAKE_SCHEME_MODE - TT_CROSS_MODE - T_CROSS_MODE - CROSS_MODE -@@ -1448,7 +1451,7 @@ Optional Features: - --enable-docs build docs on install (enabled by default) - --enable-usersetup setup user-specific files on install - --enable-racket=<path> use <path> as Racket for build; or "auto" to create -- --enable-scheme=<path> use <path> as host's build directory for cross -+ --enable-scheme=<path> use <path> as host build for cross - --enable-mach=<mach> use Chez Scheme machine type <mach> - --enable-target=<mach> cross-build for Chez Scheme machine type <mach> - --enable-portable prefer portable to host-specific -@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" - show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' - - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - show_explicitly_enabled "${enable_portable}" "portable" -@@ -4745,9 +4748,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags - - - -+ -+ -+ - - - -diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac -index 464ebe1760..aaee88156d 100644 ---- a/racket/src/cs/c/configure.ac -+++ b/racket/src/cs/c/configure.ac -@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev - AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) - m4_include(../ac/path_arg.m4) - AC_ARG_ENABLE(racket, [ --enable-racket=<path> use <path> as Racket for build; or "auto" to create]) --AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host's build directory for cross]) -+AC_ARG_ENABLE(scheme, [ --enable-scheme=<path> use <path> as host build for cross]) - AC_ARG_ENABLE(mach, [ --enable-mach=<mach> use Chez Scheme machine type <mach>]) - AC_ARG_ENABLE(target, [ --enable-target=<mach> cross-build for Chez Scheme machine type <mach>]) - m4_include(../ac/portable_arg.m4) -@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" - show_explicitly_enabled "${enable_xonx}" "Unix style" - m4_include(../ac/path_show.m4) - show_explicitly_set "${enable_racket}" "Racket" --show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" -+show_explicitly_set "${enable_scheme}" "Chez Scheme for build" - show_explicitly_set "${enable_mach}" "machine type" - show_explicitly_set "${enable_target}" "cross-build machine type" - m4_include(../ac/portable_show.m4) -@@ -504,9 +504,21 @@ esac - - SCHEME_DIR=${srcdir}/../../ChezScheme - MAKE_BUILD_SCHEME=checkout -+USE_SCHEME_MODE="_built" -+MAKE_SCHEME_MODE="${T_CROSS_MODE}" - - if test "${enable_scheme}" != "" ; then -- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ if test -d "${enable_scheme}" ; then -+ # Directory exists, so use it as a build directory -+ echo "Using supplied Scheme path as a build directory" -+ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" -+ else -+ # Directory does not exist, so assume it's an executable -+ echo "Using supplied Scheme path as an executable" -+ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" -+ MAKE_SCHEME_SCHEME="${enable_scheme}" -+ USE_SCHEME_MODE="_existing" -+ fi - fi - - if test "${enable_racket}" != "" ; then -@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) - AC_SUBST(CROSS_MODE) - AC_SUBST(T_CROSS_MODE) - AC_SUBST(TT_CROSS_MODE) -+AC_SUBST(MAKE_SCHEME_MODE) -+AC_SUBST(MAKE_SCHEME_SCHEME) -+AC_SUBST(USE_SCHEME_MODE) - AC_SUBST(SETUP_BOOT_MODE) - AC_SUBST(OSX) - AC_SUBST(NOT_OSX) --- -2.32.0 - diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch deleted file mode 100644 index 1e018eaa79..0000000000 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 -From: Matthew Flatt <mflatt@racket-lang.org> -Date: Mon, 31 Jan 2022 15:31:22 -0700 -Subject: [PATCH] fix creation of tethered launchers - -Related to racket/racket#4133 - -(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) ---- - gui-lib/mred/installer.rkt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt -index b1691472..9ef06c53 100644 ---- a/gui-lib/mred/installer.rkt -+++ b/gui-lib/mred/installer.rkt -@@ -72,4 +72,5 @@ - (list "-A" (path->string (find-system-path 'addon-dir))))) - - (define (config-flags) -- (list "-G" (path->string (find-config-dir)))) -+ (list "-X" (path->string (find-collects-dir)) -+ "-G" (path->string (find-config-dir)))) --- -2.32.0 - diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 471a11dd48..c6f8ec20ba 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -195,7 +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! +(define %racket-version "8.5") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -205,11 +205,9 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (base32 "0f9zyhdvbh4xsndrqjzl85j5ziz0rmqi676g9s1lw3h3skq2636h")) (file-name (git-file-name "racket" %racket-version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch" - ;; Remove by Racket 8.5: - "racket-enable-scheme-backport.patch")) + (patches (search-patches "racket-minimal-sh-via-rktio.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -248,8 +246,10 @@ (define (racket-vm-common-configure-flags) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) "--disable-strip" - ;; XXX: origtree layout is required by some other packages down the - ;; bootstrap chain. Remove these flags as soon as we can do without them. + ;; Using --enable-origtree lets us distinguish the VM from subsequent + ;; layers and produces a build with the shape expected by tools such as + ;; "distro-build" and "raco-cross". Removing these flags would require + ;; changes, especially to 'configure-layer.rkt' (defined below). "--enable-origtree" ,(string-append "--prefix=" #$output "/opt/racket-vm"))) @@ -589,7 +589,7 @@ (define-public racket racket-minimal ;; <-- TODO non-tethered layer (racket-vm-for-system) (simple-racket-origin - "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + "2d" (base32 "0fb5v6058ls08xw3zbmqyr2ym0psm119gl9ffgmhm9w8rs9i4dq7") '("2d" "2d-doc" "2d-lib")) (simple-racket-origin "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") @@ -622,22 +622,22 @@ (define-public racket "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin - "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") '(("datalog" "."))) (simple-racket-origin "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + "deinprogramm" (base32 "0g8flr1qg3bcyhdinqhs4w7dyisaqyailbxrjgd2a7zlqmdyicfr") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") '("distributed-places" "distributed-places-doc" "distributed-places-lib")) (simple-racket-origin - "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + "draw" (base32 "1fpk85rs2crd63bxnmwj2pysisd62pxcqaip01si67dv1ri8ff92") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + "drracket" (base32 "0dipnz92c63zxys9z1kl5215rm7arc35g9r8bs8ivp96p75mljnz") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -657,7 +657,7 @@ (define-public racket "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") '("errortrace" "errortrace-doc" "errortrace-lib")) (simple-racket-origin - "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + "expeditor" (base32 "0mjfwb4wzwsg5xj3k6cmik0va432n56rp5h7rxx1c2yy3prh1j7q") '("expeditor" "expeditor-doc" "expeditor-lib")) (simple-racket-origin "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") @@ -670,25 +670,14 @@ (define-public racket (simple-racket-origin "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") '(("games" "."))) - (racket-packages-origin - "gui" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/gui") - (commit %racket-commit))) - (sha256 (base32 - "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (file-name (git-file-name "racket-gui" %racket-version))) + (simple-racket-origin + "gui" (base32 "0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + "htdp" (base32 "19xqixrqbwdxph17w9jga19008j88harb5wgml4hpqj3x0apx9g3") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -756,7 +745,7 @@ (define-public racket "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + "pict" (base32 "0v7a3l77swsbh80mnb9rakdwgw7s66ji0mall7qcqfwyg1b4zmlv") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -771,7 +760,7 @@ (define-public racket "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") '("planet" "planet-doc" "planet-lib")) (simple-racket-origin - "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + "plot" (base32 "04871pspbm0q3bz5896sa3jw2rp9i6jf0b5aivrxfp56vxxd2ybb") '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) (simple-racket-origin "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") @@ -786,7 +775,7 @@ (define-public racket (url "https://github.com/Metaxal/quickscript") (commit %racket-commit))) (sha256 (base32 - "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + "00sf5nw09aacd0l4a4cknnffvcs95p596im3blsdvfz5ck6jdwl8")) (file-name (git-file-name "Metaxal-quickscript" %racket-version))) '(("quickscript" "."))) (simple-racket-origin @@ -807,10 +796,10 @@ (define-public racket (git-file-name "jeapostrophe-racket-cheat" %racket-version))) '(("racket-cheat" "."))) (simple-racket-origin - "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + "racklog" (base32 "0fbq0fpfb3l6h7h772dvkmlzlk2dnq5f8296xx1qxhhwypibqzr9") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + "rackunit" (base32 "0vfwcddzrgrdv5awjka7m0jzqhqvfc5wlkih83a670y96496a83n") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -826,7 +815,7 @@ (define-public racket "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + "redex" (base32 "18rn8ddsqh1s7hdlb2cb9wxln63bz0wysjssaf9v92r712xnnv8i") '("redex" "redex-benchmark" "redex-doc" @@ -841,7 +830,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + "scribble" (base32 "0fbb7xgz95y90247hfc1a19v7ry8m6blvv4y8irdgzhjvik70zb3") '("scribble" "scribble-doc" "scribble-html-lib" @@ -873,35 +862,24 @@ (define-public racket "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + "typed-racket" (base32 "0z6bagp6qiw0i3slhvq035y5hqgq664xw3bdlvdayad0bgbg0mdc") '("source-syntax" "typed-racket" "typed-racket-compatibility" "typed-racket-doc" "typed-racket-lib" "typed-racket-more")) - (racket-packages-origin - "srfi" (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/srfi") - ;; Includes an FSDG fix: return to %racket-commit in 8.5. - ;; See <https://github.com/racket/srfi/pull/15>. - (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) - (sha256 (base32 - "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) - ;; Use the relevant version for srfi-doc and srfi-lib, - ;; since we're using a newer commit than the v8.4 tag. - (file-name (git-file-name "racket-srfi" "1.1"))) + (simple-racket-origin + "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + "string-constants" (base32 "0b1ji31pv6bjb0a2bh9sqp5abvf91gn2rai8r4c4nkar1fzfwfac") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") '(("swindle" "."))) (simple-racket-origin - "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + "syntax-color" (base32 "17lb2403ymz6sflw4vs3gsh2y7kgsf0gn8sncsxjhi16rpj3a9vm") '("syntax-color" "syntax-color-doc" "syntax-color-lib")) (simple-racket-origin "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") @@ -910,13 +888,13 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + "web-server" (base32 "1g4x79ym3mgxv4f3z3z84j12355pf44pjlzlb7f0h6r0i7p0cbjd") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") '("wxme" "wxme-lib")) (simple-racket-origin - "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + "xrepl" (base32 "19svg0jfs656bld5ikqipz3a5szk5k02zq5fh43209qw527dnfbk") '("xrepl" "xrepl-doc" "xrepl-lib")))) (build-system gnu-build-system) (arguments base-commit: b33ebc22fb2bb578c8150398538884439f36dfde -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* bug#55248: [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (9 preceding siblings ...) 2022-05-09 9:44 ` [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès @ 2022-05-12 10:32 ` Ludovic Courtès 10 siblings, 0 replies; 58+ messages in thread From: Ludovic Courtès @ 2022-05-12 10:32 UTC (permalink / raw) To: Philip McGrath Cc: Liliana Marie Prikler, 55248-done, Maxime Devos, Liliana Marie Prikler Hello, Philip McGrath <philip@philipmcgrath.com> skribis: > gnu: racket: Update to 8.5. > gnu: racket: Fix out-of-source build. > gnu: chez-scheme: Update to 9.5.8. > gnu: chez-scheme: Refactor documentation phases. > gnu: chez-scheme: Refactor configure phase and fix '--threads'. > gnu: stex: Get machine type dynamically. > gnu: chez-upstream-features-for-system: Improve implementation. > gnu: chez-scheme-for-racket: Fix supported systems. > gnu: chez-scheme-for-system: Adjust for bytecode backend. Pushed the whole series (including v4 for the first patch) as 3547bb6a66c32eb1deac46a98b40e2e051689ed3. It seems to work like a charm. :-) Thanks! Ludo’. ^ permalink raw reply [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 3/9] gnu: chez-scheme: Update to 9.5.8. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath ` (5 subsequent siblings) 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/chez.scm (chez-scheme): Update to 9.5.8. --- gnu/packages/chez.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index a7f75a731a..34545b1f58 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -210,7 +210,7 @@ (define-public chez-scheme (name "chez-scheme") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. - (version "9.5.6") + (version "9.5.8") (source (origin (method git-fetch) (uri (git-reference @@ -218,7 +218,7 @@ (define-public chez-scheme (commit (string-append "v" version)))) (sha256 (base32 - "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) (file-name (git-file-name name version)) (snippet #~(begin (use-modules (guix build utils)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 4/9] gnu: chez-scheme: Refactor documentation phases. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (2 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 3/9] gnu: chez-scheme: Update " Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath ` (4 subsequent siblings) 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Patches merged in both upstream Chez Scheme and Racket's variant will soon let us replace the 'install-docs' phase with just 'make install-docs'. Separating the 'link-doc-pdfs' phase (which won't change) leaves us well-prepared for the transition, regardless of whether Chez Scheme 9.5.10 or Racket 8.6 is released first. * gnu/packages/chez.scm (chez-scheme)[arguments]: Split 'install-doc' phase into 'install-docs' (matching the future 'make' target) and 'link-doc-pdfs'. --- gnu/packages/chez.scm | 64 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 34545b1f58..49051abd17 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -309,35 +309,43 @@ (define-public chez-scheme (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'install-symlink 'install-doc + (add-after 'install-symlink 'install-docs (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (match (assoc-ref outputs "doc") - (#f - (format #t "not installing docs~%")) - (doc-prefix - (let* ((chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))))) + (let* ((doc-prefix (or (assoc-ref outputs "doc") + (assoc-ref outputs "out"))) + (chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (define* (stex-make #:optional (suffix "")) + (invoke "make" "install" + (string-append "Scheme=" scheme) + (string-append "STEXLIB=" stexlib) + (string-append "installdir=" doc-dir suffix))) + (with-directory-excursion "csug" + (stex-make "/csug")) + (with-directory-excursion "release_notes" + (stex-make "/release_notes"))))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf"))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads'. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (3 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 6/9] gnu: stex: Get machine type dynamically Philip McGrath ` (3 subsequent siblings) 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Move Chez-specific logic into '#:configure-flags' and a new 'configure-environment-variables' phase, leaving the 'configure' phase as just a variant of the one from 'gnu-build-system' (including support for '#:out-of-source?') that doesn't add implicit Autoconf-style flags. In the process, do the right thing for "--threads", rather than assuming the only nonthreaded platform is broken. * gnu/packages/chez.scm (chez-scheme)[arguments]: Set configure flags in '#:configure-flags' and separate 'configure-environment-variables' from the residual 'configure' phase. More closely follow 'gnu-build-system'. Use 'chez-upstream-features-for-system' for "--threads". (chez-scheme-for-racket)[arguments]<#:configure-flags>: Add "--threads" unconditionally. --- gnu/packages/chez.scm | 63 ++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 49051abd17..785b6837c1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -258,8 +258,18 @@ (define-public chez-scheme (ice-9 ftw) (ice-9 match)) #:test-target "test" - ;; TODO when we fix armhf, it may not support --threads - #:configure-flags #~'("--threads") + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex @@ -273,26 +283,35 @@ (define-public chez-scheme (search-input-directory (or native-inputs inputs) "lib/chez-scheme-bootfiles") "boot"))) - ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; NOTE: The custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. (replace 'configure - (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) - ;; add flags which are always required: - (let ((flags (cons* (string-append "--installprefix=" #$output) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do compress-man-pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke "./configure" flags)))) + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) ;; The binary file name is called "scheme" as is the one from ;; MIT/GNU Scheme. We add a symlink to use in case both are ;; installed. @@ -385,7 +404,9 @@ (define-public chez-scheme-for-racket (arguments (substitute-keyword-arguments (package-arguments chez-scheme) ((#:configure-flags cfg-flags #~'()) - #~(cons "--disable-x11" #$cfg-flags)) + #~(cons* "--disable-x11" + "--threads" ;; ok to potentially duplicate + #$cfg-flags)) ((#:phases those-phases #~%standard-phases) #~(let* ((those-phases #$those-phases) (unpack (assoc-ref those-phases 'unpack))) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 6/9] gnu: stex: Get machine type dynamically. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (4 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath ` (2 subsequent siblings) 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine the machine type. --- gnu/packages/chez.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 785b6837c1..dd485d37e1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -602,6 +602,10 @@ (define-public stex-bootstrap ("src" "lib/stex/") ("Mf-stex" "lib/stex/") ("Makefile.template" "lib/stex/")) + #:modules + '((guix build copy-build-system) + (guix build utils) + (ice-9 popen)) #:phases #~(modify-phases %standard-phases (add-before 'install 'patch-sources @@ -633,8 +637,14 @@ (define-public stex-bootstrap (define makefile (string-append (getcwd) "/Makefile")) (define machine - #$(and=> (nix-system->chez-machine) - chez-machine->threaded)) + (let ((pipe (open-pipe* OPEN_BOTH scheme "-q"))) + ;; try to not be wrong for cross-compilation + ;; (avoid #% reader abbreviation for Guile) + (write '(($primitive $target-machine)) pipe) + (force-output pipe) + (let ((sym (read pipe))) + (close-pipe pipe) + (symbol->string sym)))) (with-directory-excursion (search-input-directory outputs "/lib/stex") (invoke "make" -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 7/9] gnu: chez-upstream-features-for-system: Improve implementation. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (5 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 6/9] gnu: stex: Get machine type dynamically Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler This commit is a follow-up to b8fc9169515ef1a6d6037c84e30ad308e5418b6f. While that commit fixed a breaking build, this one begins to address the faulty assumptions that lead to the failure: see also <https://issues.guix.gnu.org/54292#6>. In this commit, we reimplement 'chez-upstream-features-for-system' using the new '%chez-features-table', which explicitly specifies platform support for both 'chez-scheme' and 'chez-scheme-for-racket', rather than assuming a non-false result from 'nix-system->chez-machine' means that the system is supported. The remaining uses of 'nix-system->chez-machine' still make that incorrect assumption and must be repaired in a future commit. * gnu/packages/chez.scm (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): Replace with ... (target-chez-arch, target-chez-os): ... these new variables. (nix-system->chez-machine): Rewrite using them. (%chez-features-table): New variable. (chez-upstream-features-for-system): Rewrite using it. (chez-scheme)[supported-systems]: Update armhf-linux comment. (chez-scheme-bootstrap-bootfiles)[supported-systems]: Use 'chez-upstream-features-for-system'. (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system): Remove unused functions. --- gnu/packages/chez.scm | 234 ++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 100 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dd485d37e1..41f083e0ac 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -49,8 +49,6 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system nix-system->chez-machine - chez-machine->nonthreaded - chez-machine->threaded unpack-nanopass+stex)) ;; Commentary: @@ -82,68 +80,57 @@ (define* (chez-scheme-for-system #:optional chez-scheme chez-scheme-for-racket)) -(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 -MACHINE. The returned string may share storage with MACHINE." - ;; Chez Scheme documentation consistently uses "nonthreaded" rather than - ;; e.g. "unthreaded" - (if (eqv? #\t (string-ref machine 0)) - (substring machine 1) - machine)) -(define (chez-machine->threaded machine) - "Like @code{chez-machine->nonthreaded}, but returns the threaded machine -type." - (if (eqv? #\t (string-ref machine 0)) - machine - (string-append "t" machine))) - -;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt -;; in https://github.com/racket/raco-cross. -;; For supported platforms, refer to release_notes/release_notes.stex in the -;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md -;; in https://github.com/racket/racket. -(define %nix-arch-to-chez-alist - `(("x86_64" . "a6") - ("i386" . "i3") - ("aarch64" . "arm64") - ("armhf" . "arm32") ;; Chez supports ARM v6+ - ("ppc" . "ppc32"))) -(define %nix-os-to-chez-alist - `(("w64-mingw32" . "nt") - ("darwin" . "osx") - ("linux" . "le") - ("freebsd" . "fb") - ("openbsd" . "ob") - ("netbsd" . "nb") - ("solaris" . "s2"))) - -(define (chez-machine->nix-system machine) - "Return the Nix system type corresponding to the Chez Scheme machine type -MACHINE. If MACHINE is not a string representing a known machine type, an -exception is raised. This function does not distinguish between threaded and -nonthreaded variants of MACHINE. +(define* (target-chez-arch #:optional (system + (or (%current-target-system) + (%current-system)))) + "Return a string representing the architecture of SYSTEM as used in Chez +Scheme machine types, or '#f' if none is defined." + (cond + ((target-x86-64? system) + "a6") + ((target-x86-32? system) + "i3") + ((target-aarch64? system) + "arm64") + ((target-arm32? system) + "arm32") + ((target-ppc64le? system) + #f) + ((target-ppc32? system) + "ppc32") + ((target-riscv64? system) + #f) + (else + #f))) -Note that this function only handles Chez Scheme machine types in the -strictest sense, not other kinds of descriptors sometimes used in place of a -Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or -@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type -for the host system is often still relevant.)" - (let ((machine (chez-machine->nonthreaded machine))) - (let find-arch ((alist %nix-arch-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (string-prefix? chez machine) - (string-append - nix "-" (let ((machine-os - (substring machine (string-length chez)))) - (let find-os ((alist %nix-os-to-chez-alist)) - (match alist - (((nix . chez) . alist) - (if (equal? chez machine-os) - nix - (find-os alist))))))) - (find-arch alist))))))) +(define* (target-chez-os #:optional (system (or (%current-target-system) + (%current-system)))) + "Return a string representing the operating system kernel of SYSTEM as used +in Chez Scheme machine types, or '#f' if none is defined." + ;; e.g. "le" includes both GNU/Linux and Android + (cond + ((target-linux? system) + "le") + ((target-hurd? system) + #f) + ((target-mingw? system) + "nt") + ;; missing (guix utils) predicates + ;; cf. https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix + ((string-suffix? "-darwin" system) + "osx") + ((string-suffix? "-freebsd" system) + "fb") + ((string-suffix? "-openbsd" system) + "ob") + ((string-suffix? "-netbsd" system) + "nb") + ;; Nix says "x86_64-solaris", but accommodate "-solaris2" + ((string-contains system "solaris") + "s2") + ;; unknown + (else + #f))) (define* (nix-system->chez-machine #:optional (system (or (%current-target-system) @@ -153,16 +140,81 @@ (define* (nix-system->chez-machine #:optional machine type is undefined. It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type: when the distinction is relevant, use -@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust -the result." - (let* ((hyphen (string-index system #\-)) - (nix-arch (substring system 0 hyphen)) - (nix-os (substring system (+ 1 hyphen))) - (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) - (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) +nonthreaded machine type." + (let* ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) (and chez-arch chez-os (string-append chez-arch chez-os)))) +(define %chez-features-table + ;; An alist of alists mapping: + ;; os -> arch -> (or/c #f (listof symbol?)) + ;; where: + ;; - `os` is a string for the OS part of a Chez Scheme machine type; and + ;; - `arch` is a string for the architecture part of a Chez machine type. + ;; + ;; The absence of an entry for a given arch--os pair means that neither + ;; upstream Chez Scheme nor the Racket variant can generate native code for + ;; that system. (The Racket variant can still provide support via its + ;; ``portable bytecode'' backends and optional compilation to C.) A value + ;; of `#f` means that upstream Chez Scheme does not support the arch--os + ;; pair at all, but the Racket variant does. A list has the same meaning as + ;; a result from `chez-upstream-features-for-system`. + ;; + ;; The arch--os pairs marked "commented out" have been commented out in the + ;; STeX source for the upstream release notes since the initial release as + ;; free software, but they are reported to work and/or have been described + ;; as supported by upstream maintainers. + ;; + ;; For this overall approach to make sense, we assume that Racket's variant + ;; of Chez Scheme can generate native code for a superset of the platforms + ;; supported upstream, supports threads on all platforms it supports at all + ;; (because they are needed for Racket), and doesn't need bootstrap + ;; bootfiles. Those assumptions have held for several years. + '(;; Linux + ("le" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm32" bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" threads)) + ;; FreeBSD + ("fb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenBSD + ("ob" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; NetBSD + ("nb" + ("i3" threads) ;; commented out + ("a6" threads) ;; commented out + ("arm32" . #f) + ("arm64" . #f) + ("ppc32" . #f)) + ;; OpenSolaris / OpenIndiana / Illumos + ("s2" + ("i3" threads) ;; commented out + ("a6" threads)) ;; commented out + ;; Windows + ("nt" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ;; ^ threads "experiemental", but reportedly fine + ("arm64" . #f)) + ;; Darwin + ("osx" + ("i3" threads bootstrap-bootfiles) + ("a6" threads bootstrap-bootfiles) + ("arm64" . #f) + ("ppc32" . #f)))) + (define* (chez-upstream-features-for-system #:optional (system (or (%current-target-system) @@ -172,20 +224,14 @@ (define* (chez-upstream-features-for-system #:optional does not support SYSTEM at all. If native threads are supported, the returned list will include -@code{'threads}. Other feature symbols may be added in the future." - (cond - ((not (nix-system->chez-machine system)) - #f) - ((target-aarch64? system) - #f) - ((target-arm32? system) - (and (target-linux? system) - '())) - ((target-ppc32? system) - (and (target-linux? system) - '(threads))) - (else - '(threads)))) +@code{'threads}. If bootstrap bootfiles for SYSTEM are distributed in the +upstream Chez Scheme repository, the returned list will include +@code{'bootstrap-bootfiles}. Other feature symbols may be added in the +future." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and=> (assoc-ref %chez-features-table chez-os) + (cut assoc-ref <> chez-arch)))) ;; ;; Chez Scheme: @@ -365,14 +411,9 @@ (define-public chez-scheme ((pth) (symlink pth "csug.pdf"))))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. (supported-systems (delete - "armhf-linux" ;; <-- should work, but reportedly broken + "armhf-linux" ;; XXX reportedly broken, needs checking (filter chez-upstream-features-for-system %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") @@ -471,16 +512,9 @@ (define-public chez-scheme-bootstrap-bootfiles (list #:install-plan #~`(("boot/" "lib/chez-scheme-bootfiles")))) (supported-systems - ;; Upstream only distributes pre-built bootfiles for - ;; arm32le and t?(i3|a6)(le|nt|osx) (filter (lambda (system) - (let ((machine (and=> (nix-system->chez-machine system) - chez-machine->nonthreaded))) - (or (equal? "arm32le" machine) - (and machine - (member (substring machine 0 2) '("i3" "a6")) - (or-map (cut string-suffix? <> machine) - '("le" "nt" "osx")))))) + (and=> (chez-upstream-features-for-system system) + (cut memq 'bootstrap-bootfiles <>))) %supported-systems)) (synopsis "Chez Scheme bootfiles (binary seed)") (description -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 8/9] gnu: chez-scheme-for-racket: Fix supported systems. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (6 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler This commit fixes the treatment of systems like "powerpc-w64-mingw32", where the combination of architecture and kernel is not supported, even though both are supported in other combinations. The build failure fixed in b8fc9169515ef1a6d6037c84e30ad308e5418b6f highlighted this problem: see also <https://issues.guix.gnu.org/54292#6>. The correct support status is specified by '%chez-features-table', which was added to improve 'chez-upstream-features-for-system': this commit uses it to fix the repair. Once the issues in <https://racket.discourse.group/t/950> are resolved, 'chez-scheme-for-racket' and 'racket-vm-cs' will be able to run even on systems for which native code generation is not supported. It's not clear what behavior would be useful from 'nix-system->chez-machine': since the current implementation is flawed and easy to misuse, we remove it for now, replacing the remaining uses with 'racket-cs-native-supported-system?'. * gnu/packages/chez.scm (nix-system->chez-machine): Remove it. (racket-cs-native-supported-system?): New variable. (chez-scheme-for-racket)[supported-systems]: Use it. * gnu/packages/racket.scm (racket-vm-for-system): Likewise. --- gnu/packages/chez.scm | 32 +++++++++++++++++--------------- gnu/packages/racket.scm | 7 +++++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 41f083e0ac..cae17580f8 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system - nix-system->chez-machine + racket-cs-native-supported-system? unpack-nanopass+stex)) ;; Commentary: @@ -132,19 +132,6 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) (else #f))) -(define* (nix-system->chez-machine #:optional - (system (or (%current-target-system) - (%current-system)))) - "Return the Chez Scheme machine type corresponding to the Nix system -identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme -machine type is undefined. - -It is unspecified whether the resulting string will name a threaded or a -nonthreaded machine type." - (let* ((chez-arch (target-chez-arch system)) - (chez-os (target-chez-os system))) - (and chez-arch chez-os (string-append chez-arch chez-os)))) - (define %chez-features-table ;; An alist of alists mapping: ;; os -> arch -> (or/c #f (listof symbol?)) @@ -233,6 +220,19 @@ (define* (chez-upstream-features-for-system #:optional (and=> (assoc-ref %chez-features-table chez-os) (cut assoc-ref <> chez-arch)))) +(define* (racket-cs-native-supported-system? #:optional + (system + (or (%current-target-system) + (%current-system)))) + "Can Racket's variant of Chez Scheme generate native code for SYSTEM? +Otherwise, SYSTEM can use only the ``portable bytecode'' backends." + (let ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system))) + (and (and=> (assoc-ref %chez-features-table chez-os) + ;; NOT assoc-ref: supported even if cdr is #f + (cut assoc chez-arch <>)) + #t))) + ;; ;; Chez Scheme: ;; @@ -459,7 +459,9 @@ (define-public chez-scheme-for-racket (add-after 'unpack 'chdir (lambda args (chdir "racket/src/ChezScheme")))))))) - (supported-systems (filter nix-system->chez-machine + ;; TODO: How to build pbarch/pbchunks for other systems? + ;; See https://racket.discourse.group/t/950 + (supported-systems (filter racket-cs-native-supported-system? %supported-systems)) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 904dfe9bef..1f020f1276 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -190,8 +190,11 @@ (define-module (gnu packages racket) (define* (racket-vm-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." - (if (nix-system->chez-machine system) + "Return 'racket-vm-cs' if we are able to build it for SYSTEM; 'racket-vm-bc' +otherwise." + ;; Once we figure out the issues in https://racket.discourse.group/t/950, + ;; we can use 'racket-vm-cs' everywhere. + (if (racket-cs-native-supported-system? system) racket-vm-cs racket-vm-bc)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
* [bug#55248] [PATCH v2 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend. 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath ` (7 preceding siblings ...) 2022-05-08 20:07 ` [bug#55248] [PATCH v2 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath @ 2022-05-08 20:07 ` Philip McGrath 8 siblings, 0 replies; 58+ messages in thread From: Philip McGrath @ 2022-05-08 20:07 UTC (permalink / raw) To: 55248 Cc: Liliana Marie Prikler, Maxime Devos, Philip McGrath, Liliana Marie Prikler Change 'chez-scheme-for-system' to return 'chez-scheme-for-racket' in two cases when it previously returned 'chez-scheme': 1. When 'chez-scheme' is not distributed with bootstrap bootfiles, since we can only cross-compile 'chez-scheme' for those systems; and 2. When neither 'chez-scheme' nor 'chez-scheme-for-racket' supports native code generation, since we will be able to use the ``portable bytecode'' backends of 'chez-scheme-for-racket' as soon as the issues in <https://racket.discourse.group/t/950> are resolved. * gnu/packages/chez.scm (chez-scheme-for-racket): Change condition. --- gnu/packages/chez.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index cae17580f8..7e6273f26a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -69,14 +69,17 @@ (define-module (gnu packages chez) (define* (chez-scheme-for-system #:optional (system (or (%current-target-system) (%current-system)))) - "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, -including support for native threads." - (if (or - ;; full support upstream - (and=> (chez-upstream-features-for-system system) - (cut memq 'threads <>)) - ;; no support anywhere - (not (nix-system->chez-machine system))) + "Return 'chez-scheme' if it fully supports SYSTEM, including support for +bootstrapping and native threads. Otherwise, return +'chez-scheme-for-racket'." + (if (and=> (chez-upstream-features-for-system system) + (lambda (features) + (every (cut memq <> features) + '(threads + ;; We can cross-compile for platforms without + ;; bootstrap bootfiles, but we can't self-host + ;; on them short of adding more binary seeds. + bootstrap-bootfiles)))) chez-scheme chez-scheme-for-racket)) -- 2.32.0 ^ permalink raw reply related [flat|nested] 58+ messages in thread
end of thread, other threads:[~2022-05-12 10:49 UTC | newest] Thread overview: 58+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-03 18:31 [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 1/7] gnu: racket: Update to 8.5 Philip McGrath 2022-05-04 6:53 ` Liliana Marie Prikler 2022-05-05 21:49 ` Philip McGrath 2022-05-06 6:37 ` Liliana Marie Prikler 2022-05-07 18:39 ` Philip McGrath 2022-05-07 20:01 ` Maxime Devos 2022-05-03 18:33 ` [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build Philip McGrath 2022-05-04 9:29 ` Maxime Devos 2022-05-05 18:53 ` Philip McGrath 2022-05-05 19:52 ` Liliana Marie Prikler 2022-05-05 20:36 ` Maxime Devos 2022-05-05 20:33 ` Maxime Devos 2022-05-05 21:55 ` Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 3/7] gnu: chez-scheme: Update to 9.5.8 Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 4/7] gnu: chez-scheme: Refactor documentation phases Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 5/7] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 6/7] gnu: stex: Get machine type dynamically Philip McGrath 2022-05-04 6:58 ` Liliana Marie Prikler 2022-05-05 19:39 ` Philip McGrath 2022-05-03 18:33 ` [bug#55248] [PATCH 7/7] gnu: chez-scheme-for-system: Adjust support logic Philip McGrath 2022-05-04 7:21 ` Liliana Marie Prikler 2022-05-05 20:42 ` Philip McGrath 2022-05-06 7:08 ` Liliana Marie Prikler 2022-05-07 19:18 ` Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 2/9] gnu: racket: Fix out-of-source build Philip McGrath 2022-05-09 3:54 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 0/9] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 2/9] gnu: racket: Fix out-of-source build Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 3/9] gnu: chez-scheme: Update to 9.5.8 Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 6/9] gnu: stex: Get machine type dynamically Philip McGrath 2022-05-09 6:02 ` [bug#55248] [PATCH v3 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath 2022-05-09 6:21 ` Liliana Marie Prikler 2022-05-09 7:20 ` Philip McGrath 2022-05-09 7:41 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath 2022-05-09 6:34 ` Liliana Marie Prikler 2022-05-09 7:55 ` Philip McGrath 2022-05-09 9:36 ` Liliana Marie Prikler 2022-05-12 5:26 ` Philip McGrath 2022-05-12 8:04 ` Liliana Marie Prikler 2022-05-09 6:02 ` [bug#55248] [PATCH v3 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath 2022-05-09 9:44 ` [bug#55248] [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 2022-05-12 3:50 ` Philip McGrath 2022-05-12 3:59 ` [bug#55248] [PATCH v4 1/9] gnu: racket: Update to 8.5 Philip McGrath 2022-05-12 10:32 ` bug#55248: [PATCH 0/7] gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8 Ludovic Courtès 2022-05-08 20:07 ` [bug#55248] [PATCH v2 3/9] gnu: chez-scheme: Update " Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 4/9] gnu: chez-scheme: Refactor documentation phases Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 5/9] gnu: chez-scheme: Refactor configure phase and fix '--threads' Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 6/9] gnu: stex: Get machine type dynamically Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 7/9] gnu: chez-upstream-features-for-system: Improve implementation Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 8/9] gnu: chez-scheme-for-racket: Fix supported systems Philip McGrath 2022-05-08 20:07 ` [bug#55248] [PATCH v2 9/9] gnu: chez-scheme-for-system: Adjust for bytecode backend Philip McGrath
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.