1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02: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

@ -222,8 +222,14 @@ void Store::queryMissing(const std::vector<DerivedPath> & targets,
if (knownOutputPaths && invalid.empty()) return;
auto drv = make_ref<Derivation>(derivationFromPath(drvPath));
ParsedDerivation parsedDrv(StorePath(drvPath), *drv);
DerivationOptions drvOptions = DerivationOptions::fromParsedDerivation(parsedDrv);
ParsedDerivation parsedDrv(*drv);
DerivationOptions drvOptions;
try {
drvOptions = DerivationOptions::fromParsedDerivation(parsedDrv);
} catch (Error & e) {
e.addTrace({}, "while parsing derivation '%s'", printStorePath(drvPath));
throw;
}
if (!knownOutputPaths && settings.useSubstitutes && drvOptions.substitutesAllowed()) {
experimentalFeatureSettings.require(Xp::CaDerivations);