Description
Describe the bug
Cabal rejected template-haskell-2.18.0.0
when using cabal v2-sdist
, even though my cabal.project.local
file contained with-compiler: ghc-9.2.1
and cabal v2-build
succeeded.
Dependency log follows (since I'm never quite confident when reading these):
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: nanopass-0.0.1.1 (user goal)
[__1] next goal: template-haskell (dependency of nanopass)
[__1] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0 (conflict:
nanopass => template-haskell>=2.18 && <2.19)
[__1] rejecting: template-haskell-2.18.0.0, template-haskell-2.17.0.0,
template-haskell-2.16.0.0, template-haskell-2.15.0.0,
template-haskell-2.14.0.0, template-haskell-2.13.0.0,
template-haskell-2.12.0.0, template-haskell-2.11.1.0,
template-haskell-2.11.0.0, template-haskell-2.10.0.0,
template-haskell-2.9.0.0, template-haskell-2.8.0.0, template-haskell-2.7.0.0,
template-haskell-2.6.0.0, template-haskell-2.5.0.0, template-haskell-2.4.0.1,
template-haskell-2.4.0.0, template-haskell-2.3.0.1, template-haskell-2.3.0.0,
template-haskell-2.2.0.0 (constraint from non-upgradeable package requires
installed instance)
[__1] fail (backjumping, conflict set: nanopass, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell, nanopass
To Reproduce
Steps to reproduce the behavior:
-
Clone
https://github.com/edemko/nanopass
and checkout commitaf44fb994bf11f995bbbcf3c91cc1ae2c9ef1bb6
. -
Create a
cabal.project.local
file containswith-compiler: ghc-9.2.1
. -
Use
ghcup
to installghc-9.2.1
. -
Use
ghcup
so thatghc --version
reports 8.10.7. -
cabal v2-build
completes successfully. -
cabal v2-sdist
fails to resolve dependencies because oftemplate-haskell >=2.18
constraint. -
Used
ghcup
so thatghc --version
reports 9.2.1. -
Both
cabal v2-build
andcabal v2-sdist
complete successfully.
Expected behavior
Dependency resolution when running cabal v2-sdist
should complete the same as it does for cabal v2-build
.
System information
- Linux, Ubuntu 20.04
- cabal 3.6.2.0
- ghc 8.10.7