You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolving dependencies for wai repo on GHC 7.6.3 times out with Travis #3453
I started looking into this issue. There is no solution, because there is a conflict between warp's doctest test suite and its benchmarks with GHC 7.6.3.
The test requires doctest, which requires the package ghc. ghc cannot be reinstalled, and the installed version depends on the installed bytestring (0.10.0.2). The benchmark requires criterion >= 1. criterion-1.0.0.0 through 1.1.1.0 all require aeson >= 0.8, and aeson-0.8.0.0 through 0.11.2.0 require bytestring >= 0.10.4.0.
It would be nice to have cabal fail faster, especially when there is a conflict involving so few packages.
@GrayJay Thank you, that information was very useful. For my immediate needs, I've disabled benchmark building for GHC 7.6.3 (yesodweb/wai@7127092), which works around this issue nicely, and we get testing of the wai repo with 7.6.3 again.
I think it would be better if --reorder-goals always ranked goals with 0 or 1 valid choices, like warp:test, ahead of goals with more choices.
Isn't this exactly what --reorder-goals is doing? Or are you saying that this strategy interferes with other heuristics? If you're already set up to test this, could you try with my or your "count-conflicts" branch?
@kosmikus--reorder-goals prefers goals with fewer choices, but only after many choices have been removed by the heuristics phase. PSQ.prefer and preferByKeys remove the non-preferred goals:
I tried your count-conflicts branch, and it finished in about 8 minutes. The final conflict set was aeson, base, bytestring, criterion, directory, doctest, ghc, hashable, http2, psqueues, time, unix, wai-extra, warp, warp-3.2.7:test, warp-3.2.7:bench.
@GrayJay Oh right. I had indeed discovered that in most of the cases where count-conflicts is still slow, the removal of choices in the heuristics phase is the culprit. I think we can/should fix this by switching to a scoring approach, as we've discussed elsewhere. Then we can more easily defer choices without completely removing them.
I'm unfamiliar with how the solver works internally and therefore have no
input, but just wanted to say thank you all for investing time in trying to
resolve this.
On Fri, May 27, 2016 at 10:25 AM, Andres Löh [email protected]
wrote:
@GrayJayhttps://github.com/grayjay Oh right. I had indeed discovered
that in most of the cases where count-conflicts is still slow, the removal
of choices in the heuristics phase is the culprit. I think we can/should
fix this by switching to a scoring approach, as we've discussed elsewhere.
Then we can more easily defer choices without completely removing them.
@kosmikus Yes, I think that would fix the issue. How will --reorder-goals interact with the goal ordering on your branch, or will it no longer be necessary?
I looked into why warp:test is being deferred in the heuristics phase, as @kosmikus suggested. The behavior changed in #3092 and b502b7f.
#3092 added preferPackageStanzaPreferences, which sets stanza nodes to "weak" in order to defer them and allow tests/benchmarks to be disabled more easily when a dependency is unavailable:
inSChoiceF qsn gr True ts' -- True: now weak choice
. b502b7f changed deferWeakFlagChoices to handle stanzas as well as flags.
I think there is a bug in preferPackageStanzaPreferences, because it changes the stanza choice to "weak" even when the preference doesn't apply. But even when the preference does apply, the function causes the stanza to be deferred when a choice has already been made with --enable-tests. One option is to change deferWeakFlagChoices so that it only defers flags and stanzas when no choices have been disabled. But then it would depend on the step that enforces constraints, which would complicate things slightly.
I also noticed that the weak/trivial field on the stanza choice node has a different meaning in other parts of the code. Here it means that the stanza has no dependencies:
@GrayJay The fact that "weak" and "trivial" are mixed up is deliberate. In index conversion, trivial flags and stanzas should get the flag set. Later, it's only relevant for deferral, and since all trivial entities should be weak, it should be safe to set the flag for additional entities that we want to be deferred.
I think I agree that preferPackageStanzaPreferences makes too many stanza choices weak.
More generally, I think we should prefer rather than defer choices for which we know that at most a single option can be taken.
Activity
Allow GHC 7.6.3 to fail haskell/cabal#3453
23Skidoo commentedon May 22, 2016
/cc @kosmikus
sebright commentedon May 23, 2016
I started looking into this issue. There is no solution, because there is a conflict between
warp'sdoctesttest suite and its benchmarks with GHC 7.6.3.The test requires
doctest, which requires the packageghc.ghccannot be reinstalled, and the installed version depends on the installedbytestring(0.10.0.2). The benchmark requirescriterion >= 1.criterion-1.0.0.0through1.1.1.0all requireaeson >= 0.8, andaeson-0.8.0.0through0.11.2.0requirebytestring >= 0.10.4.0.It would be nice to have cabal fail faster, especially when there is a conflict involving so few packages.
snoyberg commentedon May 23, 2016
@GrayJay Thank you, that information was very useful. For my immediate needs, I've disabled benchmark building for GHC 7.6.3 (yesodweb/wai@7127092), which works around this issue nicely, and we get testing of the wai repo with 7.6.3 again.
phadej commentedon May 23, 2016
@GrayJay is the problem because solver tries
ghcquite late in the traversal?sebright commentedon May 26, 2016
cabal tries
ghclate because it waits to trywarp:test. I ran the solver after removing the constraint oncriterionso that it could finish. Here are the logs, with and without--reorder-goals: https://gist.github.com/grayjay/5e889f9a701705399f3a054fbc2ac312. I think it would be better if--reorder-goalsalways ranked goals with 0 or 1 valid choices, likewarp:test, ahead of goals with more choices.kosmikus commentedon May 26, 2016
@GrayJay Sorry, only now looking.
Isn't this exactly what
--reorder-goalsis doing? Or are you saying that this strategy interferes with other heuristics? If you're already set up to test this, could you try with my or your "count-conflicts" branch?sebright commentedon May 27, 2016
@kosmikus
--reorder-goalsprefers goals with fewer choices, but only after many choices have been removed by the heuristics phase.PSQ.preferandpreferByKeysremove the non-preferred goals:cabal/cabal-install/Distribution/Solver/Modular/PSQ.hs
Line 136 in 9d0c0c0
I tried your count-conflicts branch, and it finished in about 8 minutes. The final conflict set was
aeson, base, bytestring, criterion, directory, doctest, ghc, hashable, http2, psqueues, time, unix, wai-extra, warp, warp-3.2.7:test, warp-3.2.7:bench.kosmikus commentedon May 27, 2016
@GrayJay Oh right. I had indeed discovered that in most of the cases where count-conflicts is still slow, the removal of choices in the heuristics phase is the culprit. I think we can/should fix this by switching to a scoring approach, as we've discussed elsewhere. Then we can more easily defer choices without completely removing them.
snoyberg commentedon May 27, 2016
I'm unfamiliar with how the solver works internally and therefore have no
input, but just wanted to say thank you all for investing time in trying to
resolve this.
On Fri, May 27, 2016 at 10:25 AM, Andres Löh [email protected]
wrote:
sebright commentedon May 28, 2016
@kosmikus Yes, I think that would fix the issue. How will
--reorder-goalsinteract with the goal ordering on your branch, or will it no longer be necessary?@snoyberg No problem
sebright commentedon May 31, 2016
I looked into why
warp:testis being deferred in the heuristics phase, as @kosmikus suggested. The behavior changed in #3092 and b502b7f.#3092 added
preferPackageStanzaPreferences, which sets stanza nodes to "weak" in order to defer them and allow tests/benchmarks to be disabled more easily when a dependency is unavailable:cabal/cabal-install/Distribution/Solver/Modular/Preference.hs
Line 122 in 48a1de5
deferWeakFlagChoicesto handle stanzas as well as flags.I think there is a bug in
preferPackageStanzaPreferences, because it changes the stanza choice to "weak" even when the preference doesn't apply. But even when the preference does apply, the function causes the stanza to be deferred when a choice has already been made with--enable-tests. One option is to changedeferWeakFlagChoicesso that it only defers flags and stanzas when no choices have been disabled. But then it would depend on the step that enforces constraints, which would complicate things slightly.I also noticed that the weak/trivial field on the stanza choice node has a different meaning in other parts of the code. Here it means that the stanza has no dependencies:
cabal/cabal-install/Distribution/Solver/Modular/Tree.hs
Lines 53 to 55 in 48a1de5
cabal/cabal-install/Distribution/Solver/Modular/Builder.hs
Line 165 in 48a1de5
/cc @kosmikus @dcoutts
kosmikus commentedon May 31, 2016
@GrayJay The fact that "weak" and "trivial" are mixed up is deliberate. In index conversion, trivial flags and stanzas should get the flag set. Later, it's only relevant for deferral, and since all trivial entities should be weak, it should be safe to set the flag for additional entities that we want to be deferred.
I think I agree that
preferPackageStanzaPreferencesmakes too many stanza choices weak.More generally, I think we should prefer rather than defer choices for which we know that at most a single option can be taken.
phadej commentedon Jun 29, 2016
https://github.com/dmwit/universe solving is quite slow with ghc-7.0.4, and takes ages with
ghc-7.2.2. Example build: https://travis-ci.org/phadej/universe/builds/141199839Let's see if your changes for this issue would improve
universesituation as well.EDIT:
adjunctions >= 4doesn't have a build plan for ghc-7.2.2: http://matrix.hackage.haskell.org/package/adjunctions)--reorder-goalsseems to slow down (to 3m22s from 2m31s) solving for ghc-7.0.2--constraint 'free <4.5the time gets down to 35s for ghc-7.0.2 (guess based on http://matrix.hackage.haskell.org/package/free)kosmikus commentedon Jun 30, 2016
@phadej it seems that universe is nicely handled by
count-conflicts-2as it currently is, without any extra tweaks on how to (not) defer flags.I didn't have 7.2.2 readily available, so I tested with 7.2.1 instead.
Here are times on my machine (with other things running next to it, so not overly reliable, but the relative speedup should be definitive enough): https://gist.github.com/kosmikus/c411abf4390dfd1adbcc16f6b665eb43
--count-conflicts: 2.011s--no-count-conflicts: 160.397s--count-conflicts: 1.961s--no-count-conflicts: 988.347s(I'm a bit surprised that you got 3m22s for 7.2.2. I didn't think my machine to be that slow.)
phadej commentedon Jun 30, 2016
@kosmikus, great to hear! (I haven't waited for ghc-7.2.2, all times were for ghc-7.0.2)
kosmikus commentedon Jun 30, 2016
@phadej I've finally turned this into a PR, so you can test it yourself if you like.
sebright commentedon Jul 5, 2016
This is fixed by #3480. I opened #3482 and #3488 to track the other issues that were brought up by this example.