Search code examples
haskellcabal

Could not resolve cabal dependencies on CI even cabal freeze


I'm getting error on CI

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: Kalmarity-0.0.1 (user goal)
[__1] next goal: base (dependency of Kalmarity)
[__1] rejecting: base-4.14.1.0/installed-4.14.1.0, base-4.18.0.0,
base-4.17.0.0 (constraint from project config
/home/runner/work/Kalmarity/Kalmarity/cabal.project.freeze requires
==4.16.4.0)
[__1] rejecting: base-4.16.4.0 (constraint from non-upgradeable package
requires installed instance)
[__1] rejecting: base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0,
base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0,
base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0,
base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0,
base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1,
base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1
(constraint from project config
/home/runner/work/Kalmarity/Kalmarity/cabal.project.freeze requires
==4.16.4.0)
[__1] fail (backjumping, conflict set: Kalmarity, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, Kalmarity

build depends list from original cabal

  Build-Depends:
      base                  >= 4.13
    , base-unicode-symbols  >= 0.2
    , containers            >= 0.6.5.1
    , aeson                 >= 2.0.3.0
    , conduit               >= 1.3.4.1
    , calamity              >= 0.7.1.0
    , calamity-commands     >= 0.4.0.0
    , optics                >= 0.4.2
    , lens                  >= 5.2
    , di-polysemy           >= 0.2
    , di                    >= 1.3
    , df1                   >= 0.4.1
    , di-core               >= 1.0.4
    , polysemy              >= 1.7.1.0
    , polysemy-plugin       >= 0.4.3.1
    , polysemy-time         >= 0.6.0.0
    , stm                   >= 2.5
    , text                  >= 1.2.5
    , text-show             >= 3.9.7
    , persistent            >= 2.14.0.3
    , persistent-sqlite     >= 2.13.1.0
    , monad-logger          >= 0.3.39
    , optparse-generic      >= 1.4.9
    , req                   >= 3.13.0
    , data-flags            >= 0.0.3.4
    , yaml                  >= 0.11.10.0
    , directory             >= 1.3.6.2
    , unordered-containers  >= 0.2.19.1
    , unboxing-vector       >= 0.2.0.0
    , data-default          >= 0.7.1.1
    , hw-kafka-client       >= 5.0.0
    , async                 >= 2.2.4
    , bytestring

link to CI job and repository: https://github.com/Miezhiko/Kalmarity/actions/runs/4730175482/jobs/8393551210

even when I use cabal.project.freeze which I generated on my machine where it builds just fine I'm on GHC 9.2.6, cabal 3.6.3


Solution

  • It seems the CI uses GHC 8.10.2, 8.10.3, or 8.10.4 which require base 4.14.1.0, but you freeze file was generated with GHC 9.2.6 as you say, so it requires base 4.16.4.0.

    The version of the base package is fixed to GHC versions, so you can't simply use freeze files between different compiler versions like this.