mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 23:12:44 +01:00
parent
c6b5503190
commit
846869da0e
11 changed files with 708 additions and 471 deletions
|
|
@ -177,7 +177,7 @@ void LocalDerivationGoal::killSandbox(bool getStats)
|
|||
}
|
||||
|
||||
|
||||
void LocalDerivationGoal::tryLocalBuild()
|
||||
Goal::Co LocalDerivationGoal::tryLocalBuild()
|
||||
{
|
||||
#if __APPLE__
|
||||
additionalSandboxProfile = parsedDrv->getStringAttr("__sandboxProfile").value_or("");
|
||||
|
|
@ -185,10 +185,10 @@ void LocalDerivationGoal::tryLocalBuild()
|
|||
|
||||
unsigned int curBuilds = worker.getNrLocalBuilds();
|
||||
if (curBuilds >= settings.maxBuildJobs) {
|
||||
state = &DerivationGoal::tryToBuild;
|
||||
worker.waitForBuildSlot(shared_from_this());
|
||||
outputLocks.unlock();
|
||||
return;
|
||||
co_await Suspend{};
|
||||
co_return tryToBuild();
|
||||
}
|
||||
|
||||
assert(derivationType);
|
||||
|
|
@ -242,7 +242,8 @@ void LocalDerivationGoal::tryLocalBuild()
|
|||
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
||||
fmt("waiting for a free build user ID for '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
||||
worker.waitForAWhile(shared_from_this());
|
||||
return;
|
||||
co_await Suspend{};
|
||||
co_return tryLocalBuild();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -257,15 +258,13 @@ void LocalDerivationGoal::tryLocalBuild()
|
|||
outputLocks.unlock();
|
||||
buildUser.reset();
|
||||
worker.permanentFailure = true;
|
||||
done(BuildResult::InputRejected, {}, std::move(e));
|
||||
return;
|
||||
co_return done(BuildResult::InputRejected, {}, std::move(e));
|
||||
}
|
||||
|
||||
/* This state will be reached when we get EOF on the child's
|
||||
log pipe. */
|
||||
state = &DerivationGoal::buildDone;
|
||||
|
||||
started();
|
||||
co_await Suspend{};
|
||||
// after EOF on child
|
||||
co_return buildDone();
|
||||
}
|
||||
|
||||
static void chmod_(const Path & path, mode_t mode)
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ struct LocalDerivationGoal : public DerivationGoal
|
|||
/**
|
||||
* The additional states.
|
||||
*/
|
||||
void tryLocalBuild() override;
|
||||
Goal::Co tryLocalBuild() override;
|
||||
|
||||
/**
|
||||
* Start building a derivation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue