Dependency Version Leveling

Oct 23, 2010 at 1:58 PM
Basically this is when you have a set of packages already existing on your system, and you decide you want a new package that shares dependencies with at least one existing package. But the new package has different version needs of those dependent packages than the current existing package(s).
Let's take the prevelant example of FluentNHibernate and Castle.Windsor. It's a real world example.
FluentNHibernate uses NHibernate. NHibernate with Castle Integration uses Castle.Core. The more recent versions of Castle.Windsor use a different version of Castle.Core.
It's easier to illustrate this looking at the gems. http://rubygems.org/gems/fluentnhibernate/ . The current version of FNH is 1.1.0.685. Notice how it has a dependency on NHibernate 2.1.2.4000. Click on the dependency and it will take you to NHibernate's gem and you can see it's dependencies, one of which is Castle.Core 1.1.0.0.
Now let's look at Castle.Windsor. http://rubygems.org/gems/castle.windsor It's current version has a dependency on Castle.Core 2.5.1.0 (plus package date).  There is a version of Castle.Windsor in there that agrees with FluentNHibernate and NHibernate. That version is 2.0.0.0 ( http://rubygems.org/gems/castle.windsor/versions/2.0.0.0 ). 
So now onto the first two scenarios.
When users want to use both libraries, what should NuPack do in this scenario? Should it:
1. Just bring in the packages for castle.core and then the user have two conflicting versions of libraries on their system?
2. Downgrade the incoming package version until it finds a suitable match and automatically installs that version?
3. Try to upgrade the existing packages to match the incoming package dependency version needs?
4. Not allow them to install the incoming package until they solve the issue themselves?
When it can't find a match, what should NuPack do? Should it:
1. Not allow the package to be installed?
2. Inform the user, give them the option to stop or continue anyway? (as in don't restrict me, I know what I am doing)
Brendan Erwin has some really good thoughts into dealing with conflicts: http://brendanjerwin.com/development/dotnet/nuproj/2010/09/09/dependency-version-leveling.html
Oct 23, 2010 at 2:12 PM

I have created a work item, please vote for it and comment if you #2 and #2 for the two above scenarios: http://nupack.codeplex.com/workitem/296