mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Another change to low-level derivations. The last one this year, I
promise :-) This allows derivations to specify on *what* output paths of input derivations they are dependent. This helps to prevent unnecessary downloads. For instance, a build might be dependent on the `devel' and `lib' outputs of some library component, but not the `docs' output.
This commit is contained in:
parent
6ff48e77f6
commit
05f0430de1
7 changed files with 70 additions and 32 deletions
|
@ -68,17 +68,17 @@ static Hash hashDerivationModulo(EvalState & state, Derivation drv)
|
|||
|
||||
/* For other derivations, replace the inputs paths with recursive
|
||||
calls to this function.*/
|
||||
PathSet inputs2;
|
||||
for (PathSet::iterator i = drv.inputDrvs.begin();
|
||||
DerivationInputs inputs2;
|
||||
for (DerivationInputs::iterator i = drv.inputDrvs.begin();
|
||||
i != drv.inputDrvs.end(); ++i)
|
||||
{
|
||||
Hash h = state.drvHashes[*i];
|
||||
Hash h = state.drvHashes[i->first];
|
||||
if (h.type == htUnknown) {
|
||||
Derivation drv2 = derivationFromPath(*i);
|
||||
Derivation drv2 = derivationFromPath(i->first);
|
||||
h = hashDerivationModulo(state, drv2);
|
||||
state.drvHashes[*i] = h;
|
||||
state.drvHashes[i->first] = h;
|
||||
}
|
||||
inputs2.insert(printHash(h));
|
||||
inputs2[printHash(h)] = i->second;
|
||||
}
|
||||
drv.inputDrvs = inputs2;
|
||||
|
||||
|
@ -119,7 +119,9 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
|
|||
/* !!! supports only single output path */
|
||||
Path outPath = evalPath(state, a);
|
||||
|
||||
drv.inputDrvs.insert(drvPath);
|
||||
StringSet ids;
|
||||
ids.insert("out");
|
||||
drv.inputDrvs[drvPath] = ids;
|
||||
ss.push_back(outPath);
|
||||
} else
|
||||
throw Error("invalid derivation attribute");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue