Ayende @ Rahien

It's a girl

Package management for .NET: Nu

Package management for .NET has long been an issue. I won’t rehash the story, but you can read about a lot of the problems here.

There has been several attempts to replicate the success of Gems in Ruby, but none has really taken hold. Dru Sellers & Rob Reynolds had decided to take a slightly different approach. Instead of trying to replicate Ruby’s gems, just use them.

That is how Nu was created (and I really want to know what that name was picked, I nearly titled this post Dr. No). Before you can use Nu, you need to install it, which means that you have to make the following one time steps:

  • Install Ruby (you can also use Iron Ruby, but the Ruby installer is just sweet & painless).
  • gem install nu

Once this is done, all you need to do to install a piece of software is just write:

  • nu install rhino.mocks
  • nu install nhibernate

And Nu will get the latest version (including resolving dependencies) and put them in your lib folder.

After executing the two commands above, I have the following contents in my lib directory.

  • castle.core
  • castle.dynamicproxy2
  • log4net
  • nhibernate
  • rhino.mocks

I like it, it is going to make things so much simpler!

Comments

tobi
08/01/2010 10:19 AM by
tobi

Great. MSIs should work that way too.

Will
08/01/2010 10:28 AM by
Will

Ayende: Awesome find. Thanks for that.

Tobi: Sorry, no, MSIs are trying to solve an entirely different problem.

I can just hear the screams from sysadmins on any non-trivial network who're told they an now install software this way.

Elias Rangel
08/01/2010 04:59 PM by
Elias Rangel

@Will: Possible sysadmin scenario:

1-Set up an internal gem server

2-Authorize QA to publish tested & approved Gems

3-Deploy Gems in production/staging with all dependencies solved.

I'm not sure if something like that could be achieved, but it would ease things a lot.

Yet another Tobi
08/01/2010 05:04 PM by
Yet another Tobi

This is certainly kinda cool, but IMHO a package management would only be useful if it's part of the OS. This will probably never happen to Microsoft, but I wish, I could just do:

apt-get install RavenDB

and it would just install .NET 4.0, log4net, Lucene.Net, Escent and whatever else is required.

Bjartn
08/01/2010 05:18 PM by
Bjartn

Great and simple. The only small problem is the dependency on Ruby, but I can live with that. -I will check this out right away.

mattmc3
08/01/2010 05:40 PM by
mattmc3

"it is going to make things so much simpler!"

Just a thought - it would also make things simpler if there weren't so many dependencies. Castle.X.dll, log4net, the fluent dlls, the linq dlls... I understand technically why we have all the dependencies, but it does create an unnecessarily large barrier to entry for the layman. For quite a while there, if you wanted to use Linq with nHibernate, you had to figure out just the right mixture of dlls. It's really the sort of thing ILMerge was invented for.

marek
08/01/2010 06:53 PM by
marek

I love it :)

I think .NET developers, especially web developers should really take a look on Ruby on Rails. It is so much easier at RoR side...

I'd like to see someday integrated ActiveRecord for ASP.NET as we have it on for Rails. It could be Castle ActiveRecord, NH, whatever, the most important thing it should not required too much configuration as it requires at the moment.

Thanks,

Marek

Mikael Henriksson
08/01/2010 07:25 PM by
Mikael Henriksson

@marek, I fail to see how Ruby is easier. It's a pain to get setup on a windows machine but maybe you are not on windows?

Josh
08/01/2010 10:06 PM by
Josh

Is this all setup to get the latest trunk versions or the latest stable releases?

NoWindows
08/01/2010 10:40 PM by
NoWindows

@Mikael

Windows - we dont need no stinkin Windows..

Jeff Doolittle
08/02/2010 01:59 AM by
Jeff Doolittle

How about RavenDB as a nu package?

Garrett Serack
08/02/2010 03:45 AM by
Garrett Serack

You can also check out the CoApp project (coapp.org) that is building package management for Windows that supports native, .NET, java, and others.

I like the simplicity behind the way this works, and we're working on being able to consume gems from inside CoApp as well.

marek
08/02/2010 05:54 AM by
marek

@Mikael

I'm on Windows, and it is still easier - especially when we are taliking about data access.

Regards,

Marek

Dennis
08/02/2010 06:11 AM by
Dennis

I cant get this to work... I just get a .nu dir with a tiny file and nothing else. Cannot find out which packages are available for nu or gem

hrvoje
08/02/2010 07:35 AM by
hrvoje

How do I update downloaded libs?

Bil Simser
08/02/2010 02:42 PM by
Bil Simser

@Dennis: Check out the links from Rob as there's a page there with a list of the current packages.

I looked at a lot of alternatives (including CoApp) and they all try to re-invent the wheel. This one just builds on what's out there.

The one wrinkle is that we're pushing gems up to rubygems.org and there's some contention in the community around this. People feel rubygems is for "ruby" gems. Fair enough. There are works underway to get a gem server specifically for .NET. It's just a matter of getting the proper infrastructure in place so it supports the entire .NET community as that's no easy feat.

I will look tonight at building a RavenDB gem ;)

Thanks to Ayende for liking this approach. Between all the ones out there, this one has the least friction and most potential. Like I said in my post on the subject, .NET developers just need to install Ruby and get over it. It's a non-issue.

Frank Quednau
08/02/2010 03:01 PM by
Frank Quednau

Never understood the name...I still have a domain hanging around called bin4net, since I was working on package management in my spare time, with code-based descriptor and download based on bittorrent, but frankly, hangin' yourself into gems is probably the most efficient option. Would just need a decent entry page such that people like Dennis (and probably me) know how to get the stuff.

Rob
08/03/2010 04:37 AM by
Rob

google groups is anything but decent...

Sebastien Lambla
08/03/2010 10:08 PM by
Sebastien Lambla

And just for good measure, I'll remind everyone that there's also OpenWrap, that looks more like bundler than gems.

Mohammad Azam
08/04/2010 02:32 PM by
Mohammad Azam

Hi,

This is way too cool! This will make things much simpler when installing different components. Thanks for creating such a nice tool!

Comments have been closed on this topic.