mafia
mafia copied to clipboard
mafia tries to get non-cabal build tools
I'm getting bulids failing with this during the "build dependencies" phase:
Detected 'unzip' was required to build zip-archive-0.3.2.4
cabal: There is no package named 'unzip'.
You may need to run 'cabal update' to get the latest list of available
zip-archive
has the following lines in its .cabal
file:
Build-tools: unzip
I already had unzip
on my machine and it was trying to install it from hackage (and its not there obviously)
I think that mafia assumes that all build tools listed in a cabal file are tools that are "cabal installable", like hsc2hs
and markdown-unlit
. Obviously this is not true for unzip
.
I think mafia always installing build tools listed in the cabal file is a mistake. It should first try to see the required tool exists on the $PATH
. This would mean it would look for tools like hsc2hs
on the $PATH
first and only install it if its not there. This would fix your use case for unzip
assuming that unzip
is already on the $PATH
but still give confusing error messages for non-haskell tools that are not installed.
Wanna send a patch?
yeah would love to, be a little while till i find the time to do so though
hmm bit of a problem with the suggested solution though, if it already exists in the PATH
but is cabal installable, and the version is older and doesnt satisfy the constraints, then a valid version will not get installed.
I think i'll change it so it does attempt to install it from hackage, if that fails and it already exists on the PATH
I wont make a it an error for the build
Damn! Just ran into this problem myself. I may beat you to it!
Duplicate of https://github.com/haskell-mafia/mafia/pull/209
Haha! I just ran into this morning and didn't see this issue. Interesting that this feature has been in Mafia for a while, but we all ran into it within two weeks of each other.
I think listing non-haskell build tools in that stanza is a new thing.