aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-20 17:32:19 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-20 17:38:57 -0500
commit208c8d326def2cbadb02143211333ca8558f99f1 (patch)
treeb814630144d0b7ffc35d963a7b21e0c24139fe37 /src
parentc7bd3a874f0a52fd33f8f930dd6450f5789a8c4b (diff)
`Derivation::toJSON`: fix bug!
When I moved this code from the binary to libnixstore #7863, I forgot to display the environment variables!
Diffstat (limited to 'src')
-rw-r--r--src/libstore/derivations.cc1
-rw-r--r--src/libstore/tests/derivation.cc9
2 files changed, 10 insertions, 0 deletions
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;
}))