berkshelf/solve — pull request #33 by danielsdeleo (2014-04-01 17:28:36+00:00)
Title: Quick and dirty adapter to dep_selector

This is quite a ways from being complete, but I wanted to share my progress and give everyone an opportunity to comment.

This currently passes all tests, but I found that dep-selector prefers a different solution for one of the cases in the acceptance tests. I think that's a good thing, since this branch should do what chef-server does (both flavors of enterprise chef, and open source chef once 11.1 is released).

I haven't done much benchmarking, but I'm fairly confident that there is a lot of wasted work happening converting solve's artifact/dependency types to dep-selector's types by passing strings around.

I also noticed that solve supports prerelease version numbers, whereas dep-selector does not. Internally, dep-selector represents different artifact versions as integers (which are translated by way of a sorted ordered set) so I think it should be straightforward to support these in a more sophisticated dep-selector adapter. I can definitely modify dep-selector's APIs to do this if desired, which would probably also take care of the duplicated effort I talked about above.

You'll also see that I added a `debug_demands` feature to the solver. I've tested this branch against one of the Berksfiles in https://github.com/berkshelf/berkshelf/issues/959 I found that dep-selector is unable to identify the exact constraints that cause conflicts in a timely manner, but it is pretty straightforward to at least identify which demands are problematic. It may be possible to optimize dep-selector's debug process by giving it a hint of which artifact is the "troublemaker". You can see my results here: https://gist.github.com/danielsdeleo/9918741 (uses a local branch of berks where I hacked in the call to `debug_demands`

Note also that I'm using a not-yet-merged branch of dep-selector. I'll get that merged and released before this is merged.

Anyway, at this point I'd like to get a consensus on what work needs to be done in order to get this merged, and what kinds of things should be roadmap or wish list items.