1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Include all outputs of derivations in the closure of explicitly-passed derivation paths

This required adding a queryOutputDerivationNames function in the store API
This commit is contained in:
Shea Levy 2011-11-06 06:28:20 +00:00
parent 981edeab7b
commit af2e53fd48
8 changed files with 58 additions and 2 deletions

View file

@ -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<StringSet>("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<StringSet>("out");
if (explicitlyPassed)
drv.inputDrvs[path] = store -> queryDerivationOutputNames(path);
else
drv.inputDrvs[path] = singleton<StringSet>("out");
else
drv.inputSrcs.insert(path);
}