libexpr: Migrate emitTreeAttrs to return a Value

Part of #1136 and progress towards #744

Change-Id: Iaa011161b26bda237bcf4424bf8262726a6a6964
This commit is contained in:
skye
2026-03-04 11:53:34 -05:00
parent 37ccd28c3b
commit 8b38edaf1e
3 changed files with 9 additions and 12 deletions
+1 -3
View File
@@ -943,16 +943,14 @@ LockedFlake lockFlake(
Value callFlake(EvalState & state, const LockedFlake & lockedFlake)
{
Value vLocks;
Value vRootSrc;
Value vRootSubdir;
vLocks = {NewValueAs::string, lockedFlake.lockFile.to_string()};
emitTreeAttrs(
Value vRootSrc = emitTreeAttrs(
state.ctx,
*lockedFlake.flake.sourceInfo,
lockedFlake.flake.lockedRef.input,
vRootSrc,
false,
lockedFlake.flake.forceDirty
);
+3 -4
View File
@@ -202,12 +202,11 @@ LockedFlake lockFlake(
Value callFlake(EvalState & state, const LockedFlake & lockedFlake);
}
void emitTreeAttrs(
Value emitTreeAttrs(
Evaluator & state,
const fetchers::Tree & tree,
const fetchers::Input & input,
Value & v,
bool emptyRevFallback = false,
bool forceDirty = false);
bool forceDirty = false
);
}
+5 -5
View File
@@ -14,13 +14,13 @@
namespace nix {
void emitTreeAttrs(
Value emitTreeAttrs(
Evaluator & state,
const fetchers::Tree & tree,
const fetchers::Input & input,
Value & v,
bool emptyRevFallback,
bool forceDirty)
bool forceDirty
)
{
assert(input.isLocked());
@@ -71,7 +71,7 @@ void emitTreeAttrs(
};
}
v = {NewValueAs::attrs, attrs};
return {NewValueAs::attrs, attrs};
}
std::string fixURI(std::string uri, EvalState & state, const std::string & defaultScheme = "file")
@@ -223,7 +223,7 @@ static void fetchTree(
state.ctx.paths.allowPath(tree.storePath);
emitTreeAttrs(state.ctx, tree, input2, v, params.emptyRevFallback, false);
v = emitTreeAttrs(state.ctx, tree, input2, params.emptyRevFallback, false);
}
void prim_fetchTree(EvalState & state, Value * * args, Value & v)