Fix build with Nix 2.29

This commit is contained in:
John Ericson
2025-05-15 00:24:25 -04:00
parent dafa252d08
commit 278a3ebfd5
4 changed files with 12 additions and 6 deletions

View File

@@ -492,8 +492,14 @@ Step::ptr State::createStep(ref<Store> destStore,
runnable while step->created == false. */
step->drv = std::make_unique<Derivation>(localStore->readDerivation(drvPath));
{
auto parsedDrv = ParsedDerivation{drvPath, *step->drv};
step->drvOptions = std::make_unique<DerivationOptions>(DerivationOptions::fromParsedDerivation(parsedDrv));
auto parsedOpt = StructuredAttrs::tryParse(step->drv->env);
try {
step->drvOptions = std::make_unique<DerivationOptions>(
DerivationOptions::fromStructuredAttrs(step->drv->env, parsedOpt ? &*parsedOpt : nullptr));
} catch (Error & e) {
e.addTrace({}, "while parsing derivation '%s'", localStore->printStorePath(drvPath));
throw;
}
}
step->preferLocalBuild = step->drvOptions->willBuildLocally(*localStore, *step->drv);