[racket-dev] [racket] Code compiled for version ~a, not ~a

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Sep 20 11:48:40 EDT 2011

At Tue, 20 Sep 2011 00:56:01 -0400, Guillaume Marceau wrote:
> When I was doing it earlier, I was skipping the 'raco setup -D' step.
> I was under the impression that the 'raco link' operation updated the
> necessary info-domain/compiled/cache.rktd files automatically. When I
> add or remove a directory from PLTCOLLECTS, I don't need to re-run
> 'raco setup'. So long as the tool's collect has been compiled once
> before, it loads correctly. I was expecting the same behavior from
> 'raco link'
> We can either fix 'raco link's behavior to match my brain, or fix my
> brain to match raco's. Either-or.

When you add a directory to PLTCOLLECTS, then the `info-domain'
information is stored with the added directory. When you use `raco
link', then the `info-domain' information goes into the default
user-specific collection directory or the installation's collection
directory (depending on whether it's a user-specific link or an
installation-wide link).

That's why tool lookup behaves the current way. The intent of the
`info-domain' cache is to avoid querying all collections; there's one
cache per PLTCOLLECTS element, because the intent was to have a few
PLTCOLLECTS paths. In contrast, `raco link' is expected to be used to
link many collections, and so all user-specific or
installation-specific collections are grouped together. But maybe the
choices could be different.

For what it's worth, while setting PLTCOLLECTS lets DrRacket see a
previously built tool, but it doesn't let the documentation search see
the associated documentation. In that case, `raco setup' is needed for
both PLTCOLLECTS and `raco link'. Of course, you're using `raco setup
-D', so documentation isn't an issue for your purposes, but it's
another illustration of how parts of Racket expect `raco setup' for an
installed collection.

Posted on the dev mailing list.