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:
parent
2ff3035cf4
commit
e9848beca7
5 changed files with 40 additions and 32 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue