{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/3222","repository_url":"https://api.github.com/repos/haskell/cabal","labels_url":"https://api.github.com/repos/haskell/cabal/issues/3222/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/3222/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/3222/events","html_url":"https://github.com/haskell/cabal/pull/3222","id":140406371,"number":3222,"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},"labels":[{"url":"https://api.github.com/repos/haskell/cabal/labels/blocked:%20action-required","name":"blocked: action-required","color":"c5def5"},{"url":"https://api.github.com/repos/haskell/cabal/labels/cabal-install:%20solver","name":"cabal-install: solver","color":"d93f0b"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":48,"created_at":"2016-03-12T18:50:12Z","updated_at":"2016-09-06T23:12:30Z","closed_at":"2016-08-30T17:52:59Z","pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/3222","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"},"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 in a separate commit, 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\r\nEDIT: Formatting."},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/245124843","html_url":"https://github.com/haskell/cabal/pull/3222#issuecomment-245124843","issue_url":"https://api.github.com/repos/haskell/cabal/issues/3222","id":245124843,"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},"created_at":"2016-09-06T23:12:30Z","updated_at":"2016-09-06T23:12:30Z","body":"@bitemyapp Most of the actual \"really important\" changes in here have been merged (separately) -- those were mostly about separating the logical \"solver\" bits from \"cabal-install\". The rest of this PR was mostly just about creating a new .cabal file, etc. etc., and so was (ultimately) not that interesting.\r\n\r\n> > avoid accidentally introducing new dependencies from the solver into cabal-install again,\r\n\r\n> Do you mean Cabal? If not, could you clarify the objection here?\r\n\r\nI'm not sure I understand what you mean here. Can you clarify?"}}
{"actor":{"display_login":"BardurArantsson"}}