1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 16:59:35 +01:00

Optimize the nix build caching

This commit is contained in:
regnat 2021-06-04 15:21:03 +02:00
parent c116e6e837
commit 753730c410

View file

@ -506,31 +506,20 @@ std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo> InstallableF
*emptyArgs, *emptyArgs,
*getFlakeOutputs(*state, *lockedFlake) *getFlakeOutputs(*state, *lockedFlake)
); );
auto drvPath = state->forceString( Value * v = state->allocValue();
*findAlongAttrPath( if (!state->getAttrField(*drvValue, {state->sDrvPath}, pos, *v))
*state, break;
"drvPath", auto drvPath = state->forceString(*v);
*emptyArgs, if (!state->getAttrField(*drvValue, {state->sOutPath}, pos, *v))
*drvValue).first break;
); auto outPath = state->forceString(*v);
auto outPath = state->forceString( if (!state->getAttrField(*drvValue, {state->sOutputName}, pos, *v))
*findAlongAttrPath( break;
*state, auto outputName = state->forceString(*v);
"outPath",
*emptyArgs,
*drvValue).first
);
auto outputName = state->forceString(
*findAlongAttrPath(
*state,
"outputName",
*emptyArgs,
*drvValue).first
);
auto drvInfo = DerivationInfo{ auto drvInfo = DerivationInfo{
state->store->parseStorePath(drvPath), state->store->parseStorePath(drvPath),
state->store->maybeParseStorePath(outPath), // FIXME: set to something when relevant? state->store->maybeParseStorePath(outPath),
outputName outputName
}; };