|
2 | 2 | -- | Reordering or pruning the tree in order to prefer or make certain choices.
|
3 | 3 | module Distribution.Solver.Modular.Preference
|
4 | 4 | ( avoidReinstalls
|
5 |
| - , deferSetupChoices |
| 5 | + , deferSetupExeChoices |
6 | 6 | , deferWeakFlagChoices
|
7 | 7 | , enforceManualFlags
|
8 | 8 | , enforcePackageConstraints
|
@@ -400,17 +400,18 @@ preferBaseGoalChoice = trav go
|
400 | 400 | isBase (Goal (P (Q _pp pn)) _) = unPN pn == "base"
|
401 | 401 | isBase _ = False
|
402 | 402 |
|
403 |
| --- | Deal with setup dependencies after regular dependencies, so that we can |
404 |
| --- will link setup dependencies against package dependencies when possible |
405 |
| -deferSetupChoices :: Tree d c -> Tree d c |
406 |
| -deferSetupChoices = trav go |
| 403 | +-- | Deal with setup and build-tool-depends dependencies after regular dependencies, |
| 404 | +-- so we will link setup/exe dependencies against package dependencies when possible |
| 405 | +deferSetupExeChoices :: Tree d c -> Tree d c |
| 406 | +deferSetupExeChoices = trav go |
407 | 407 | where
|
408 |
| - go (GoalChoiceF rdm xs) = GoalChoiceF rdm (P.preferByKeys noSetup xs) |
| 408 | + go (GoalChoiceF rdm xs) = GoalChoiceF rdm (P.preferByKeys noSetupOrExe xs) |
409 | 409 | go x = x
|
410 | 410 |
|
411 |
| - noSetup :: Goal QPN -> Bool |
412 |
| - noSetup (Goal (P (Q (PackagePath _ns (QualSetup _)) _)) _) = False |
413 |
| - noSetup _ = True |
| 411 | + noSetupOrExe :: Goal QPN -> Bool |
| 412 | + noSetupOrExe (Goal (P (Q (PackagePath _ns (QualSetup _)) _)) _) = False |
| 413 | + noSetupOrExe (Goal (P (Q (PackagePath _ns (QualExe _ _)) _)) _) = False |
| 414 | + noSetupOrExe _ = True |
414 | 415 |
|
415 | 416 | -- | Transformation that tries to avoid making weak flag choices early.
|
416 | 417 | -- Weak flags are trivial flags (not influencing dependencies) or such
|
|
0 commit comments