[racket-dev] PLaneT(2): Single vs multi-collection packages

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jun 6 10:00:30 EDT 2013

At Thu, 6 Jun 2013 13:36:38 +0200, Laurent wrote:
> > Some other the details:
> >
> >  * A package's mode is recorded in the installed-package table.
> >    Otherwise, a linked package could switch modes just because the
> >    package directory's content changes, which would be difficult to
> >    keep in sync with the low-level table of links.
> >
> 
> Does it handle the  case where user A installs B's single-collection
> package,
> and at some point B changes its package to a multi-collection package,
> triggering the updating of A's installation?

Yes.


> What I'd like is to have single-collection being the default [...]
> 
> So here is a demo patch attached to precise what I mean (without
> test, would have taken me way too much time). Because it considers
> that single-collections are the default, it is backward incompatible.
> If info.rkt exists, it looks for 'multi-collection, and otherwise
> looks for the 'collection-name string.

I could go along with this, as long as (most?) everyone agrees, and as
long as package authors are willing to update existing packages.

If we go that way, then I'd characterize a single-collection package
without 'single-collection' in "info.rkt" as a low-quality package, but
a low-quality package is a fine starting point for a high-quality
package.


> If info.rkt does not exist, it creates it and gives the 'collection-name
> the name of the package by default.

That doesn't seem like a good idea to me. As you've noted, there can be
problems with writing extra files. The collection name could be instead
computed in `pkg-single-collection', which would treat the absence of
an "info.rkt" to mean single-collection mode, right?


Some calls to `pkg-single-collection' would need to change to pass in
a package name to use instead of the `dir' name, since the `dir'
argument is sometimes a temporary directory that is used to stage a
package. That's an easy change.


Posted on the dev mailing list.