{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/3082","labels_url":"https://api.github.com/repos/haskell/cabal/issues/3082/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/3082/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/3082/events","html_url":"https://github.com/haskell/cabal/pull/3082","id":129062942,"number":3082,"title":"Improve algorithm for choosing flags with './Setup configure'","user":{"login":"grayjay","id":4276753,"avatar_url":"https://avatars.githubusercontent.com/u/4276753?v=3","gravatar_id":"","url":"https://api.github.com/users/grayjay","html_url":"https://github.com/grayjay","followers_url":"https://api.github.com/users/grayjay/followers","following_url":"https://api.github.com/users/grayjay/following{/other_user}","gists_url":"https://api.github.com/users/grayjay/gists{/gist_id}","starred_url":"https://api.github.com/users/grayjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grayjay/subscriptions","organizations_url":"https://api.github.com/users/grayjay/orgs","repos_url":"https://api.github.com/users/grayjay/repos","events_url":"https://api.github.com/users/grayjay/events{/privacy}","received_events_url":"https://api.github.com/users/grayjay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/haskell/cabal/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/haskell/cabal/labels/library","name":"library","color":"AECF38"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-27T07:47:57Z","updated_at":"2016-01-28T20:37:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/3082","html_url":"https://github.com/haskell/cabal/pull/3082","diff_url":"https://github.com/haskell/cabal/pull/3082.diff","patch_url":"https://github.com/haskell/cabal/pull/3082.patch"},"body":"Cabal previously tried all flag combinations, which was very slow.  The new\r\nalgorithm assigns one flag at a time, and backtracks when a flag introduces a\r\ndependency that is unavailable.\r\n\r\nThe new algorithm handles the Buildable field by adding an extra conditional at\r\nthe top level of each component that represents the condition for which the\r\ncomponent is buildable.  Since all dependencies go under the \"then\" branch, they\r\nare only required when a flag choice makes the component buildable.  The buildable\r\nlogic is taken from the cabal-install dependency solver.\r\n\r\nThis commit also changes the error message that is shown when dependencies are\r\nmissing.  Previously, Cabal printed the shortest list of missing dependencies\r\nfrom a single flag assignment.  Now it takes the union of all dependencies that\r\ncaused it to backtrack when trying different combinations of flags, which\r\nrequires less searching.\r\n\r\nI updated #2925 to allow backtracking to work with the Buildable field.  I moved the `extractCondition` function (added in #2731) from the modular solver to `Distribution.PackageDescription.Configuration` so that it can be used by Cabal and cabal-install.  Since `extractCondition` is not a very general utility function, I was wondering if there is a better place to put it."},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/176403144","html_url":"https://github.com/haskell/cabal/pull/3082#issuecomment-176403144","issue_url":"https://api.github.com/repos/haskell/cabal/issues/3082","id":176403144,"user":{"login":"23Skidoo","id":47439,"avatar_url":"https://avatars.githubusercontent.com/u/47439?v=3","gravatar_id":"","url":"https://api.github.com/users/23Skidoo","html_url":"https://github.com/23Skidoo","followers_url":"https://api.github.com/users/23Skidoo/followers","following_url":"https://api.github.com/users/23Skidoo/following{/other_user}","gists_url":"https://api.github.com/users/23Skidoo/gists{/gist_id}","starred_url":"https://api.github.com/users/23Skidoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/23Skidoo/subscriptions","organizations_url":"https://api.github.com/users/23Skidoo/orgs","repos_url":"https://api.github.com/users/23Skidoo/repos","events_url":"https://api.github.com/users/23Skidoo/events{/privacy}","received_events_url":"https://api.github.com/users/23Skidoo/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T20:37:09Z","updated_at":"2016-01-28T20:37:09Z","body":"The `containers` test suite depends on `containers`, so the `cabal-install` solver fails to find a solution when you run `configure --enable-tests` because of circular dependencies. The `./Setup configure` solver works in this case, so it's important to make sure that it continues to work. See e.g. #1806, #1575, #935, #960."}}