Why cabal build fails if cabal file changed?
Someone help me make sense of it. Cabal, great app, love it. But cabal build will fail if the cabal file has changed, with a message saying run cabal configure. It does not complain about this on cabal install though. I don't understand why programmers of cabal went to 开发者_Go百科all the trouble to detect the situation and put the message out instead of running the configure step automatically. Why?
I actually think this has changed in cabal-install 0.9.5 and Cabal 1.10.1.0:
$ cabal unpack bytestring
cd byteDownloading bytestring-0.9.1.9...
Unpacking to bytestring-0.9.1.9/
$ cd bytestring-0.9.1.9/
$ runghc Setup.hs configure
Configuring bytestring-0.9.1.9...
$ touch bytestring.cabal
$ runghc Setup.hs build
./bytestring.cabal has been changed. Re-configuring with most recently used
options. If this fails, please run configure manually.
Configuring bytestring-0.9.1.9...
Preprocessing library bytestring-0.9.1.9...
Building bytestring-0.9.1.9...
[1 of 8] Compiling Data.ByteString.Fusion ( Data/ByteString/Fusion.hs, dist/build/Data/ByteString/Fusion.o )
... etc ...
So just wait for the next Haskell Platform release (with GHC 7 and the new Cabal) and you won't get this annoying error again :-)
I guess it's because this would lead to strange errors. Let's assume, you configured with some parameter, eg. you selected another compiler eith -w
. Currently, cabal don't knows, what parameters you gave to the configuration. I guess it's actually smarter to request a reconfiguration instead of configuration with the default parameters instead. But why not open a ticket for this?
精彩评论