haskell / haskell/cabal

cabal flags for dependencies

Open
#8,643 5 comments 0 reactions 0 assignees View on GitHub
re: flag type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.