-
kristenk authored
Cabal previously tried all flag combinations, which was very slow. The new algorithm assigns one flag at a time, and backtracks when a flag introduces a dependency that is unavailable. The new algorithm handles the Buildable field by adding an extra conditional at the top level of each component that represents the condition for which the component is buildable. Since all dependencies go under the "then" branch, they are only required when a flag choice makes the component buildable. The buildable logic is taken from the cabal-install dependency solver. This commit also changes the error message that is shown when dependencies are missing. Previously, Cabal printed the shortest list of missing dependencies from a single flag assignment. Now it takes the union of all dependencies that caused it to backtrack when trying different combinations of flags, which requires less searching.
kristenk authoredCabal previously tried all flag combinations, which was very slow. The new algorithm assigns one flag at a time, and backtracks when a flag introduces a dependency that is unavailable. The new algorithm handles the Buildable field by adding an extra conditional at the top level of each component that represents the condition for which the component is buildable. Since all dependencies go under the "then" branch, they are only required when a flag choice makes the component buildable. The buildable logic is taken from the cabal-install dependency solver. This commit also changes the error message that is shown when dependencies are missing. Previously, Cabal printed the shortest list of missing dependencies from a single flag assignment. Now it takes the union of all dependencies that caused it to backtrack when trying different combinations of flags, which requires less searching.
Loading