[racket-dev] checking package dependencies

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jun 29 09:18:05 EDT 2013

The `raco setup' tool now checks declared package dependencies against
actual library dependencies. Use `--no-pkg-deps' or `-K' to skip the
check (which takes 5-6 seconds on my machine).

PLEASE pay attention to dependency-declaration errors before you push a
commit that might introduce them! Checking is enabled by default
because dependency problems will matter.


There is one dependency problem, currently: "drracket" depends on
"htdp" through a test. That problem was created by a commit before
dependency checking was available, and we'll get it fixed.


Practically every package will need a dependency on "base", which is a
package that represents the libraries in the core; it's the
package-level analogue of having to start every module with `#lang
racket'. The idea is that the content implied by "base" will stabilize
after we finish pruning back the core.


Checking distinguishes between run-time dependencies (as declared with
`deps') and build-time dependencies (as declared with `build-deps'):

 * If a package Y is needed to run `raco setup' on package X, then X
   has a build-time dependency on Y.

 * If package Y is needed to run the non-test, non-documentation
   bytecode of X (i.e., the code that is left after pruning X to a
   binary package), then X has a run-time dependency on Y.

Dependency checking currently treats every run-time dependency as
implying a build-time dependency, which is consistent with `raco pkg
install'.


Finally, certain packages imply other packages.

In general, if package X declares a dependency on Y, and if Y declares
a dependency on Z, then X does NOT effectively declare a dependence on
Z. The dependence of Y on Z may be an aspect of Y's implementation, not
its interface to clients like X. If X wants to use Z as well as Y, then
it should say so.

If X declares a dependency on "gui", however, then it should also be
able to use the libraries of "gui-lib". The "gui" package explicitly
declares that it implies "gui-lib". The declaration appears in the
"info.rkt" file of "gui" as a definition of `implies'. The packages
listed in `implies' must be a subset of the packages in `deps'.
Currently, only dependency checking in `raco setup' uses the `implies'
definition.


Posted on the dev mailing list.