Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc.

From: Liliana Marie Prikler <[email-masked]>
Date: Sun, 20 Feb 2022 10:03:26 +0100

Am Samstag, dem 19.02.2022 um 17:27 -0500 schrieb Philip McGrath:
> Hi,
> 
> On Saturday, February 19, 2022 3:46:47 PM EST you wrote:
> > Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath:
> > > * gnu/packages/patches/racket-enable-scheme-backport.patch: New
> > > patch.
> > > * gnu/local.mk (dist_patch_DATA): Add it.
> > > * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez-
> > > submodules,
> > > %racket-version, %racket-origin, racket-vm-cgc): New variables.
> > > (chez-scheme)[source]<snippet>: Use 'unbundle-chez-submodules'.
> > 
> > Something weird happened to me just now trying to build this
> > series.  While compiling emacs-xyz, an error was raised regarding
> > %racket-version not existing and and import being missing. 
> > Assuming that you didn't mess up an include somewhere, there could
> > be a cycle meaning we'd have to pass the version and origin by
> > function as I originally said in my reply to v2.
> > 
> > I'll clean up my work tree and try to reapply it, but that will
> > take some time.  Since you mentioned re-exports causing issues, I'd
> > like to ask if you've made a similar experience, but the results
> > got somehow hidden after the right incantations.
> 
> I haven't seen errors from emacs-xyz, but I have gotten errors about
> %racket-version not existing: at the time I thought it was just a
> problem with incremental rebuilds while moving back and forward
> through history, but, having just refreshed my memory on more details
> of the cyclic issues, I think it may be related. I'll send another
> email presently with details once I've gathered references.
> 
> For now, I found that `rm gnu/packages/*.go` was enough to get `make`
> to succeed again.
As you said, the clean build succeeds, but I still think we should do
something about incremental rebuilds.  So here's my suggestion:

Inside chez-and-racket-bootstrap, define (make-<package>) functions for
the following:
- chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles:
  Taking version and origin.
- racket-vm-cgc: Taking version and origin.
- racket-vm-bc: Taking racket-vm-cgc.
- racket-vm-cs: Taking racket-vm-bc.

Inside chez, define chez-scheme, as well as non-bootstrapped versions
of stex et al.
Also define make-chez-scheme-for-racket, taking version and origin as
parameter.  Finally, define chez-scheme-for-system, which uses
(resolve-interface '(gnu packages racket)) to get racket's version and
origin.

Inside racket, define %racket-version, %racket-origin, racket-minimal
and racket.  It'd also be good if you made local definitions
(define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket-
origin))
(define racket-vm-bc (make-racket-vm-bc racket-vm-cgc))
...
in this file.

With this split, it should be possible to do incremental builds without
stuff breaking.

Cheers