Skip to content

cabal flags for dependencies #8643

Open
@coot

Description

@coot

There seem to be no way to specify cabal flag for dependencies. In ghc-tags and ghc-tags-plugin I would like to use ghc-tags-core as a dependency but:

  • ghc-tags needs -f +ghc-lib, by default
  • ghc-tags-plugin needs -f -ghc-lib by default

The cabal's file build-depends only allow to specify version constraints. cabal.project file allows to include constraints but it's not distributed through hackage users will need to use:

cabal install -f +ghc-lib ghc-tag
cabal install -f -ghc-lib ghc-tags-plugin

which is far from perfect (because cabal install ghc-tag would fail or the other one depending what is the default value for ghc-lib flag). Is there a way around this? If not what would be the right solution:

  • add a way to configure dependency flags in a .cabal file?
  • a way to distribute an executable with its cabal.project file (so cabal install would take it into account)? this could work for ghc-tags and ghc-tags-plugin, but it wouldn't in other scenarios
  • something else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions