JSON: print paths as strings without copying them to the store

Makes `printValueAsJSON` not copy paths to the store for `nix eval
--json`, `nix-instantiate --eval --json` and `nix-env --json`.

Fixes https://github.com/NixOS/nix/issues/5612
This commit is contained in:
Naïm Favier
2022-08-22 15:01:35 +02:00
parent af4e8b00fb
commit 062e4fcdde
6 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ struct CmdEval : MixJSON, InstallableCommand
else if (json) {
JSONPlaceholder jsonOut(std::cout);
printValueAsJSON(*state, true, *v, pos, jsonOut, context);
printValueAsJSON(*state, true, *v, pos, jsonOut, context, false);
}
else {