Providing a smooth default user experience
duncan.coutts at googlemail.com
Fri Nov 2 16:43:05 CET 2012
On Wed, 2012-10-31 at 10:22 -0700, Johan Tibell wrote:
> Hi all,
> Sensible defaults are important to provide a smooth user experience,
> especially for first-time users. There are a few areas where I think cabal
> could improve its default behavior. In particular, here are a couple of
> changes I would like to make:
> *cabal build should imply cabal install --only-dependencies
> If you're currently working on a package, the right  way to build it is
> as follows:
> cabal install --only-dependencies
> cabal build
I've been thinking along similar lines recently. We should be thinking
about package environments (which spans multiple packages) rather than
individual packages, and the UI should reflect that. Right now it's very
much centred on individual packages, not collections.
So "cabal configure" should configure/reconfigure the package
environment, not the individual package. It should make an install plan
for the current environment (which at minimum is a single target package
and its dependencies but could be several packages in the same env).
Then of course executing that install plan by building any of the
targets should go and build deps as necessary.
Of course from a UI pov, we have to make it clear what's going to
happen. When you configure an environment, it needs to say that it'll
involve installing several things locally.
That's also the appropriate point to freeze (or partially freeze) a
package environment to give a reproducible build.
I think when changing the packages in an environment, we should always
enforce complete consistency of dependencies. So you know straight away
if you can add two packages to the same environment, and not let people
get into the situation of broken packages. You can change stuff and
rebuild, but we should always have an install plan for the whole lot,
not just a subset.
More information about the cabal-devel