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

Nicolas Pierron nicolas.b.pierron at gmail.com
Sun Nov 6 22:01:24 CET 2011


Hi Shea,

I guess the context is used to be able to build multiple outputs out
of one derivation file, am I correct ?

What can be achieved with multiple outputs ?  having variants such as
headers, libraries, manpage ?  Or multiple versions ?  Can we change
the sources/build procedure and the dependencies based on the "output"
?

On Sun, Nov 6, 2011 at 08:26, Shea Levy <shea at shealevy.com> wrote:
> 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.



-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list