From 208c8d326def2cbadb02143211333ca8558f99f1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 20 Feb 2023 17:32:19 -0500 Subject: [PATCH] `Derivation::toJSON`: fix bug! When I moved this code from the binary to libnixstore #7863, I forgot to display the environment variables! --- src/libstore/derivations.cc | 1 + src/libstore/tests/derivation.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index e05644ab2..05dc9a3cc 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -945,6 +945,7 @@ nlohmann::json Derivation::toJSON(const Store & store) const res["system"] = platform; res["builder"] = builder; res["args"] = args; + res["env"] = env; return res; } diff --git a/src/libstore/tests/derivation.cc b/src/libstore/tests/derivation.cc index c9d404188..12be8504d 100644 --- a/src/libstore/tests/derivation.cc +++ b/src/libstore/tests/derivation.cc @@ -85,6 +85,9 @@ TEST_JSON(Derivation, impure, "bar", "baz" ], + "env": { + "BIG_BAD": "WOLF" + }, "outputs": {} })", ({ @@ -107,6 +110,12 @@ TEST_JSON(Derivation, impure, "bar", "baz", }; + drv.env = { + { + "BIG_BAD", + "WOLF", + }, + }; drv; }))