haskell / haskell/cabal

Support for adding flag constraints in Cabal files

Open
#2,821 14 comments 5 reactions 0 assignees View on GitHub
cabal-install: cmd/check Cabal: file format old-milestone: ⊥ type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

One of the difficulties with the current system of flags is that it places all the responsibility for getting various flags right to the end-user installing some package way down the chain. It would be nice if those of us writing libraries that only work with certain upstream flag combinations could specify flags in the Cabal file, rather than having to provide long list of flag constraints for our users to follow at the end of the process.

I'm imagining something like:

```
build-depends: cryptonite >= 0.6 && < 0.8 -integer-gmp,
tls >= 1.3.3 && < 1.5 -network +HaNS
```

and so on.

As it stands, I have to provide downstream users explicit instructions about passing `--constraint="cryptonite -integer-gmp" --constraint="tls -network" --constraint="tls +HaNS"`, which is a pain for everyone involved.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating Cabal file parsing and the existing --constraint handling, then determine how the proposed flag syntax should be specified and validated; done means supported constraints are accepted from Cabal files and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.