Flag to force the use of the latest allowed package
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I am thinking about how to make dependency upgrades more automatic and more reliable (https://mobile.twitter.com/nomeata/status/1558859792919191552).
Imagine we have a tool or bot that creates tentatively PRs that extend the dependency ranges of your package `pkg`, e.g. from `foo <2.0` to `foo <2.1`. Ideally, if the CI for this change is green it should be ok to merge it (after also checking the changelog for semantic changes, of course).
But right now, a typical CI setup will not provide that: If `pkgs` also depends on `bar`, and all versions of `bar` depend on `foo <2.0`, then Cabal will continue to pick `foo-1`, the build will succeed, and the PR may be merged. But once `bar` allows `foo-2.0`, now Cabal will pick that, and an incompatibility might cause the build or the tests to break – but now on master or on Hackage.
When doing dependency bumps locally, I'd use `--constraint="foo>=2.0"` to avoid this. But what can we do in automatic CI?
I could imagine a flag `--constrain-latest-deps=pkgs` that instructs the Cabal solver to use, for every dependency of `pkgs`, exactly the highest known version that is within `pkgs`’s version bounds. I can then use this flag in CI, and know that my upper version bounds are actually realizable.
Would that be useful, doable and welcome?
Contributor guide
Assessment
This issue has not been assessed yet.