1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Aso track the output path of the realisation dependencies

This commit is contained in:
regnat 2021-05-26 16:09:02 +02:00
parent cb46d70794
commit 1f3ff0d193
7 changed files with 46 additions and 39 deletions

View file

@ -254,25 +254,22 @@ StorePaths Store::topoSortPaths(const StorePathSet & paths)
}});
}
std::set<DrvOutput> drvOutputReferences(
std::map<DrvOutput, StorePath> drvOutputReferences(
const std::set<Realisation> inputRealisations,
const StorePathSet pathReferences)
{
std::set<DrvOutput> res;
std::map<DrvOutput, StorePath> res;
std::map<StorePath, std::set<DrvOutput>> inputsByOutputPath;
for (const auto & input : inputRealisations)
inputsByOutputPath[input.outPath].insert(input.id);
for (const auto & path : pathReferences) {
auto theseInputs = inputsByOutputPath[path];
res.insert(theseInputs.begin(), theseInputs.end());
for (const auto & input : inputRealisations) {
if (pathReferences.count(input.outPath)) {
res.insert({input.id, input.outPath});
}
}
return res;
}
std::set<DrvOutput> drvOutputReferences(
std::map<DrvOutput, StorePath> drvOutputReferences(
Store & store,
const Derivation & drv,
const StorePath & outputPath)