{"action":"opened","number":3222,"pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/3222","id":62649032,"html_url":"https://github.com/haskell/cabal/pull/3222","diff_url":"https://github.com/haskell/cabal/pull/3222.diff","patch_url":"https://github.com/haskell/cabal/pull/3222.patch","issue_url":"https://api.github.com/repos/haskell/cabal/issues/3222","number":3222,"state":"open","locked":false,"title":"RFC/Solver split (v2)","user":{"login":"BardurArantsson","id":459138,"avatar_url":"https://avatars.githubusercontent.com/u/459138?v=3","gravatar_id":"","url":"https://api.github.com/users/BardurArantsson","html_url":"https://github.com/BardurArantsson","followers_url":"https://api.github.com/users/BardurArantsson/followers","following_url":"https://api.github.com/users/BardurArantsson/following{/other_user}","gists_url":"https://api.github.com/users/BardurArantsson/gists{/gist_id}","starred_url":"https://api.github.com/users/BardurArantsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BardurArantsson/subscriptions","organizations_url":"https://api.github.com/users/BardurArantsson/orgs","repos_url":"https://api.github.com/users/BardurArantsson/repos","events_url":"https://api.github.com/users/BardurArantsson/events{/privacy}","received_events_url":"https://api.github.com/users/BardurArantsson/received_events","type":"User","site_admin":false},"body":"OK, so this is an RFC for the solver split that I've been working on on-and-off for a while now.\r\n\r\nThis code is mostly just meant for review -- if we decide this is the way to go, I'll rework it into smaller chunks (such as moving type definitions to their own modules, etc.) such that the final \"move all the files\" commit will be as small as possible.\r\n\r\nThe executive summary of what I'm proposing and the diff:\r\n\r\n* Firstly, the diff may look intimidatingly big but it's *literally* just moving bits of code around and adjusting imports. There are absolutely no semantic changes anywhere.\r\n* We introduce a 'cabal-solver' library which lies \"between\" Cabal and cabal-install in the dependency chain. That is: No changes to Cabal, cabal-solver depends on Cabal, and cabal-install depends on Cabal and cabal-solver.\r\n* The modular solver (only) gets moved to cabal-solver. The TopDown solver seems too entangled in the cabal-install code base to be able to sensibly move it. (Considering that it's probably on its way out in some near-future point, it's probably not worth bothering.)\r\n* Some auxiliary modules get moved along, namely `PackageIndex`, `PackageUtils`, `PkgConfigDb` and `ComponentDeps`. A few type definitions from `Distribution.Client.Types` and `Distribution.Client.Dependency.Types` are also moved since they're required for the solver.\r\n* I've chosen to re-export almost everything from cabal-solver in `Distribution.Client.Type` for convenience and to incur fewer \"incidental\" changes which could obfuscate the diff. If we choose my approach to the solver-split, I think we should probably avoid this re-exporting and just add relevant imports where necessary.\r\n* I've not investigated moving the solver unit tests in detail, but I suspect that it'll be quite hard -- I believe some (all?) of the tests rely on having lots of `cabal-install` functionality present. I don't think this is a show-stopper since the tests can happily live in `cabal-install` since we can just export needed functionality via an exposed `Internal` module.\r\n* I haven't updated any of the build scripts, etc. (except `setup-dev.sh`), so I expect travis et al to fail horribly. Obviously I'll get these things fixed if we decide to go ahead.\r\n* I also propse we add documentation to the `cabal-solver` modules stating that it's *not* held to the same strict backward-compatibility standard as `Cabal`. (We'll need to figure something out wrt. stability guarantees, but that's really something that we can address *if* this gets merged.)\r\n\r\nMy main questions for reviewers:\r\n\r\n* Does this overall approach make sense? If no, why not?\r\n* Does the API exposed by my proposed `cabal-solver` make sense for tools that might want to use the solver as a separate entity? If not, what's missing? Are we exposing too much implementation detail? I think it's still a good idea to have a split at this boundary regardless of whether this is immediately useful for 3rd parties[1].\r\n* Can/should we remove TopDown at this point? (It won't affect this *too* much, but I'm just throwing it out there :).)\r\n\r\nI think that's it. Comments welcome!\r\n\r\n[1] The main idea here being that moving to a separate `cabal-solver` package can help enforce proper API boundaries so that the solver doesn't accidentally become hopelessly entangled with implementation details of `cabal-install` over time. I view this as simply good software engineering practice, but that's just my opinion. If 3rd party projects need a larger API or more functionality, then we can introduce a further layer between cabal-solver and cabal-install which can export what they (and cabal-install) needs.\r\n","created_at":"2016-03-12T18:50:11Z","updated_at":"2016-03-12T18:50:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/haskell/cabal/pulls/3222/commits","review_comments_url":"https://api.github.com/repos/haskell/cabal/pulls/3222/comments","review_comment_url":"https://api.github.com/repos/haskell/cabal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/3222/comments","statuses_url":"https://api.github.com/repos/haskell/cabal/statuses/ad1b3a97d47a5a77545f9cfd02f4046a4d7fa52d","head":{"label":"BardurArantsson:split-solver-v2","ref":"split-solver-v2","sha":"ad1b3a97d47a5a77545f9cfd02f4046a4d7fa52d","user":{"login":"BardurArantsson","id":459138,"avatar_url":"https://avatars.githubusercontent.com/u/459138?v=3","gravatar_id":"","url":"https://api.github.com/users/BardurArantsson","html_url":"https://github.com/BardurArantsson","followers_url":"https://api.github.com/users/BardurArantsson/followers","following_url":"https://api.github.com/users/BardurArantsson/following{/other_user}","gists_url":"https://api.github.com/users/BardurArantsson/gists{/gist_id}","starred_url":"https://api.github.com/users/BardurArantsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BardurArantsson/subscriptions","organizations_url":"https://api.github.com/users/BardurArantsson/orgs","repos_url":"https://api.github.com/users/BardurArantsson/repos","events_url":"https://api.github.com/users/BardurArantsson/events{/privacy}","received_events_url":"https://api.github.com/users/BardurArantsson/received_events","type":"User","site_admin":false},"repo":{"id":37976724,"name":"cabal","full_name":"BardurArantsson/cabal","owner":{"login":"BardurArantsson","id":459138,"avatar_url":"https://avatars.githubusercontent.com/u/459138?v=3","gravatar_id":"","url":"https://api.github.com/users/BardurArantsson","html_url":"https://github.com/BardurArantsson","followers_url":"https://api.github.com/users/BardurArantsson/followers","following_url":"https://api.github.com/users/BardurArantsson/following{/other_user}","gists_url":"https://api.github.com/users/BardurArantsson/gists{/gist_id}","starred_url":"https://api.github.com/users/BardurArantsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BardurArantsson/subscriptions","organizations_url":"https://api.github.com/users/BardurArantsson/orgs","repos_url":"https://api.github.com/users/BardurArantsson/repos","events_url":"https://api.github.com/users/BardurArantsson/events{/privacy}","received_events_url":"https://api.github.com/users/BardurArantsson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BardurArantsson/cabal","description":"Official upstream development repository for Cabal and cabal-install","fork":true,"url":"https://api.github.com/repos/BardurArantsson/cabal","forks_url":"https://api.github.com/repos/BardurArantsson/cabal/forks","keys_url":"https://api.github.com/repos/BardurArantsson/cabal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BardurArantsson/cabal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BardurArantsson/cabal/teams","hooks_url":"https://api.github.com/repos/BardurArantsson/cabal/hooks","issue_events_url":"https://api.github.com/repos/BardurArantsson/cabal/issues/events{/number}","events_url":"https://api.github.com/repos/BardurArantsson/cabal/events","assignees_url":"https://api.github.com/repos/BardurArantsson/cabal/assignees{/user}","branches_url":"https://api.github.com/repos/BardurArantsson/cabal/branches{/branch}","tags_url":"https://api.github.com/repos/BardurArantsson/cabal/tags","blobs_url":"https://api.github.com/repos/BardurArantsson/cabal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BardurArantsson/cabal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BardurArantsson/cabal/git/refs{/sha}","trees_url":"https://api.github.com/repos/BardurArantsson/cabal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BardurArantsson/cabal/statuses/{sha}","languages_url":"https://api.github.com/repos/BardurArantsson/cabal/languages","stargazers_url":"https://api.github.com/repos/BardurArantsson/cabal/stargazers","contributors_url":"https://api.github.com/repos/BardurArantsson/cabal/contributors","subscribers_url":"https://api.github.com/repos/BardurArantsson/cabal/subscribers","subscription_url":"https://api.github.com/repos/BardurArantsson/cabal/subscription","commits_url":"https://api.github.com/repos/BardurArantsson/cabal/commits{/sha}","git_commits_url":"https://api.github.com/repos/BardurArantsson/cabal/git/commits{/sha}","comments_url":"https://api.github.com/repos/BardurArantsson/cabal/comments{/number}","issue_comment_url":"https://api.github.com/repos/BardurArantsson/cabal/issues/comments{/number}","contents_url":"https://api.github.com/repos/BardurArantsson/cabal/contents/{+path}","compare_url":"https://api.github.com/repos/BardurArantsson/cabal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BardurArantsson/cabal/merges","archive_url":"https://api.github.com/repos/BardurArantsson/cabal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BardurArantsson/cabal/downloads","issues_url":"https://api.github.com/repos/BardurArantsson/cabal/issues{/number}","pulls_url":"https://api.github.com/repos/BardurArantsson/cabal/pulls{/number}","milestones_url":"https://api.github.com/repos/BardurArantsson/cabal/milestones{/number}","notifications_url":"https://api.github.com/repos/BardurArantsson/cabal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BardurArantsson/cabal/labels{/name}","releases_url":"https://api.github.com/repos/BardurArantsson/cabal/releases{/id}","deployments_url":"https://api.github.com/repos/BardurArantsson/cabal/deployments","created_at":"2015-06-24T09:57:16Z","updated_at":"2016-01-17T08:29:05Z","pushed_at":"2016-03-12T18:20:06Z","git_url":"git://github.com/BardurArantsson/cabal.git","ssh_url":"git@github.com:BardurArantsson/cabal.git","clone_url":"https://github.com/BardurArantsson/cabal.git","svn_url":"https://github.com/BardurArantsson/cabal","homepage":"http://haskell.org/cabal","size":28022,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"haskell:master","ref":"master","sha":"9accafebff3743fc499fa6d565d55ba25326db28","user":{"login":"haskell","id":450574,"avatar_url":"https://avatars.githubusercontent.com/u/450574?v=3","gravatar_id":"","url":"https://api.github.com/users/haskell","html_url":"https://github.com/haskell","followers_url":"https://api.github.com/users/haskell/followers","following_url":"https://api.github.com/users/haskell/following{/other_user}","gists_url":"https://api.github.com/users/haskell/gists{/gist_id}","starred_url":"https://api.github.com/users/haskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haskell/subscriptions","organizations_url":"https://api.github.com/users/haskell/orgs","repos_url":"https://api.github.com/users/haskell/repos","events_url":"https://api.github.com/users/haskell/events{/privacy}","received_events_url":"https://api.github.com/users/haskell/received_events","type":"Organization","site_admin":false},"repo":{"id":3728161,"name":"cabal","full_name":"haskell/cabal","owner":{"login":"haskell","id":450574,"avatar_url":"https://avatars.githubusercontent.com/u/450574?v=3","gravatar_id":"","url":"https://api.github.com/users/haskell","html_url":"https://github.com/haskell","followers_url":"https://api.github.com/users/haskell/followers","following_url":"https://api.github.com/users/haskell/following{/other_user}","gists_url":"https://api.github.com/users/haskell/gists{/gist_id}","starred_url":"https://api.github.com/users/haskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haskell/subscriptions","organizations_url":"https://api.github.com/users/haskell/orgs","repos_url":"https://api.github.com/users/haskell/repos","events_url":"https://api.github.com/users/haskell/events{/privacy}","received_events_url":"https://api.github.com/users/haskell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/haskell/cabal","description":"Official upstream development repository for Cabal and cabal-install","fork":false,"url":"https://api.github.com/repos/haskell/cabal","forks_url":"https://api.github.com/repos/haskell/cabal/forks","keys_url":"https://api.github.com/repos/haskell/cabal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haskell/cabal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haskell/cabal/teams","hooks_url":"https://api.github.com/repos/haskell/cabal/hooks","issue_events_url":"https://api.github.com/repos/haskell/cabal/issues/events{/number}","events_url":"https://api.github.com/repos/haskell/cabal/events","assignees_url":"https://api.github.com/repos/haskell/cabal/assignees{/user}","branches_url":"https://api.github.com/repos/haskell/cabal/branches{/branch}","tags_url":"https://api.github.com/repos/haskell/cabal/tags","blobs_url":"https://api.github.com/repos/haskell/cabal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haskell/cabal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haskell/cabal/git/refs{/sha}","trees_url":"https://api.github.com/repos/haskell/cabal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haskell/cabal/statuses/{sha}","languages_url":"https://api.github.com/repos/haskell/cabal/languages","stargazers_url":"https://api.github.com/repos/haskell/cabal/stargazers","contributors_url":"https://api.github.com/repos/haskell/cabal/contributors","subscribers_url":"https://api.github.com/repos/haskell/cabal/subscribers","subscription_url":"https://api.github.com/repos/haskell/cabal/subscription","commits_url":"https://api.github.com/repos/haskell/cabal/commits{/sha}","git_commits_url":"https://api.github.com/repos/haskell/cabal/git/commits{/sha}","comments_url":"https://api.github.com/repos/haskell/cabal/comments{/number}","issue_comment_url":"https://api.github.com/repos/haskell/cabal/issues/comments{/number}","contents_url":"https://api.github.com/repos/haskell/cabal/contents/{+path}","compare_url":"https://api.github.com/repos/haskell/cabal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haskell/cabal/merges","archive_url":"https://api.github.com/repos/haskell/cabal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haskell/cabal/downloads","issues_url":"https://api.github.com/repos/haskell/cabal/issues{/number}","pulls_url":"https://api.github.com/repos/haskell/cabal/pulls{/number}","milestones_url":"https://api.github.com/repos/haskell/cabal/milestones{/number}","notifications_url":"https://api.github.com/repos/haskell/cabal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haskell/cabal/labels{/name}","releases_url":"https://api.github.com/repos/haskell/cabal/releases{/id}","deployments_url":"https://api.github.com/repos/haskell/cabal/deployments","created_at":"2012-03-15T12:53:38Z","updated_at":"2016-03-12T08:10:58Z","pushed_at":"2016-03-12T12:03:00Z","git_url":"git://github.com/haskell/cabal.git","ssh_url":"git@github.com:haskell/cabal.git","clone_url":"https://github.com/haskell/cabal.git","svn_url":"https://github.com/haskell/cabal","homepage":"http://haskell.org/cabal","size":32253,"stargazers_count":586,"watchers_count":586,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":316,"mirror_url":null,"open_issues_count":680,"forks":316,"open_issues":680,"watchers":586,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/haskell/cabal/pulls/3222"},"html":{"href":"https://github.com/haskell/cabal/pull/3222"},"issue":{"href":"https://api.github.com/repos/haskell/cabal/issues/3222"},"comments":{"href":"https://api.github.com/repos/haskell/cabal/issues/3222/comments"},"review_comments":{"href":"https://api.github.com/repos/haskell/cabal/pulls/3222/comments"},"review_comment":{"href":"https://api.github.com/repos/haskell/cabal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/haskell/cabal/pulls/3222/commits"},"statuses":{"href":"https://api.github.com/repos/haskell/cabal/statuses/ad1b3a97d47a5a77545f9cfd02f4046a4d7fa52d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":832,"deletions":587,"changed_files":60}}