1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

nix-build: Copy drv closure between eval store and build store

This commit is contained in:
Eelco Dolstra 2021-07-16 09:37:33 +02:00
parent 2ff3035cf4
commit e9848beca7
5 changed files with 40 additions and 32 deletions

View file

@ -532,6 +532,7 @@ static void main_nix_build(int argc, char * * argv)
std::vector<StorePathWithOutputs> pathsToBuild;
std::vector<std::pair<StorePath, std::string>> pathsToBuildOrdered;
RealisedPath::Set drvsToCopy;
std::map<StorePath, std::pair<size_t, StringSet>> drvMap;
@ -544,15 +545,17 @@ static void main_nix_build(int argc, char * * argv)
pathsToBuild.push_back({drvPath, {outputName}});
pathsToBuildOrdered.push_back({drvPath, {outputName}});
drvsToCopy.insert(drvPath);
auto i = drvMap.find(drvPath);
if (i != drvMap.end())
i->second.second.insert(outputName);
else {
else
drvMap[drvPath] = {drvMap.size(), {outputName}};
}
}
copyClosure(state->store, state->buildStore, drvsToCopy);
buildPaths(pathsToBuild);
if (dryRun) return;