[racket-dev] package scopes

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jul 25 13:59:04 EDT 2013

We currently have three packages scopes:

 * 'installation --- specific to an installation of Racket, where
    package files are written into the installation (for all users of
    the installation)

 * 'user --- specific to a user and version, where packages files are
    written to a user-specific location

 * 'shared --- specific to a user, but not to a version of Racket

I think we should change to two:

 * 'installation --- like now

 * 'user --- specific to a user and "installation", but where
    installations are identified by a configurable name (as opposed to,
    say, the installation's path)

That is, every installation has a name. For a release, the name
defaults to the release version. For a snapshot, the name defaults to
"snapshot" --- which means that when you throw away your snapshot and
install a new one, then you keep your package installations.
(Distributors of releases and snapshots can adjust the default,
obviously.) For a repository checkout, the name defaults to "checkout"
--- which means that you keep your package installations when you `git
pull' and the version changes.

An installation name would be stored in the same configuration file
that is used for package catalogs. A user who wants multiple snapshot
installations, git-repo checkouts with different package sets, or
multiple installations of Racket v6.0 can adjust one installation's
name in its configuration. Similarly, a user who really wants to share
packages between Racket v6.0 and v6.1 can give the installations the
same name.

I think this change would make the 'user installation scope the right
default for pretty much everyone, instead of trying to make the default
'user under some circumstances and 'installation in others. I think it
also covers the goal of 'shared better than 'shared does.


Posted on the dev mailing list.