Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mafia tries to get non-cabal build tools #208

Open
domdere opened this issue Feb 23, 2018 · 7 comments
Open

mafia tries to get non-cabal build tools #208

domdere opened this issue Feb 23, 2018 · 7 comments

Comments

@domdere
Copy link
Member

domdere commented Feb 23, 2018

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)

@erikd
Copy link
Contributor

erikd commented Feb 23, 2018

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?

@domdere
Copy link
Member Author

domdere commented Feb 26, 2018

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

@domdere
Copy link
Member Author

domdere commented Feb 26, 2018

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

@erikd
Copy link
Contributor

erikd commented Feb 27, 2018

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

@tmcgilchrist
Copy link
Member

Duplicate of #209

@amosr
Copy link
Contributor

amosr commented Mar 9, 2018

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.

@erikd
Copy link
Contributor

erikd commented Mar 9, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants