diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index f0f60d7df1..bbcb55a0b9 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1106,8 +1106,10 @@ void DerivationGoal::repairClosure() /* Get the output closure. */ PathSet outputClosure; - foreach (DerivationOutputs::iterator, i, drv.outputs) + foreach (DerivationOutputs::iterator, i, drv.outputs) { + if (!wantOutput(i->first, wantedOutputs)) continue; computeFSClosure(worker.store, i->second.path, outputClosure); + } /* Filter out our own outputs (which we have already checked). */ foreach (DerivationOutputs::iterator, i, drv.outputs)