Skip to content

Fix construction of conflict sets during link validation #3234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

Fix construction of conflict sets during link validation #3234

wants to merge 8 commits into from

Conversation

edsko
Copy link
Contributor

@edsko edsko commented Mar 19, 2016

NOTE: This commit contains four commits, not two; the first two are #3221.

In #2834 @grayjay points out another conflict set construction bug. Actually, this is almost the same bug that was present in the check for the single instance restriction: we were forgetting to call simplifyVar on some variables before adding them to the conflict set.

This PR first adds @grayjay 's test case (another excellent test, thank you very much! :) ) . The next commit just adds some comments to the test explaining what is going on. Commit number 3 just moves some code out of the Modular.Dependency module into two separate Var and ConflictSet modules; it does not make any actual changes to the semantics. The actual fix is in the final commit, which makes ConflictSet abstract and makes sure that whenever we add a variable to a ConflictSet, or check whether a variable is a member of a conflict set, that we call simplifyVar first. This fixes this particular test case and also makes me feel a lot less anxious about other such bugs still being present.

Pinging @kosmikus and @dcoutts .

grayjay and others added 7 commits March 12, 2016 12:44
Not entirely sure if this is right; needs review by @kosmikus.

If correct, fixes #2843.
In preparation for making ConflictSet abstract.
for compatibility with older `containers` packages. Hopefully this will fix the
build error on 7.4.
@edsko
Copy link
Contributor Author

edsko commented Mar 19, 2016

Pushed commit to try to fix build error on 7.4.

@edsko
Copy link
Contributor Author

edsko commented Mar 19, 2016

New travis failure seems to be transient?

@23Skidoo
Copy link
Member

Restarted the build.

@23Skidoo
Copy link
Member

The remaining failure is due to -Werror:

Distribution/Client/Dependency/Modular/ConflictSet.hs:65:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Ord qpn
    • In the type signature for:
           filter :: Ord qpn =>
                     (Var qpn -> Bool) -> ConflictSet qpn -> ConflictSet qpn

@edsko
Copy link
Contributor Author

edsko commented Mar 20, 2016

Oh FFS 😧 Final attempt :-)

@dcoutts
Copy link
Contributor

dcoutts commented Mar 28, 2016

I've merged these patches to the nix-local-build branch (along with all the other recent solver PRs).

@edsko
Copy link
Contributor Author

edsko commented Apr 23, 2016

This has been merged into and subsumed by #3357 .

@edsko edsko closed this Apr 23, 2016
@edsko edsko deleted the pr/IndepConflictSets branch April 23, 2016 03:27
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.

5 participants