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

default setup-depends for new-build #4954

Closed
mat8913 opened this issue Dec 14, 2017 · 7 comments
Closed

default setup-depends for new-build #4954

mat8913 opened this issue Dec 14, 2017 · 7 comments

Comments

@mat8913
Copy link

mat8913 commented Dec 14, 2017

Would it be possible to change the default custom-setup stanza to setup-depends on Cabal + the build-depends of the library and executable(s).

The motivation for this is that git-annex, for example, does not have a custom-setup stanza, and cannot currently be built with cabal new-build.

Currently, attempting to new-build git-annex results in:

$ cabal new-build --constraint="any.git-annex -testsuite" 
Resolving dependencies...
In order, the following will be built (use -v for more details):
 - git-annex-6.20171214 (exe:git-annex) -testsuite -dbus -concurrentoutput (requires build)
 - dummypkg-0 (lib) (first run)
Configuring git-annex-6.20171214 (all, legacy fallback)...
cabal: Failed to build git-annex-6.20171214 (which is required by dummypkg-0).
The failure occurred during the configure step. The exception was:
dieVerbatim: user error (cabal: '/usr/bin/ghc' exited with an error:

/home/matthew/dummypkg/dist-newstyle/tmp/src-3285/git-annex-6.20171214/Utility/FileSize.hs:10:1:
error:
Failed to load interface for ‘System.PosixCompat.Files’
It is a member of the hidden package ‘unix-compat-0.5.0.1’.
Perhaps you need to add ‘unix-compat’ to the build-depends in your .cabal
file.
Use -v to see a list of the files searched for.
)
@23Skidoo
Copy link
Member

Why can't this be fixed by adding a custom-setup stanza to git-annex?

@mat8913
Copy link
Author

mat8913 commented Dec 15, 2017

It still builds fine with cabal build. I thought new-build was going to be backwards compatible since it will eventually replace build.

@23Skidoo
Copy link
Member

23Skidoo commented Dec 15, 2017

This doesn't work with old-style cabal build either when you don't have the necessary packages installed and don't run install --only-dep beforehand.

@mat8913
Copy link
Author

mat8913 commented Dec 15, 2017

OK, fair enough. I'll go file an issue with git-annex. Feel free to close this if you feel it isn't worth implementing.

@23Skidoo
Copy link
Member

If someone wrote a patch implementing this, I'd most likely accept it, but right now I feel there are more important new-build bugs we should concentrate on.

@grayjay
Copy link
Collaborator

grayjay commented Dec 15, 2017

This would probably also require support for conditionals in custom-setup (#4286).

@Ericson2314
Copy link
Collaborator

Presuming run time dependencies are needed atbuikd time for setup.hs is very hostile to cross compilation. I am very against this.

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

No branches or pull requests

4 participants