From af2e53fd481994cca46b9c003a6a8eae50cf951c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 6 Nov 2011 06:28:20 +0000 Subject: Include all outputs of derivations in the closure of explicitly-passed derivation paths This required adding a queryOutputDerivationNames function in the store API --- src/libexpr/primops.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 2a3f1e2c3221..ce0b9e8b0bd2 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -347,6 +347,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v) derivation. */ foreach (PathSet::iterator, i, context) { Path path = *i; + bool explicitlyPassed = false; /* Paths marked with `=' denote that the path of a derivation is explicitly passed to the builder. Since that allows the @@ -361,8 +362,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v) foreach (PathSet::iterator, j, refs) { drv.inputSrcs.insert(*j); if (isDerivation(*j)) - drv.inputDrvs[*j] = singleton("out"); + drv.inputDrvs[*j] = store -> queryDerivationOutputNames(*j); } + + explicitlyPassed = true; } /* See prim_unsafeDiscardOutputDependency. */ @@ -376,7 +379,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v) debug(format("derivation uses `%1%'") % path); if (!useDrvAsSrc && isDerivation(path)) - drv.inputDrvs[path] = singleton("out"); + if (explicitlyPassed) + drv.inputDrvs[path] = store -> queryDerivationOutputNames(path); + else + drv.inputDrvs[path] = singleton("out"); else drv.inputSrcs.insert(path); } -- cgit 1.4.1