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
new-build dependency solver failure with GHC 7.0 #4154
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: time-setup.Cabal~>entropy-setup.Cabal-1.20.0.4 (dependency of time-1.1.2.3)
trying: time-setup.time~>entropy-setup.time-1.1.2.3 (dependency of time-1.1.2.3)
Dependency tree exhaustively searched.
I'm not sure how to interpret the error message - the first line suggests it's trying to link the Cabal versions used for time and entropy's setup programs, but I'm not sure what the second line is about at all.
I think the problem is that your time constraint is forcing the dependency resolution for the setup script to not pick the installed version of Cabal, and then a pile of constraints cause things to fail (I think sandboxes are less clever when it comes to setup dependencies). So what you would like is a way to specify the constraint, but only for the main dep solving and not setup deps. I don't know how to do that. See also #3502
I don't understand the error you get from cabal-install HEAD: can't it just install a new random?
FWIW I'm using an old GHC and time to test that HTTP continues to work with its lower bounds. If I can't make this work I'll just bump them, but I thought it was worth investigating/understanding because the error didn't seem specific to using very old software.
I think there are two more bugs here. new-build adds default setup dependencies to packages that have build-type: Custom. One of the defaults is time (
), though time-1.1.2.3 also has build-type Custom. This creates a cycle. Then the solver filters the full log incorrectly and doesn't show the most important line. Here is the end of the -v3 log, with the message about cyclic dependencies on the last line:
[109] trying: time-setup.Cabal~>entropy-setup.Cabal-1.20.0.4 (dependency of time-1.1.2.3)
[110] trying: time-setup.Cabal-1.20.0.4:!test
[111] trying: time-setup.template-haskell~>entropy-setup.template-haskell-2.5.0.0/installed-957... (dependency of time-1.1.2.3)
[112] trying: time-setup.ghc-prim~>entropy-setup.ghc-prim-0.2.0.0/installed-d9d... (dependency of time-1.1.2.3)
[113] trying: time-setup.unix~>entropy-setup.unix-2.4.2.0/installed-58b... (dependency of time-1.1.2.3)
[114] trying: time-setup.transformers~>entropy-setup.transformers-0.5.2.0 (dependency of time-1.1.2.3)
[115] trying: time-setup.time~>entropy-setup.time-1.1.2.3 (dependency of time-1.1.2.3)
[116] trying: time-setup.time-1.1.2.3:+split-base
[117] trying: time-setup.old-locale~>entropy-setup.old-locale-1.0.0.2/installed-161... (dependency of time-setup.time-1.1.2.3:+split-base)
[118] trying: time-setup.process~>entropy-setup.process-1.0.1.5/installed-da4... (dependency of time-1.1.2.3)
[119] trying: time-setup.pretty~>entropy-setup.pretty-1.0.1.2/installed-f8d... (dependency of time-1.1.2.3)
[120] trying: time-setup.old-time~>entropy-setup.old-time-1.0.0.6/installed-7f1... (dependency of time-1.1.2.3)
[121] trying: time-setup.filepath~>entropy-setup.filepath-1.2.0.0/installed-b4f... (dependency of time-1.1.2.3)
[122] trying: time-setup.directory~>entropy-setup.directory-1.1.0.0/installed-393... (dependency of time-1.1.2.3)
[123] next goal: time-setup.deepseq (dependency of time-1.1.2.3)
[123] rejecting: time-setup.deepseq~>deepseq-1.4.2.0 (dependencies not linked: cannot merge {*entropy-setup.deepseq-1.3.0.2,time-setup.deepseq-1.3.0.2} and {*deepseq-1.4.2.0}; conflict set: deepseq, entropy-setup.deepseq, entropy-setup.time, time-setup.Cabal, time-setup.deepseq, time-setup.time)
[123] trying: time-setup.deepseq~>entropy-setup.deepseq-1.3.0.2
[124] trying: time-setup.containers~>entropy-setup.containers-0.4.0.0/installed-b48... (dependency of time-1.1.2.3)
[125] trying: time-setup.bytestring~>entropy-setup.bytestring-0.9.1.10/installed-6aa... (dependency of time-1.1.2.3)
[126] trying: time-setup.binary~>entropy-setup.binary-0.8.2.1 (dependency of time-1.1.2.3)
[127] trying: time-setup.binary-0.8.2.1:!bench
[128] trying: time-setup.binary-0.8.2.1:!test
[129] next goal: time-setup.array (dependency of time-1.1.2.3)
[129] rejecting: time-setup.array~>entropy-setup.array-0.3.0.2/installed-143... (cyclic dependencies; conflict set: time-setup.Cabal, time-setup.time)
Even the full log is a little misleading, because the solver doesn't complain about the cycle until after it has chosen all of the dependencies. One solution would be to check for cycles at every step.
I'm not sure what we should do about the default setup dependencies.
@GrayJay thanks for the explanation - which also points to a simpler repro.
I see the same problem either building time-1.1.2.3 itself, or a fresh cabal project that depends on time, both with the --constraint time==1.1.2.3' specification. Specifying a dependency on time==1.1.2.3` in the fresh cabal project itself is fine as we might expect, as it doesn't constrain the setup dependency.
Yes, when time's setup script depends on the installed time, it isn't considered a cycle.
I just realized that the log actually refers to a cycle between Cabal and time. That seems harder to fix, because it's a real cycle: time has a setup dependency on Cabal, and Cabal has a regular dependency on time. The solver currently doesn't detect cycles involving just one package: #4161
Isn't this a general bootstrapping problem? For example if I unpack Cabal itself locally, and try to new-build it with a constraint on the same version (e.g. Cabal==1.24.1.0) it looks like the solver also fails.
I think as @ezyang says we need a way to specify the constraint without constraining setup deps. In fact I'd say that should be the default, and we'd need something explicit to constrain setup deps. Otherwise you're always risking confusion if you try to constrain something that happens to be a dep of Cabal.
I think as @ezyang says we need a way to specify the constraint without constraining setup deps. In fact I'd say that should be the default, and we'd need something explicit to constrain setup deps. Otherwise you're always risking confusion if you try to constrain something that happens to be a dep of Cabal.
I think it makes sense to only constrain the main dependencies by default, to avoid interfering with bootstrapping.
Activity
ezyang commentedon Dec 5, 2016
One thing that pops out to me: GHC 7.0.4 is really old. When I run your repro steps with cabal-install HEAD, I get this:
ezyang commentedon Dec 5, 2016
I think the problem is that your
timeconstraint is forcing the dependency resolution for the setup script to not pick the installed version of Cabal, and then a pile of constraints cause things to fail (I think sandboxes are less clever when it comes to setup dependencies). So what you would like is a way to specify the constraint, but only for the main dep solving and not setup deps. I don't know how to do that. See also #3502hsenag commentedon Dec 6, 2016
I don't understand the error you get from cabal-install HEAD: can't it just install a new
random?FWIW I'm using an old GHC and time to test that HTTP continues to work with its lower bounds. If I can't make this work I'll just bump them, but I thought it was worth investigating/understanding because the error didn't seem specific to using very old software.
Thanks for looking at this, in any case.
sebright commentedon Dec 6, 2016
I think there are two more bugs here. new-build adds default setup dependencies to packages that have
build-type: Custom. One of the defaults istime(cabal/cabal-install/Distribution/Client/ProjectPlanning.hs
Lines 2503 to 2505 in 32cae60
time-1.1.2.3also has build-type Custom. This creates a cycle. Then the solver filters the full log incorrectly and doesn't show the most important line. Here is the end of the -v3 log, with the message about cyclic dependencies on the last line:Even the full log is a little misleading, because the solver doesn't complain about the cycle until after it has chosen all of the dependencies. One solution would be to check for cycles at every step.
I'm not sure what we should do about the default setup dependencies.
/cc @dcoutts
EDIT: I ran cabal with --max-backjumps=0, which is why the log stopped after the first error.
hsenag commentedon Dec 6, 2016
@GrayJay thanks for the explanation - which also points to a simpler repro.
I see the same problem either building time-1.1.2.3 itself, or a fresh cabal project that depends on time, both with the
--constraint time==1.1.2.3' specification. Specifying a dependency ontime==1.1.2.3` in the fresh cabal project itself is fine as we might expect, as it doesn't constrain the setup dependency.sebright commentedon Dec 7, 2016
Yes, when
time's setup script depends on the installedtime, it isn't considered a cycle.I just realized that the log actually refers to a cycle between
Cabalandtime. That seems harder to fix, because it's a real cycle:timehas a setup dependency onCabal, andCabalhas a regular dependency ontime. The solver currently doesn't detect cycles involving just one package: #4161hsenag commentedon Dec 7, 2016
Isn't this a general bootstrapping problem? For example if I unpack
Cabalitself locally, and try tonew-buildit with a constraint on the same version (e.g.Cabal==1.24.1.0) it looks like the solver also fails.I think as @ezyang says we need a way to specify the constraint without constraining setup deps. In fact I'd say that should be the default, and we'd need something explicit to constrain setup deps. Otherwise you're always risking confusion if you try to constrain something that happens to be a dep of
Cabal.Solver: Check for cycles after every step.
Solver: Check for cycles after every step.
sebright commentedon Dec 19, 2016
I think it makes sense to only constrain the main dependencies by default, to avoid interfering with bootstrapping.
Solver: Check for cycles after every step.
Add regression test for issue haskell#4154.
2 remaining items
Add regression test for issue haskell#4154.
Add regression test for issue haskell#4154.
Add regression test for issue #4154.
sebright commentedon Feb 5, 2017
#4176 fixed the bad error message, and #4257 made unqualified constraints only apply to top-level dependencies.
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Rerun dependency solver to generate a better error message (issue has…
Update regression test for issue haskell#4154 after the fix for issue h…
Update regression test for issue haskell#4154 after the fix for issue h…
Merge pull request #5186 from grayjay/update-T4154
Update regression test for issue haskell#4154 after the fix for issue h…
Merge pull request #5192 from grayjay/update-T4154-2.2