-
Notifications
You must be signed in to change notification settings - Fork 711
cabal flags for dependencies #8643
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
Comments
Sorry, this answer isn't especially helpful, but its pretty hardwired into the design of cabal that requiring a dependency should not require it be configured with any specific flags, and that its a mistake to do so. There are solver hacks that exist (via coupling flags to some 'extra' dependency) so that the solver is forced to solve for flags uniformly across multiple packages, if you control them all. However, I wouldn't recommend this. The unfortunate answer is probably that if a package is sufficiently distinct depending on the choice of flags that it can't be used "like for like" then it should probably be two packages. |
In this case it's easy to build
@gbaz do you have any example by hand? |
Assume |
This seems to be a duplicate of, or at least related to #2821. |
Uh oh!
There was an error while loading. Please reload this page.
There seem to be no way to specify cabal flag for dependencies. In
ghc-tags
andghc-tags-plugin
I would like to useghc-tags-core
as a dependency but:ghc-tags
needs-f +ghc-lib
, by defaultghc-tags-plugin
needs-f -ghc-lib
by defaultThe cabal's file
build-depends
only allow to specify version constraints.cabal.project
file allows to include constraints but it's not distributed throughhackage
users will need to use:which is far from perfect (because
cabal install ghc-tag
would fail or the other one depending what is the default value forghc-lib
flag). Is there a way around this? If not what would be the right solution:.cabal
file?cabal.project
file (socabal install
would take it into account)? this could work forghc-tags
andghc-tags-plugin
, but it wouldn't in other scenariosThe text was updated successfully, but these errors were encountered: