Skip to content

cabal gen-bounds seems to ignore cabal.project.local #7969

Closed
@marseillebd

Description

@marseillebd

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 commit af44fb994bf11f995bbbcf3c91cc1ae2c9ef1bb6.

  • Create a cabal.project.local file contains with-compiler: ghc-9.2.1.

  • Use ghcup to install ghc-9.2.1.

  • Use ghcup so that ghc --version reports 8.10.7.

  • cabal v2-build completes successfully.

  • cabal v2-sdist fails to resolve dependencies because of template-haskell >=2.18 constraint.

  • Used ghcup so that ghc --version reports 9.2.1.

  • Both cabal v2-build and cabal 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions