@@ -19,27 +19,43 @@ description:
19
19
```
20
20
21
21
This change gives priority to version equality constraints that are less
22
- imported and does so by only passing along the top priority constraints (the
23
- least imported for any package) to the solver. The lower priority version
24
- equality constraints are discarded. If `nightly-2023-12-07` has `constraints:
25
- hashable ==1.4.3.0` then this fix will effectively allow the local
26
- `cabal.project` to override that version and pick another.
22
+ imported (by default) and does so by only passing along the top priority
23
+ constraints (the least imported for any package) to the solver. Priority can
24
+ also be given to constraints so that the last version constraint for a package
25
+ wins. The command line option for this is `--version-win=latest|shallowest`.
26
+
27
+ The lower priority version equality constraints are discarded. If
28
+ `nightly-2023-12-07` has `constraints: hashable ==1.4.3.0` then this fix will
29
+ effectively allow the local `cabal.project` to override that version and pick
30
+ another.
27
31
28
32
```
29
33
-- cabal.project
30
34
import: https://www.stackage.org/nightly-2023-12-07/cabal.config
31
35
constraints: hashable ==1.4.2.0
32
36
```
33
37
34
- The order of the import relative to the constraints does not matter within a
35
- project because the project is at the root of the import tree. Anything put
36
- there is top priority.
38
+ With the following project and `--version-win=latest` the import from stackage
39
+ would have priority and `hashable ==1.4.3.0` would be passed to the solver.
40
+
41
+ ```
42
+ -- cabal.project
43
+ constraints: hashable ==1.4.2.0
44
+ import: https://www.stackage.org/nightly-2023-12-07/cabal.config
45
+ ```
46
+
47
+ With `--version-win=shallowest`, the order of the import relative to the
48
+ constraints **does not matter** within a project because the project is at the
49
+ root of the import tree. Anything put there is top priority.
37
50
38
51
The same relative precedence rule applies per-package down an import tree for
39
52
more complex import situations. Other constraints, such as flags, are not
40
53
touched by this fix so it may be possible to orphan some flags that relate to
41
54
versions of packages that get weeded out.
42
55
56
+ With `--version-win=latest`, the order of the import relative to the
57
+ constraints **does matter**.
58
+
43
59
packages: cabal-install
44
60
prs: #9510
45
61
issues: #9511
0 commit comments