libexpr/primops: Migrate derivationStrictInternal to return a Value

Part of #1136

Change-Id: If00bc51c7ebd5ccd99a883788bc1ec506a6a6964
This commit is contained in:
skye
2026-04-07 23:35:12 -04:00
parent fe38b58e50
commit 50aeb770e5
+4 -5
View File
@@ -834,7 +834,7 @@ static void prim_second(EvalState & state, Value * * args, Value & v)
* Derivations
*************************************************************/
static void derivationStrictInternal(EvalState & state, const std::string & name, Bindings * attrs, Value & v);
static Value derivationStrictInternal(EvalState & state, const std::string & name, Bindings * attrs);
/* Construct (as a unobservable side effect) a Nix derivation
expression that performs the derivation described by the argument
@@ -872,7 +872,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
}
try {
derivationStrictInternal(state, drvName, attrs, v);
v = derivationStrictInternal(state, drvName, attrs);
} catch (Error & e) {
Pos pos = state.ctx.positions[nameAttr->pos];
/*
@@ -902,8 +902,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
}
}
static void derivationStrictInternal(EvalState & state, const std::string &
drvName, Bindings * attrs, Value & v)
static Value derivationStrictInternal(EvalState & state, const std::string & drvName, Bindings * attrs)
{
/* Check whether attributes should be passed as a JSON file. */
std::optional<JSON> jsonObject;
@@ -1288,7 +1287,7 @@ drvName, Bindings * attrs, Value & v)
for (auto & i : drv.outputs)
mkOutputString(state, result, drvPath, i);
v = {NewValueAs::attrs, result};
return {NewValueAs::attrs, result};
}
/* Return a placeholder string for the specified output that will be