hydra-queue-runner: Write GC roots for outputs paths

We lost this behaviour somewhere. So build outputs could be GC'ed when
running the collector with --option gc-keep-outputs false.
This commit is contained in:
Eelco Dolstra
2017-10-12 18:55:38 +02:00
parent eb7631fb9d
commit 45b138373b
4 changed files with 12 additions and 0 deletions

View File

@ -221,6 +221,9 @@ bool State::getQueuedBuilds(Connection & conn,
Derivation drv = readDerivation(build->drvPath);
BuildOutput res = getBuildOutputCached(conn, destStore, drv);
for (auto & path : drv.outputPaths())
writeFile(rootsDir + "/" + baseNameOf(path), "");
{
auto mc = startDbUpdate();
pqxx::work txn(conn);