Replace `<0` with some other construct to avoid confusion
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Having a bound `<0` means that it is unsatisfiable, it is **not** a real bound as it cannot be influenced by `--allow-newer`:
```
➜ cat aa.cabal
cabal-version: 3.0
name: aa
version: 0.1.0.0
license: NONE
build-type: Simple
extra-doc-files: CHANGELOG.md
common warnings
ghc-options: -Wall
library
import: warnings
exposed-modules: MyLib
build-depends: base <0
hs-source-dirs: src
default-language: Haskell2010
➜ cabal build --allow-newer
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: aa-0.1.0.0 (user goal)
[__1] next goal: base (dependency of aa)
[__1] rejecting: base-4.18.2.1/installed-4.18.2.1 (conflict: aa => base<0)
[__1] skipping: base; 4.20.0.1, 4.20.0.0, 4.19.1.0, 4.19.0.0, 4.18.2.1, 4.18.2.0, 4.18.1.0, 4.18.0.0, 4.17.2.1, 4.17.2.0, 4.17.1.0, 4.17.0.0, 4.16.4.0, 4.16.3.0, 4.16.2.0, 4.16.1.0, 4.16.0.0, 4.15.1.0, 4.15.0.0, 4.14.3.0, 4.14.2.0, 4.14.1.0, 4.14.0.0, 4.13.0.0, 4.12.0.0, 4.11.1.0, 4.11.0.0, 4.10.1.0, 4.10.0.0, 4.9.1.0, 4.9.0.0, 4.8.2.0, 4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (has the same characteristics that caused the previous version to fail: excluded by constraint '<0' from 'aa')
[__1] fail (backjumping, conflict set: aa, base)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aa, base
➜ sed -i 's/<0/<0.0/g' aa.cabal
➜ cabal build --allow-newer
Resolving dependencies...
Build profile: -w ghc-9.6.5 -O1
In order, the following will be built (use -v for more details):
- aa-0.1.0.0 (lib) (first run)
Configuring library for aa-0.1.0.0...
```
I think it would be good if we used some other construct that what looks like a normal bound when we want something to be unbuildable.
Contributor guide
Research direction
Reproduce the issue with the minimal aa.cabal example and cabal build --allow-newer, comparing <0 with <0.0. Then trace how Cabal represents and renders the unsatisfiable dependency constraint; done means the replacement no longer resembles a normal bound, remains unbuildable under --allow-newer, and has resolver coverage for the new behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100