Repository navigation
Description
While experimenting with the custom-setup section, I was unable to reinstall a package that depended on two versions of another package. The list of targets in the -v3 log contained all of the installed packages, as well as a second occurrence of the main package. The extra target seemed to prevent the solver from choosing setup dependencies.
I wrote some tests that demonstrate the behavior. The unit tests show the effect of duplicate targets, and the integration test reproduces the problem in a sandbox. I'm not sure if this is a bug in sandboxes or the solver.
EDIT: The integration test installs the two dependencies in the sandbox, but I got a similar error when they were installed globally.
Tests: sebright@42a8bd1
Log: https://ci.appveyor.com/project/grayjay/cabal/build/1.0.78
Unit test database:
[
Right $ exAv "A" 1 [ExAny "B"] `withSetupDeps` [ExFix "C" 1]
, Right $ exAv "B" 1 [] `withSetupDeps` [ExFix "C" 2]
, Right $ exAv "C" 1 []
, Right $ exAv "C" 2 []
]Installing A and B:
targets: A, B
[...]
[__0] trying: A-1.0.0 (user goal)
[__1] trying: B-1.0.0 (user goal)
[__2] next goal: A-setup.C (dependency of A-1.0.0)
[__2] rejecting: A-setup.C-2.0.0 (conflict: A => A-setup.C==1.0.0)
[__2] trying: A-setup.C-1.0.0
[__3] next goal: B-setup.C (dependency of B-1.0.0)
[__3] rejecting: B-setup.C~>A-setup.C-1.0.0 (conflict: B => B-setup.C==2.0.0)
[__3] trying: B-setup.C-2.0.0
[__4] done
Specifying each target twice:
targets: A, A, B, B
[...]
[__0] trying: A-1.0.0 (user goal)
[__1] trying: A~>A-1.0.0 (user goal)
[__2] trying: B-1.0.0 (user goal)
[__3] trying: B~>B-1.0.0 (user goal)
[__4] next goal: A-setup.C (dependency of A-1.0.0)
[__4] rejecting: A-setup.C-2.0.0 (conflict: A => A-setup.C==1.0.0)
[__4] trying: A-setup.C-1.0.0
[__5] next goal: B-setup.C (dependency of B-1.0.0)
[__5] rejecting: B-setup.C~>A-setup.C-1.0.0 (conflict: B => B-setup.C==2.0.0)
[__5] rejecting: B-setup.C-2.0.0 (dependencies not linked: cannot make B-setup.C canonical member of {*A-setup.C-1.0.0,B-setup.C-1.0.0,C-1.0.0}; conflict set: B-setup.C, A, B)
[__5] rejecting: B-setup.C-1.0.0 (multiple instances)
[__4] fail (backjumping, conflict set: A-setup.C, B-setup.C, A, B)
[__3] rejecting: B-1.0.0 (multiple instances)
[__2] fail (backjumping, conflict set: A-setup.C, B-setup.C, A, B)
[__1] rejecting: A-1.0.0 (multiple instances)
[__0] fail (backjumping, conflict set: A-setup.C, B-setup.C, A, B)
Activity
23Skidoo commentedon Mar 9, 2016
Can this be solved by simply deduplicating the list of targets?
sebright commentedon Mar 9, 2016
I don't know. I didn't understand why the solver linked the unqualified goals and rejected
B-setup.C-2.0.0in the second run.sebright commentedon Apr 13, 2016
@23Skidoo It looks like the open solver pull requests allow the solver to handle duplicate targets.
sebright commentedon Jul 5, 2016
@23Skidoo Do you mind if I create a label for issues with build type Custom?
23Skidoo commentedon Jul 5, 2016
@GrayJay Not at all, please go ahead.
sebright commentedon Jul 5, 2016
Thanks. How about "custom-setup"?
23Skidoo commentedon Jul 5, 2016
SGTM.
Deduplicate build targets by storing them in a set.
sebright commentedon Sep 5, 2016
The failure to find an install plan was fixed by #3357, and #3779 removes the duplicate targets.
Deduplicate build targets by storing them in a set.
Test that the dependency solver can deduplicate targets (issue haskel…
sebright commentedon Sep 7, 2016
Fixed