diff --git a/changelog.d/issue-9511 b/changelog.d/issue-9511 index db5aaedb5c3..c109314b383 100644 --- a/changelog.d/issue-9511 +++ b/changelog.d/issue-9511 @@ -19,11 +19,15 @@ description: ``` This change gives priority to version equality constraints that are less - imported and does so by only passing along the top priority constraints (the - least imported for any package) to the solver. The lower priority version - equality constraints are discarded. If `nightly-2023-12-07` has `constraints: - hashable ==1.4.3.0` then this fix will effectively allow the local - `cabal.project` to override that version and pick another. + imported (by default) and does so by only passing along the top priority + constraints (the least imported for any package) to the solver. Priority can + also be given to constraints so that the last version constraint for a package + wins. The command line option for this is `--version-win=latest|shallowest`. + + The lower priority version equality constraints are discarded. If + `nightly-2023-12-07` has `constraints: hashable ==1.4.3.0` then this fix will + effectively allow the local `cabal.project` to override that version and pick + another. ``` -- cabal.project @@ -31,15 +35,27 @@ description: constraints: hashable ==1.4.2.0 ``` - The order of the import relative to the constraints does not matter within a - project because the project is at the root of the import tree. Anything put - there is top priority. + With the following project and `--version-win=latest` the import from stackage + would have priority and `hashable ==1.4.3.0` would be passed to the solver. + + ``` + -- cabal.project + constraints: hashable ==1.4.2.0 + import: https://www.stackage.org/nightly-2023-12-07/cabal.config + ``` + + With `--version-win=shallowest`, the order of the import relative to the + constraints **does not matter** within a project because the project is at the + root of the import tree. Anything put there is top priority. The same relative precedence rule applies per-package down an import tree for more complex import situations. Other constraints, such as flags, are not touched by this fix so it may be possible to orphan some flags that relate to versions of packages that get weeded out. + With `--version-win=latest`, the order of the import relative to the + constraints **does matter**. + packages: cabal-install prs: #9510 issues: #9511 \ No newline at end of file