Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flag goal generation (and hopefully haskell#1855).
Package flags generate (Boolean) goals. Package flags can be dependent on one another, in situations such as this one: if flag(a) ... else if flag(b) ... else ... In such a scenario, it's important to record that flag b depends on flag a. This affects conflict set generation. If something fails due to the choice of flag b, we should not backjump beyond flag a. While the code handling the proper insertion of goals with their correct dependencies was always there, it was accidentally overridden by another piece of code that created flag goals (without dependencies) for all flags defined in a package. The reason I add flag goals separately is because not all paths in the decision tree may contain choices for all flags of a package. For example, if a is chosen to be True in the example above, b does not occur at all. But flag choices may still affect other things that aren't visible to the solver (directory choices, exposed modules, ...), so all flags declared should always be chosen explicitly. So we want to keep adding all flags declared in a package as dummies, but we have to make sure to do so *before* adding the actual dependency tree. This way, while traversing the dependency tree, the ones occurring in dependencies will be added again, overriding the dummies, rather than the other way round (which we used to have before, where the dummies were overwriting the more informative versions).
- Loading branch information