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

printValueAsJSON(): Don't devirtualize

This is already done by consumers of builtins.toJSON (like
builtins.toFile or builtins.derivation), so we can delay this until
it's actually needed.
This commit is contained in:
Eelco Dolstra 2025-05-08 15:33:14 +02:00
parent 2bbf755bee
commit 6023688c6c
3 changed files with 10 additions and 7 deletions

View file

@ -32,11 +32,7 @@ json printValueAsJSON(EvalState & state, bool strict,
case nString:
copyContext(v, context);
// FIXME: only use the context from `v`.
// FIXME: make devirtualization configurable?
// FIXME: don't devirtualize here? It's redundant if
// 'toFile' or 'derivation' also do it.
out = state.devirtualize(v.c_str(), context);
out = v.c_str();
break;
case nPath: