Skip to content

Add test case for backjumping when dependencies are not linked - #3363

Merged
edsko merged 1 commit into
haskell:solverfrom
sebright:test-3327
Apr 20, 2016
Merged

edsko merged 1 commit into
haskell:solverfrom
sebright:test-3327

Conversation

@sebright

Copy link
Copy Markdown
Collaborator

This is another test for the issue described in #3327. The previous test started passing after #3221 was merged. I found this test case with QuickCheck and tried to clean it up, but, unfortunately, it's still messy. The failure only occurs with a specific goal order.

The solver must backtrack to avoid linking 1.D. However, none of the conflict sets at level 6 contain 1.D. 1.D should be added on the line with the message "dependencies not linked".

targets: C, A, B
constraints:
  stanzas A test (unknown source)
  stanzas B test (unknown source)
  stanzas C test (unknown source)
  stanzas D test (unknown source)
  stanzas D test (unknown source)
preferences:
strategy: PreferLatestForSelected
reorder goals: False
independent goals: True
avoid reinstalls: False
shadow packages: False
strong flags: False
max backjumps: infinite
[__0] trying: 0.C-1.0.0 (user goal)
[__1] trying: 0.D-2.0.0 (dependency of 0.C-1.0.0)
[__2] trying: 1.A-1.0.0 (user goal)
[__3] trying: 1.B-1.0.0 (dependency of 1.A-1.0.0)
[__4] trying: 1.D~>0.D-2.0.0 (dependency of 1.B-1.0.0)
[__5] trying: 2.B~>1.B-1.0.0 (user goal)
[__6] trying: 2.D~>1.D-2.0.0 (dependency of 2.B-1.0.0)
[__7] rejecting: 2.B-1.0.0:!test (constraint from unknown source requires opposite flag selection)
[__7] rejecting: 2.B-1.0.0:*test (conflict: 2.D==2.0.0, 2.B-1.0.0:test => 2.D==1.0.0)
[__7] fail (backjumping, conflict set: 2.B, 2.D, 2.B-1.0.0:test)
[__6] trying: 2.D~>0.D-2.0.0
[__7] rejecting: 2.B-1.0.0:!test (constraint from unknown source requires opposite flag selection)
[__7] rejecting: 2.B-1.0.0:*test (conflict: 2.D==2.0.0, 2.B-1.0.0:test => 2.D==1.0.0)
[__7] fail (backjumping, conflict set: 2.B, 2.D, 2.B-1.0.0:test)
[__6] rejecting: 2.D-2.0.0 (multiple instances; conflict set: 0.C, 0.D, 2.B, 2.D)
[__6] rejecting: 2.D-1.0.0 (dependencies not linked: cannot make 2.D canonical member of {*0.D-2.0.0,1.D-2.0.0,2.D-2.0.0}; conflict set: 2.B, 2.D)
[__6] fail (backjumping, conflict set: 0.C, 0.D, 2.B, 2.D, 2.B-1.0.0:test)
[__5] rejecting: 2.B-1.0.0 (multiple instances; conflict set: 1.A, 1.B, 2.B)
[__2] fail (backjumping, conflict set: 0.C, 0.D, 1.A, 1.B, 2.B, 2.D, 2.B-1.0.0:test)
[__1] rejecting: 0.D-1.0.0 (conflict: 0.C => 0.D==2.0.0)
[__0] fail (backjumping, conflict set: 0.C, 0.D, 1.A, 1.B, 2.B, 2.D, 2.B-1.0.0:test)
Unit Tests
  UnitTests.Distribution.Client.Dependency.Modular.Solver
    Independent goals
      indepGoals4: FAIL (expected)
        Unexpected error:
        Could not resolve dependencies:
        trying: 2.B~>1.B-1.0.0 (user goal)
        trying: 2.D~>1.D-2.0.0 (dependency of 2.B-1.0.0)
        rejecting: 2.B-1.0.0:!test (constraint from unknown source requires opposite flag selection)
        rejecting: 2.B-1.0.0:*test (conflict: 2.D==2.0.0, 2.B-1.0.0:test => 2.D==1.0.0)
        Dependency tree exhaustively searched.
        (expected failure)

@edsko

edsko commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

Great! Thanks.

@kosmikus

Copy link
Copy Markdown
Contributor

Yes, thanks a lot.

@sebright
sebright deleted the test-3327 branch April 24, 2016 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants