[racket-dev] `raco link', "links.rktd", "pkgs", and "config.rktd"

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jun 25 16:49:56 EDT 2013

Caveat 1: In case you don't use the top-level default `make' target
when building from the repo, this change means that you need to run
`make pkg-links' when you next update.

Caveat 2: Feel free to skip the rest. This message is on the far end of
what most of us care about in the package system. I think the changes
are unavoidable, though, and I think the mostly get us to a complete
and consistent design point for multi-user installations (likely
common) and "/usr" versus "/usr/lib" conventions (not so much, but I
think there is demand for that).


When single-collection packages become the default, I don't see much
use for `raco link', and instead it will be better for most of us to
use `raco pkg install --link'. But I see `raco link' sticking around as
an layer that some may want to use or look inside.

To bring `raco link' and `raco pkg' more in line with each other, and
to generally clean up a mistake (IMO) in `raco link', I've changed the
behavior of `raco link -u' to be like `raco pkg ... -u': it installs a
link in a user- and version-specific way, instead of in a user-specific
but all-version way.

Naturally, the `raco link' command now supports `-s'/`--shared', just
like `raco pkg'.

Links installed with `-u' now go into a "links.rktd" file that's in the
version-labeled directory in the user's add-on directory, instead of in
"links.rktd" (with a version regexp) outside the version-labeled
directory.


The "config.rktd" file in "etc" can now specify a location for the
installation-wide "links.rktd" file and "pkgs" installed-package
directory (with its "pkgs.rktd"). Furthermore, "config.rktd" can
provide a list of additional files/directories to search. This allows
the main "links.rktd" and "pkgs" to act like "/usr/lib" things, while
additional directories can act like "/lib" things.

The `-C'/`--links' command-line flag to `racket' has been removed.


The default location for the installation-wide "links.rtkd" and
"pkgs.rktd" files have moved from "etc" back into "lib". Either
location seems sensible to me, but with the generalization to support a
installation-wide search list, it works better to keep "pkgs.rktd"
together with the installed package implementations, and it seems best
to keep "pkgs" and "links.rktd" together.


Note that the search path for collections goes through user-specific,
version-specific links first (i.e., "user" scope), then user-specific,
all-version links (i.e.,"shared" scope), and then installation-wide
links (i.e., "installation" scope). The package system should similarly
work sensibly if you, say, install a package at "user" scope that
shadows collections for a package (possibility using the same package
name) at "installation" scope. For now, you have to use `raco pkg
install --force' to make that happen; longer term, I think we want an
option that is like `--force' but limited to sensible shadowings.


Posted on the dev mailing list.