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

Store::computeFSClosure(): Support a set of paths

This way, callers can exploits the parallelism of computeFSClosure()
when they have multiple paths that they need the (combined) closure of.
This commit is contained in:
Eelco Dolstra 2016-11-10 17:45:04 +01:00
parent 2af5d35fdc
commit dd77f7d593
5 changed files with 25 additions and 16 deletions

View file

@ -8,7 +8,7 @@
namespace nix {
void Store::computeFSClosure(const Path & startPath,
void Store::computeFSClosure(const PathSet & startPaths,
PathSet & paths_, bool flipDirection, bool includeOutputs, bool includeDerivers)
{
struct State
@ -85,7 +85,8 @@ void Store::computeFSClosure(const Path & startPath,
});
};
enqueue(startPath);
for (auto & startPath : startPaths)
enqueue(startPath);
{
auto state(state_.lock());
@ -95,6 +96,13 @@ void Store::computeFSClosure(const Path & startPath,
}
void Store::computeFSClosure(const Path & startPath,
PathSet & paths_, bool flipDirection, bool includeOutputs, bool includeDerivers)
{
computeFSClosure(PathSet{startPath}, paths_, flipDirection, includeOutputs, includeDerivers);
}
void Store::queryMissing(const PathSet & targets,
PathSet & willBuild_, PathSet & willSubstitute_, PathSet & unknown_,
unsigned long long & downloadSize_, unsigned long long & narSize_)