26 Nov 2012 00:09
cabal configure && cabal build && cabal install
Albert Y. C. Lai <trebla <at> vex.net>
2012-11-25 23:09:26 GMT
2012-11-25 23:09:26 GMT
Among many programmers, and/or users who manually unpack source tarball before installing, this idiom is very common: cabal configure cabal build cabal install This idiom is an urban legend, i.e., a popular error. "cabal install" re-does the "configure" and the "build" steps, among other things. That it has not caused trouble for you so far is only because: 1. "configure" has been idempotent, so far 2. the 2nd "build" has not caused duplicate work because ghc knows when not to re-compile One day, you will run into a surprise, because you will add some flags to "configure", and then... cabal configure --prefix=/nondefault --enable-shared cabal build cabal install Whee! Your laborously entered flags are lost on deaf ears. You get the default prefix, and you get the default disable-shared. Why? Because "cabal install" re-does the "configure" step, but this time, since you give no flags to "install", you give no flags to the 2nd "configure" either.(Continue reading)
RSS Feed