Why doesn't Cabal ask me any questions after cabal init

Viewed 536

When I've looked at cabal tutorials they always say that cabal, after cabal init proceeds to ask you a 'bunch of questions' (https://www.youtube.com/watch?v=a7R-2vtPLDM) and when I run the command cabal does not do this, instead guessing everything. This happens whether I use cygwin or cmd on Windows 10.

Console output is as follows:

Warning: The package list for 'hackage.haskell.org' is 20 days old.
Run 'cabal update' to get the latest list of available packages.

Guessing dependencies...

Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating Setup.hs...
Generating CHANGELOG.md...
Generating Main.hs...
Generating g.cabal...

Warning: no synopsis given. You should edit the .cabal file and add one.
You may want to edit the .cabal file and add a Description field.

(Yes, questions are the same regardless of whether or not the package list is updated)

How do I get cabal to ask me questions like normal? Do I need to reinstall? It also cannot recognise cabal sandbox init as a command, but that's another question.

1 Answers

It seems that in recent versions of cabal-install, one has to invoke cabal init --interactive and answer "no" tho the "generate a simple project with sensible defaults" question.

Also, sandboxes are now obsolete; within a cabal project, cabal build should install any required dependencies and build the local package, without having to create a sandbox.

The new way of handling installed dependencies (called "nix-style" in the manual) is strictly better than sandboxes. It avoids cabal dependency hell—like sandboxes did—and also avoids having to build the same dependency multiple times, because compiled dependencies are saved in a central store and can be reused across projects.

Related