forked from lix-project/lix
Merge pull request #4443 from rickynils/prefer-local-build-respect-zero-max-jobs
Don't let 'preferLocalBuild' override 'max-jobs=0'
This commit is contained in:
commit
fbfa70dc02
|
@ -679,13 +679,9 @@ void DerivationGoal::tryToBuild()
|
||||||
}
|
}
|
||||||
|
|
||||||
void DerivationGoal::tryLocalBuild() {
|
void DerivationGoal::tryLocalBuild() {
|
||||||
bool buildLocally = buildMode != bmNormal || parsedDrv->willBuildLocally(worker.store);
|
/* Make sure that we are allowed to start a build. */
|
||||||
|
|
||||||
/* Make sure that we are allowed to start a build. If this
|
|
||||||
derivation prefers to be done locally, do it even if
|
|
||||||
maxBuildJobs is 0. */
|
|
||||||
unsigned int curBuilds = worker.getNrLocalBuilds();
|
unsigned int curBuilds = worker.getNrLocalBuilds();
|
||||||
if (curBuilds >= settings.maxBuildJobs && !(buildLocally && curBuilds == 0)) {
|
if (curBuilds >= settings.maxBuildJobs) {
|
||||||
worker.waitForBuildSlot(shared_from_this());
|
worker.waitForBuildSlot(shared_from_this());
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -101,6 +101,10 @@ bool ParsedDerivation::canBuildLocally(Store & localStore) const
|
||||||
&& !drv.isBuiltin())
|
&& !drv.isBuiltin())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (settings.maxBuildJobs.get() == 0
|
||||||
|
&& !drv.isBuiltin())
|
||||||
|
return false;
|
||||||
|
|
||||||
for (auto & feature : getRequiredSystemFeatures())
|
for (auto & feature : getRequiredSystemFeatures())
|
||||||
if (!localStore.systemFeatures.get().count(feature)) return false;
|
if (!localStore.systemFeatures.get().count(feature)) return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue