From dd77f7d5931e500585b6539b52ef5a5f3b549a4e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Nov 2016 17:45:04 +0100 Subject: 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. --- src/libstore/misc.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/libstore/misc.cc') diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 0c2c49e5531f..9a88cdc317b6 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -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_) -- cgit 1.4.1