Subject: [bug#53878] [PATCH v4 00/15] Update Racket to 8.4. Adjust Chez Scheme packages.

From: Philip McGrath <[email-masked]>
Date: Sun, 20 Feb 2022 01:05:55 -0500

Hi,

Here is v4. I believe it avoids the import cycle.

The first change from v3 is in patch 09/15, in which I changed
"gnu/packages/chez-and-racket-bootstrap.scm" no longer export
`%racket-version` or `%racket-origin`. The package `source` field is not
thunked, so exporting the latter seems like a particular trap for the unwary.

In 14/15, I looked again at the issue with `chez-scheme-for-system` that
Liliana reported in <https://issues.guix.gnu.org/53878#89>, and I realized my
intention had actually been to return `chez-scheme` if the specified system is
completely unsupported (not that it makes much difference ...). I tweaked it
slightly and added comments, since I've gotten confused about it more than
once now.

The changes to avoid the import cycle are primarily in 15/15. As I outlined
in <https://issues.guix.gnu.org/53878#93>, I duplicated the definition of
`%racket-version` in "gnu/packages/racket.scm" and added comments there and to
"gnu/packages/chez-and-racket-bootstrap.scm" warning to keep them in sync.

I also had to avoid the use of `%racket-origin` (or `(package-source
(racket-vm-for-system))`) outside of lambda abstractions, which in particular
meant that it could no longer be used in the `source` field of
`racket-minimal`. Instead, I changed `racket-minimal` to handle "base" and
"racket-lib" in the same way `racket` does for its component Racket
packages. Recalling Liliana's comment
in <https://issues.guix.gnu.org/53878#65>, since I was lifting the function
to handle Racket package origins anyway to reuse it, I changed it to produce
`computed-file`s that take care of extracting the right files from the origin,
so `racket-minimal` can now use `union-build` and `racket` no longer needs to
replace the build phase.

I can immagine a `racket-build-system` helping to improve the situation, since
it would presumably add `(racket-vm-for-system)` as an implicit input. It
might also be useful to provide special support for packages from the main
Racket Git repository: almost always, if you change transform the origin for
the Racket VM, you want all of the packages developed in the same repository
to use come from the transformed origin, too.

But for now, v4 should avoid the import cycle problem without doing anything
too ugly.

 -Philip

Philip McGrath (15):
  gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap).
  gnu: chez-scheme: Use "lib/chez-scheme" for search path.
  gnu: chez-scheme: Use shared zlib and lz4.
  gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types.
  gnu: chez-scheme: Use new package style.
  gnu: Add stex.
  gnu: Add chez-nanopass.
  gnu: chez-scheme: Explicitly package bootstrap bootfiles.
  gnu: Add racket-vm-cgc.
  gnu: Add racket-vm-bc.
  gnu: Add chez-scheme-for-racket.
  gnu: Add racket-vm-cs.
  gnu: chez-mit: Support chez-scheme-for-racket.
  gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'.
  gnu: racket: Update to 8.4.

 gnu/local.mk                                  |    5 +-
 gnu/packages/chez-and-racket-bootstrap.scm    | 1077 +++++++++++
 gnu/packages/chez.scm                         |  628 +++----
 gnu/packages/emacs-xyz.scm                    |    4 +-
 gnu/packages/loko.scm                         |    4 +-
 .../racket-enable-scheme-backport.patch       |  465 +++++
 ...acket-gui-tethered-launcher-backport.patch |   26 +
 gnu/packages/racket.scm                       | 1599 +++++++++++------
 8 files changed, 2871 insertions(+), 937 deletions(-)
 create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm
 create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch
 create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch

-- 
2.32.0