mafia icon indicating copy to clipboard operation
mafia copied to clipboard

mafia tries to get non-cabal build tools

Open domdere opened this issue 7 years ago • 7 comments

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)

domdere avatar Feb 23 '18 05:02 domdere

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?

erikd avatar Feb 23 '18 06:02 erikd

yeah would love to, be a little while till i find the time to do so though

domdere avatar Feb 26 '18 00:02 domdere

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

domdere avatar Feb 26 '18 00:02 domdere

Damn! Just ran into this problem myself. I may beat you to it!

erikd avatar Feb 27 '18 00:02 erikd

Duplicate of https://github.com/haskell-mafia/mafia/pull/209

tmcgilchrist avatar Mar 08 '18 22:03 tmcgilchrist

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.

amosr avatar Mar 09 '18 06:03 amosr

I think listing non-haskell build tools in that stanza is a new thing.

erikd avatar Mar 09 '18 06:03 erikd