1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

DerivationBuildingGoal::tryToBuild inline

The resulting `goto` is not so nice, but it is still worth doing this so
we can turn more fields into local variables.
This commit is contained in:
John Ericson 2025-08-29 15:12:51 -04:00
parent d596b9754e
commit abc4f86e4e
2 changed files with 3 additions and 6 deletions

View file

@ -201,11 +201,9 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution(bool storeDerivation)
slot to become available, since we don't need one if there is a
build hook. */
co_await yield();
co_return tryToBuild();
}
Goal::Co DerivationBuildingGoal::tryToBuild()
{
tryToBuild:
std::map<std::string, InitialOutput> initialOutputs;
/* Recheck at this point. In particular, whereas before we were
@ -527,7 +525,7 @@ Goal::Co DerivationBuildingGoal::tryToBuild()
if (curBuilds >= settings.maxBuildJobs) {
outputLocks.unlock();
co_await waitForBuildSlot();
co_return tryToBuild();
goto tryToBuild;
}
if (!builder) {

View file

@ -110,7 +110,6 @@ private:
* The states.
*/
Co gaveUpOnSubstitution(bool storeDerivation);
Co tryToBuild();
/**
* Is the build hook willing to perform the build?