haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 697 forks source link

Docs script example doesn't run with `ghc-9.10.1` #10325

Closed philderbeast closed 1 month ago

philderbeast commented 2 months ago

What is wrong with the docs?

The script example doesn't run as-is with ghc-9.10.1:

image

$ chmod +x myscript.hs

$ ./myscript.hs
Warning: this is a debug build of cabal-install with assertions enabled.
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: fake-package-0 (user goal)
[__1] next goal: base (dependency of fake-package)
[__1] rejecting: base-4.20.0.0/installed-4014 (conflict: fake-package => base^>=4.19.0.0)
[__1] skipping: base; 4.20.0.1, 4.20.0.0 (has the same characteristics that caused the previous version to fail: excluded by constraint '^>=4.19.0.0' from 'fake-package')
[__1] rejecting: base; 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 (constraint from non-reinstallable package requires installed instance)
[__1] fail (backjumping, conflict set: base, fake-package)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, fake-package
ulysses4ever commented 2 months ago

We should kill the explicit version of base in the example IMO.