[Nix-dev] [RFC] Merging of multiple-outputs-sandbox into trunk

Shea Levy shea at shealevy.com
Sun Nov 6 08:26:20 CET 2011


On 11/6/11 2:18 AM, Shea Levy wrote:
> Author: shlevy
> Date: Sun Nov  6 07:18:19 2011
> New Revision: 30258
> URL: https://nixos.org/websvn/nix/?rev=30258&sc=1

Hi all (especially Eelco),

With this commit, I believe the multiple-outputs-sandbox branch is ready 
for consideration to be merged into nix trunk.

On this branch, having multiple outputs in a derivation creates a new 
attribute in the derivation for each output. This new attribute 
evaluates to a derivation that is the same as the original derivation, 
with the following changes:

1. currentOutput is set to the name of the currently-selected output.
2. outPath is set to the output path of the currently-selected output.
3. The context added to outPath contains information about the selected 
output so that when the derivation is coerced to a string the proper 
output can be added as an input to the derivation being instantiated.

See the added tests/multiple-outputs.nix for a basic example.

Additionally, when a derivation path is sent to the builder explicitly 
(i.e. with drv.drvPath), all outputs of the derivation (and its closure) 
are added to the inputs of the derivation being instantiated, not just 
the "out" output.

Any feedback is greatly appreciated. I believe this branch will take us 
one step closer to usable multiple outputs, with the gc bug Eelco 
mentioned in his initial multiple-outputs commit being the only other 
blocking issue I know of.

Thanks,
Shea


More information about the nix-dev mailing list