11

Which actions does the term "configure" cover in the command cabal configure?

I have read through documentation, but everything I can find essentially says "configure configures", or install also "configures".

Thank you.

Jordan Morris
  • 2,101
  • 2
  • 24
  • 41
  • 3
    It parses the cabal file, makes sure its valid, and resolves dependencies to specific versions. Basically it makes a plan to build the package. – user2407038 Dec 26 '14 at 04:52
  • 1
    Thanks @user2407038. Does it record that plan somewhere? Whose consumption is that plan for? When it resolves those dependencies, does it also install them? Does it write any other file outputs? Feel free to add your comment as an answer, as I would probably accept it. Cheers – Jordan Morris Dec 26 '14 at 09:34
  • Well, since when `cabal install` can't resolve packages, doing a `cabal configure` before fixes it sometimes, so probably it keeps record somewhere. – utdemir Dec 26 '14 at 12:38
  • What I've seen is that it sets things up for a `cabal build`, but not for `cabal install`. The latter will re-run `cabal configure` internally, so any flags you want to pass to `cabal configure` should instead be passed to `cabal install`. I'm not sure where it stores this configuration, though. – bheklilr Dec 26 '14 at 15:14
  • From what I've seen, the output from `cabal configure` ends up in `dist/setup-config`. If you delete the `dist` directory, cabal goes back to saying the package has never been configured. – Shaun the Sheep Dec 28 '14 at 21:24

1 Answers1

6

By configure, it's referring to the options that can be set before building the program.

You can read these by running:

cabal configure --help

These include things like:

--prefix the destination directory

and

--extra-lib-dirs : object code libraries to link against when compiling

These two examples are similar to options which are traditionally specified in configure scripts which is where the name comes from, but now can be handled by cabal.

Flags can also be set in the cabal file which select specific modules to be built. An example of this can be seen in the in the text editor Yi, where specifying -f pango will build a graphical version of the editor whereas -f vty will build the console based version.

pikapika
  • 376
  • 1
  • 7