1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

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-16 12:23:37 +02:00
parent af4e8b00fb
commit 062e4fcdde
No known key found for this signature in database
GPG key ID: 95AFCE8211908325
6 changed files with 18 additions and 15 deletions

View file

@ -53,7 +53,7 @@ void processExpr(EvalState & state, const Strings & attrPaths,
if (output == okXML)
printValueAsXML(state, strict, location, vRes, std::cout, context, noPos);
else if (output == okJSON)
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context);
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context, false);
else {
if (strict) state.forceValueDeep(vRes);
vRes.print(state.symbols, std::cout);