Cabal configure - What does "configure" mean?
Asked Answered
K

1

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.

Kenleigh answered 26/12, 2014 at 2:44 Comment(5)
It parses the cabal file, makes sure its valid, and resolves dependencies to specific versions. Basically it makes a plan to build the package.Kutaisi
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. CheersKenleigh
Well, since when cabal install can't resolve packages, doing a cabal configure before fixes it sometimes, so probably it keeps record somewhere.Personalty
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.Seethe
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.Dinitrobenzene
K
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.

Koloski answered 13/2, 2015 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.