local-derivation-goal: Refactor

This works because the `builder` and `args` variables are only used
in the non-builtin code path.

Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
This commit is contained in:
Robert Hensing 2024-10-03 12:50:27 +02:00
parent b429e96583
commit 74b93c1edb

View File

@ -2143,15 +2143,12 @@ void LocalDerivationGoal::runChild()
_exit(1);
}
}
#endif
builder = drv->builder;
args.push_back(std::string(baseNameOf(drv->builder)));
#else
if (!drv->isBuiltin()) {
builder = drv->builder;
args.push_back(std::string(baseNameOf(drv->builder)));
}
#endif
for (auto & i : drv->args)
args.push_back(rewriteStrings(i, inputRewrites));