Repository navigation
Solver feature: soft prefs for enabling testsuites/benchmarks - #3092
Merged
Merged
Conversation
Member
|
LGTM. |
The solver has the concept of hard constraints and soft preferences. For versions we have both constraints and preferences. We also have soft preferences available for whether we'd like installed instanes or not. We also have hard constraints for enabling "optional stanzas" (ie test suites or benchmarks). This patch adds soft preferences for the same. That is it lets us express the desire to please try enabling test suites and/or benchmarks, but allow them to be disabled if a solution cannot easily be found with them enabled. The implementation is very straightforward and not at all scary. :-) The original design was discussed with kosmikus and it has seen extensive testing in the nix-local-build branch. Optional stanzas in the solver are treated very much like flags, and so we can follow the pattern of a similar feature for flags for this feature for optional stanzas. For both flags and optional stanzas the solver has a node with up to two choices: True & False, corresponding to enable and disable. Various policies can be expressed by reordering these two choices or replacing one or other branch with failure. For example we can force enabling by replacing the False choice with failure. Flag default values are implemented by reordering the True and False branches (since the solver will try the first branch first). So this preference is implemented simply by reordering to put the True branch first (keeping both branches). That way the solver will try the enable branch first and backtrack to the False branch (which imposes no constraints). It integrates smoothly with stanza constraints, which adjusts the False branch to be a failure, thereby forcing the True branch (or further failure). The top down solver is simply adjusted for the types, the feature is not implemented there. The feature is not yet used. It's not intended to have any command line flag, but to express future policies.
Contributor
Author
|
Thanks! (Added the comment requested, but left the nub) |
dcoutts
added a commit
that referenced
this pull request
Jan 29, 2016
Solver feature: soft prefs for enabling testsuites/benchmarks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the long description in the patch