Don't create unnecessary substitution goals for derivations

This commit is contained in:
Eelco Dolstra 2014-11-24 16:44:35 +01:00 committed by Ludovic Courtès
parent 554eaf5e8c
commit 9f355738e1
1 changed files with 5 additions and 0 deletions

View File

@ -936,6 +936,11 @@ void DerivationGoal::init()
/* The first thing to do is to make sure that the derivation
exists. If it doesn't, it may be created through a
substitute. */
if (buildMode == bmNormal && worker.store.isValidPath(drvPath)) {
haveDerivation();
return;
}
addWaitee(worker.makeSubstitutionGoal(drvPath));
state = &DerivationGoal::haveDerivation;