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

ParsedDerivation: don't take drvPath

It is just use for adding context to errors, but we have `addTrace` to
do that. Let the callers do that instead.

The callers doing so is a bit duplicated, yes, but this will get better
once `DerivationOptions` is included in `Derivation`.
This commit is contained in:
John Ericson 2025-02-03 10:28:39 -05:00
parent 71567373b6
commit 0123640009
6 changed files with 35 additions and 19 deletions

View file

@ -180,8 +180,13 @@ Goal::Co DerivationGoal::haveDerivation()
{
trace("have derivation");
parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *drv);
drvOptions = std::make_unique<DerivationOptions>(DerivationOptions::fromParsedDerivation(*parsedDrv));
parsedDrv = std::make_unique<ParsedDerivation>(*drv);
try {
drvOptions = std::make_unique<DerivationOptions>(DerivationOptions::fromParsedDerivation(*parsedDrv));
} catch (Error & e) {
e.addTrace({}, "while parsing derivation '%s'", worker.store.printStorePath(drvPath));
throw;
}
if (!drv->type().hasKnownOutputPaths())
experimentalFeatureSettings.require(Xp::CaDerivations);