The operative part of the error message is below and it seems to be something to do with pretty-simple's Setup.hs. Does anyone understand why it would require cabal-3.10 when it builds under cabal-3.8 with --allow-newer? Does that mean that pretty-simple has a too-strict bound somewhere, or is there something more fundamental going on?
Resolving dependencies...
Error: cabal-3.8.1.0: Could not resolve dependencies:
[__0] trying: fake-package-0 (user goal)
[__1] next goal: pretty-simple (dependency of fake-package)
[__1] rejecting: pretty-simple-4.1.2.0 (conflict: fake-package =>
pretty-simple==4.0.0.0)
[__1] skipping: pretty-simple-4.1.1.0, pretty-simple-4.1.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '==4.0.0.0' from 'fake-package')
[__1] trying: pretty-simple-4.0.0.0
[__2] next goal: pretty-simple:setup.Cabal (dependency of pretty-simple)
[__2] rejecting: pretty-simple:setup.Cabal-3.10.2.0/installed-544a,
pretty-simple:setup.Cabal-3.10.2.1, pretty-simple:setup.Cabal-3.10.2.0,
pretty-simple:setup.Cabal-3.10.1.0 (constraint from maximum version of Cabal
used by Setup.hs requires <3.10)
[__2] trying: pretty-simple:setup.Cabal-3.8.1.0
[__3] next goal: pretty-simple:setup.text (dependency of
pretty-simple:setup.Cabal)
[__3] rejecting: pretty-simple:setup.text-2.1/installed-0c74 (conflict:
pretty-simple:setup.Cabal => pretty-simple:setup.text>=1.2.3.0 && <1.3 ||
>=2.0 && <2.1)
[__3] skipping: pretty-simple:setup.text-2.1 (has the same characteristics
that caused the previous version to fail: excluded by constraint '>=1.2.3.0 &&
<1.3 || >=2.0 && <2.1' from 'pretty-simple:setup.Cabal')
[__3] trying: pretty-simple:setup.text-2.0.2
[__4] next goal: pretty-simple:setup.base (dependency of pretty-simple)
[__4] rejecting: pretty-simple:setup.base-4.19.0.0/installed-e327 (conflict:
pretty-simple:setup.text => pretty-simple:setup.ghc-prim>=0.2 && <0.11,
pretty-simple:setup.base =>
...
I think it’s because pretty-simple uses build-type: Custom. From this part of your error dump, I speculate that build-type: Custom makes cabal-install want to depend on cabal-the-library no newer than itself:
[__2] rejecting: pretty-simple:setup.Cabal-3.10.2.0/installed-544a,
pretty-simple:setup.Cabal-3.10.2.1, pretty-simple:setup.Cabal-3.10.2.0,
pretty-simple:setup.Cabal-3.10.1.0 (constraint from maximum version of Cabal
used by Setup.hs requires <3.10)
Then, it tries to solve the dependencies of that version of Cabal (the library). It looks like it can’t use newer versions of text because pretty-simple has an upper bound of <2.1, and it can’t use older versions because your GHC provides a too-new version of ghc-prim, and then the error dump stops and I can’t figure out any more.
Looking at hackage, it seems that cabal-doctest is actually deprecated. I’d probably (in increasing levels of effort):
Try and get the maintainer of pretty-simple (or the Hackage Trustees) to raise some upper bounds so that you can find a build plan with older cabal-install.
Get pretty-simple back onto build-type: Simple and ask people to doctest by running using --with-ghc=doctext.
As №2, but create a test-suite target that is just a call to Test.DocTest.doctest. Whether this is practical is going to depend on how extensive the dependencies are, I suppose.
Yes, nice diagnosis @jackdk. This is a build-type: Custom problem, and the real long-term solution here is to move away from build-type: Custom as far as possible. Luckily at Well-Typed we managed to get some funding to do just that:
Thanks! There are certainly some mysterious things going on.
It’s the custom-setup that depends on Cabal and cabal-doctest. That seems pretty strange. Is it normal for custom setups to depend on Cabal? I could believe that. I don’t see why they should depend on a test framework though!
I guess it’s simple enough to work around, just by using cabal-3.10 but it seems rather fragile so it would be nice to do better if we can.
It looks like @george.fst is a maintainer. Maybe he can chime in?