cabal "encountered missing dependencies" in CI
The cabal solver could not find a set of package versions satisfying every bound. Some dependency or version constraint cannot be met.
What this error means
cabal build aborts with Encountered missing or private dependencies, listing the packages and bounds it could not satisfy. It is deterministic given the index and constraints.
Resolving dependencies...
Error: cabal: Encountered missing or private dependencies:
aeson >=2.2 && <2.3
text ==1.2.*Common causes
Conflicting or too-tight bounds
Two dependencies require incompatible versions of a shared package, or a bound excludes every available release.
Stale package index
A package or version exists upstream but the local Hackage index is out of date, so the solver cannot see it.
How to fix it
Update the package index
Refresh Hackage so the solver sees current releases.
cabal update
cabal build allRelax or align the bounds
- Loosen overly tight upper bounds that exclude valid versions.
- Use a
cabal.project.freezeto lock a known-good set. - Pick an index-state for reproducible resolution.
Pin a working plan
Commit a freeze file so CI resolves the same versions every run.
cabal freezeHow to prevent it
- Commit a cabal.project.freeze for reproducibility.
- Run cabal update before building in CI.
- Keep version bounds reasonable.