-
Notifications
You must be signed in to change notification settings - Fork 847
Description
Our goal should be to be able to init/build/install as many packages as possible with little or no intervention by the user. After trying stack init a little bit here are a few suggestions to make the experience better.
-
When
stack initfails there is an intimidating amount of output. We can perhaps keep it shorter and have more details in a verbose mode. We can put a suggestion towards using verbose to get more details. -
When no snapshot satisfying the dependencies could be found, we should sort the output showing snapshot options putting the best fit first.
-
Going even beyond that - we should automatically pick the best fit and put the rest of the packages in extra-deps. The user can be warned about the fact that some of the packages are not from a stack snapshot.
-
When automatically picking the best snapshot we have to make sure that we pick only a snapshot which satisfies the compiler wired-in packages (base, ghc-prim, integer-gmp, integer-simple). They cannot go in extra-deps.
-
stack init --solver spits an almost incomprehensible message if the wrong ghc is in the path. To make things better we should be able to choose and install (if necessary) the right compiler. The output comes from cabal. If required we can decode the output and provide a simpler message to the user. Here is a sample of the output:
cueball:/vol/hosts/cueball/workspace/halberd$ stack init --solver
Writing default config file to: /vol/hosts/cueball/workspace/halberd/stack.yaml
Basing on cabal files:
- /vol/hosts/cueball/workspace/halberd/halberd.cabal
Asking cabal to calculate a build plan, please wait
Running /var/home/harendra/.local/bin/cabal --config-file=/tmp/cabal-solver13660/cabal.config install --enable-tests --enable-benchmarks -v --dry-run --only-dependencies --reorder-goals --max-backjumps=-1 --package-db=clear --package-db=global /vol/hosts/cueball/workspace/halberd/ exited with ExitFailure 1
/var/home/harendra/.stack/snapshots/x86_64-linux/lts-3.14/7.10.2/bin/cpphs --version
/usr/bin/gcc -dumpversion
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin/haddock --version
/var/home/harendra/.stack/snapshots/x86_64-linux/lts-3.14/7.10.2/bin/happy --version
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin/hpc version
looking for tool hsc2hs near compiler in
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin
found hsc2hs in
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin/hsc2hs
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin/hsc2hs --version
/var/home/harendra/.stack/snapshots/x86_64-linux/lts-3.14/7.10.2/bin/HsColour -version
/var/home/harendra/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc -c /tmp/1804289383846930886.c -o /tmp/16816927771714636915.o
/usr/bin/ld -x -r /tmp/16816927771714636915.o -o /tmp/1957747793424238335.o
/usr/bin/pkg-config --version
/bin/tar --help
Reading available packages...
Updating the index cache file...
Choosing modular solver.
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: halberd-0.1.2.9 (user goal)
next goal: base (dependency of halberd-0.1.2.9)
rejecting: base-4.8.1.0/installed-4f7... (conflict: halberd => base>=4.5 &&
<4.8)
rejecting: base-4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0,
4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1,
4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires
installed instance)
Dependency tree exhaustively searched.
This actually means that you need a different compiler.
I can implement this if it sounds ok and not overlapping with any other work.