hydra-eval-jobs: GC root aggregate jobs

This commit is contained in:
Graham Christensen 2022-02-20 12:15:10 -05:00
parent e0921eba0a
commit 290e0653ad

View file

@ -504,6 +504,16 @@ int main(int argc, char * * argv)
job.erase("namedConstituents");
/* Register the derivation as a GC root. !!! This
registers roots for jobs that we may have already
done. */
auto localStore = store.dynamic_pointer_cast<LocalFSStore>();
if (gcRootsDir != "" && localStore) {
Path root = gcRootsDir + "/" + std::string(baseNameOf((std::string) job["drvPath"]));
if (!pathExists(root))
localStore->addPermRoot(localStore->parseStorePath((std::string) job["drvPath"]), root);
}
if (!brokenJobs.empty()) {
std::stringstream ss;
for (const auto& [jobName, error] : brokenJobs) {