[Nix-dev] Re: May I remove the old python code?

Peter Simons simons at cryp.to
Wed Jan 14 23:07:28 CET 2009


Hi Michael,

 >> I want to build "cheetahTemplate" with both Python 2.5 and Python
 >> 2.6. How is that supposed to be done? My impression is that the
 >> recently added "override" feature is the way to go in that area.
 >
 > If I understand anything, override is exactly not the answer to your
 > question (py 2.5+2.6).

Why not? Consider the following (fictional) package database:

  {
     python24 = import ../development/interpreters/python/2.4 { ... };
     python25 = import ../development/interpreters/python/2.5 { ... };
     python26 = import ../development/interpreters/python/2.6 { ... };
     python   = python24;
     cheetahTemplate = import ../tools/text/cheetah-template { inherit python; };
  }

Building Cheetah with both python 2.5 and 2.6 means instantiating the
expression cheetahTemplate twice -- the 'python' attribute is overridden
with 'python25' and 'python26' respectively. On the command line, this
could be done quite easily, say:

  nix-env --override python=python25,python26 -i -A cheetahTemplate

To me, this mechanism seems very powerful, because every single
attribute can be overridden by the user, just like that.

Anyway, I'm not a genuine Nix expert and it's likely that my notions are
naive or flat-out wrong. This problem fascinates me, however, and I
would be happy if someone has a better idea or can provide an insight as
for what's wrong with this one.

Take care,
Peter




More information about the nix-dev mailing list