haskell / haskell/cabal

Does cabal-3.10 impose `setup.Cabal < 3.12`?

Open
#9,917 36 comments 1 reaction 0 assignees View on GitHub
cabal-install: solver Cabal: stanza/custom-setup documentation type: discussion
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When trying to make `cabal-3.10` build packages with custom setups on GHC 9.10.0 (alpha3), which ships with `Cabal-3.12`, cabal insists to build `Cabal-3.10.3.0`.
If I try to force using the installed `Cabal`, constraint solving fails.
```
system-filepath-0.4.14$ cabal build -w ghc-9.10.0 -c 'setup.Cabal >=3.12'
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: system-filepath-0.4.14 (user goal)
[__1] next goal: system-filepath:setup.Cabal (dependency of system-filepath)
[__1] rejecting: system-filepath:setup.Cabal-3.12.0.0/installed-c30b
(constraint from maximum version of Cabal used by Setup.hs requires <3.12)
```
The package itself does not impose an upper bound on `Cabal`:
```
custom-setup
setup-depends: Cabal >= 1.8, base >=4.0 && <5
```

This is not a problem with `cabal-3.11` (master), this one does not impose this upper bound.

The docs say (https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-custom-setup-setup-depends):
> If the field is not specified the implicit package set will be used. The package set contains packages bundled with GHC (i.e. base, bytestring) and specifically Cabal. The specific bounds are put on Cabal dependency: lower-bound is inferred from [cabal-version](https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-cabal-version), and the upper-bound is < 1.25.

(Ok, the "< 1.25" is definitively stale doc here.)
The docs seem to say that the upper bound comes from whatever is bundled with GHC, which should be including `Cabal-3.12` (bundled with GHC 9.10 alpha3).

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported command with cabal-3.10, GHC 9.10.0 alpha3, and system-filepath-0.4.14, then compare its custom-setup dependency handling with cabal-3.11. Check why Cabal-3.10.3.0 is selected despite the installed Cabal-3.12 and determine whether the implementation or the linked documentation needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.