From 04efdd405d4fe898525b89f65531d3df6181f6bb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 28 Jun 2013 21:04:59 -0600 Subject: [PATCH] raco setup: add package-dependency checking The new `--no-pkg-deps' or `-K' flag skips the check. If a module in package X refers to a module in package Y, check that package X declares a dependency on Y. Note that package X must specifically depend on Y --- not another package that at the moment happens to declare a dependency on Y. A new "base" package represents the content of the core (so that, if the core shrinks, a new "base2" can represent the smaller core). Most every package now needs a dependency on "base". Sometimes, it makes sense for X to access Y when X declares a dependency on Z, because Z promises to always depend on Y. For example, the "gui" package is defined to combne "gui-lib" and "gui-doc", so it's appropriate to use the modules of "gui-lib" when depending on "gui". A package's "info.rkt" can therefore define `implies' as a subset of the dependencies listed in `deps', which means that depending on the package implies a dependency on the listed packages. (It's even possible for packages to mutually imply each other, which is why the dependency checking code ends up with a union-find.) Dependency checking distinguishes between run-time dependencies and build-time dependencies: anything listed in a ".dep" file is a build dependency, at least. To imply a run-time dependency, a reference must appear in a bytecode file's imports, and not in a subdirectory or submodule that would be pruned for a binary package. The `--fix-pkg-deps' flag attempts to automatically fix package dependency declarations (i.e., modify a package's "info.rkt" file) based on inferred dependencies. original commit: 04d5d9bd55d8258221e6e4cfba0c7991498202ed --- racket/lib/collects/setup/option-sig.rkt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/racket/lib/collects/setup/option-sig.rkt b/racket/lib/collects/setup/option-sig.rkt index 8dad393247..d9f5b43bf5 100644 --- a/racket/lib/collects/setup/option-sig.rkt +++ b/racket/lib/collects/setup/option-sig.rkt @@ -22,6 +22,8 @@ avoid-main-installation make-tidy make-doc-index + check-dependencies + fix-dependencies call-install call-post-install pause-on-errors