haskell / haskell/cabal

`gen-bounds` command gives bad advice.

Open
#9,364 3 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/gen-bounds type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
```
> cabal gen-bounds
Resolving dependencies...

The following packages need bounds and here is a suggested starting point.
You can copy and paste this into the build-depends section in your .cabal
file and it should work (with the appropriate removal of commas).

Note that version bounds are a statement that you've successfully built and
tested your package and expect it to work with any of the specified package
versions (PROVIDED that those packages continue to conform with the PVP).
Therefore, the version bounds generated here are the most conservative
based on the versions that you are currently building with. If you know
your package will work with versions outside the ranges generated here,
feel free to widen them.

ghc-prim >= 0.11.0 && < 0.12,
```
Since `ghc-prim` is bound to the compiler version, setting the suggested bounds (which works for `ghc-9.8`), would prevent this package from building with any compiler versions earlier that `9.8`.

**To Reproduce**
Steps to reproduce the behavior: As above

**Expected behavior**
Suggestions should not be made for packages tightly bound to the compiler version.

**System information**
- Operating system: Linux
- `cabal`, `ghc` versions: `cabal-install version 3.10.1.0`, `ghc-9.8.1`

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported `cabal gen-bounds` command with GHC 9.8.1 and inspect the `gen-bounds` command implementation and its handling of `ghc-prim`. Done means compiler-version-bound packages such as `ghc-prim` are excluded from suggested bounds while ordinary dependency suggestions still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.