Commit 16c3c38
authored
Pick the latest version when the same package is in plan.json twice (input-output-hk#109)
Currently haskell.nix assums that each package will occur only once in the plan.json file. It turns out this is not always the case. If a package is included as a dependency of a `setup` component or `build-tool-dependencies` then it may be listed more than once. Currently we pick the first one in the `plan.json` file (via `Map.fromList`). This is not ideal as it is often an old version included to satisfy one of the `setup` or `build-tool-dependencies`. In particular `cabal-doctest` often results in picking an old version of `Win32` when cross compiling for windows.
It can be difficult to get rid of the duplicates in the `plan.json` file itself (as a work around), because constraints cannot be added to the build time dependencies in `cabal.project`.
The correct fix is to add support for multiple versions of the same package in haskell.nix, but this will require a lot of refactoring.
This PR will help improve the situation by picking the newest version with `Map.fromListWith`, rather than just the first in the file.1 parent 4bca7bb commit 16c3c38
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
247 | 250 | | |
248 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
0 commit comments