Skip to content

Commit

Permalink
Update the changelog for --version-win=latest
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 24, 2023
1 parent 1cd172b commit 7e6a207
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions changelog.d/issue-9511
Expand Up @@ -19,27 +19,43 @@ 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
import: https://www.stackage.org/nightly-2023-12-07/cabal.config
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

0 comments on commit 7e6a207

Please sign in to comment.