forked from lix-project/hydra
Fix root creation when the root already exists but is owned by another user
This commit is contained in:
parent
b904f25247
commit
b04dc6c76e
|
@ -264,7 +264,7 @@ State::StepResult State::doBuildStep(nix::ref<Store> destStore,
|
||||||
assert(stepNr);
|
assert(stepNr);
|
||||||
|
|
||||||
for (auto & path : step->drv.outputPaths())
|
for (auto & path : step->drv.outputPaths())
|
||||||
writeFile(rootsDir + "/" + baseNameOf(path), "");
|
addRoot(path);
|
||||||
|
|
||||||
/* Register success in the database for all Build objects that
|
/* Register success in the database for all Build objects that
|
||||||
have this step as the top-level step. Since the queue
|
have this step as the top-level step. Since the queue
|
||||||
|
@ -473,3 +473,10 @@ State::StepResult State::doBuildStep(nix::ref<Store> destStore,
|
||||||
|
|
||||||
return sDone;
|
return sDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void State::addRoot(const Path & storePath)
|
||||||
|
{
|
||||||
|
auto root = rootsDir + "/" + baseNameOf(storePath);
|
||||||
|
if (!pathExists(root)) writeFile(root, "");
|
||||||
|
}
|
||||||
|
|
|
@ -841,6 +841,8 @@ void State::run(BuildID buildOne)
|
||||||
jobsetRepeats.emplace(std::make_pair(s2[0], s2[1]), std::stoi(s2[2]));
|
jobsetRepeats.emplace(std::make_pair(s2[0], s2[1]), std::stoi(s2[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addRoot("/nix/store/rk9lahzm21qm0zjclv6mz0m4hy77wk14-vm-test-run-unnamed.drv");
|
||||||
|
|
||||||
{
|
{
|
||||||
auto conn(dbPool.get());
|
auto conn(dbPool.get());
|
||||||
clearBusy(*conn, 0);
|
clearBusy(*conn, 0);
|
||||||
|
|
|
@ -222,7 +222,7 @@ bool State::getQueuedBuilds(Connection & conn,
|
||||||
BuildOutput res = getBuildOutputCached(conn, destStore, drv);
|
BuildOutput res = getBuildOutputCached(conn, destStore, drv);
|
||||||
|
|
||||||
for (auto & path : drv.outputPaths())
|
for (auto & path : drv.outputPaths())
|
||||||
writeFile(rootsDir + "/" + baseNameOf(path), "");
|
addRoot(path);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto mc = startDbUpdate();
|
auto mc = startDbUpdate();
|
||||||
|
|
|
@ -535,6 +535,8 @@ private:
|
||||||
|
|
||||||
void dumpStatus(Connection & conn, bool log);
|
void dumpStatus(Connection & conn, bool log);
|
||||||
|
|
||||||
|
void addRoot(const nix::Path & storePath);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void showStatus();
|
void showStatus();
|
||||||
|
|
Loading…
Reference in a new issue