[racket] info.rkt `deps` (was: Package fails to compile during 'make in-place' but not 'raco pkg install')

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Dec 20 14:20:38 EST 2013

At Fri, 20 Dec 2013 13:48:17 -0500, Greg Hendershott wrote:
> Related: At one point I recall seeing HEAD give warnings like, "The
> package A doesn't declare its dependencies X, Y, Z". Which always made
> me wonder, if the system already knows what the dependencies are, why
> would we need to list them in `deps`?  Couldn't raco pkg install offer
> to install them automatically just like the explicitly declared deps?

The last step in `raco setup` is able to report errors for a package
only after it has successfully built the package. Inferring the package
dependencies from source is more difficult at best and impossible in
general.

For example, different (conflicting) packages might provide the same
library in the same way that different (conflicting) modules might
provide the same bindings. And in the same way that Racket cannot, in
general, tell you which module to import if a name like `define` isn't
bound (there are many possibilities), the package system cannot say
definitively which package to install if a module is unavailable.

That said, we expect modules provided by packages to be more distinct
than exports provided by modules, and we've built support for
recommending a package when a module name isn't found. I think of that
recommendation layer as a heuristic, though, and not as something that
you'd want to rely on.

You shouldn't write packages absent explicitly stated dependencies just
as you shouldn't write Racket code outside of a module --- but you can
still do either of those. It will take more time, more tooling, etc. to
get from the vision to consistent practice with packages (just as it
did for modules).


Posted on the users mailing list.