Skip to content

Commit

Permalink
Derivation::toJSON: fix bug!
Browse files Browse the repository at this point in the history
When I moved this code from the binary to libnixstore #7863, I forgot to
display the environment variables!
  • Loading branch information
Ericson2314 committed Feb 20, 2023
1 parent c7bd3a8 commit 208c8d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstore/derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 9 additions & 0 deletions src/libstore/tests/derivation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ TEST_JSON(Derivation, impure,
"bar",
"baz"
],
"env": {
"BIG_BAD": "WOLF"
},
"outputs": {}
})",
({
Expand All @@ -107,6 +110,12 @@ TEST_JSON(Derivation, impure,
"bar",
"baz",
};
drv.env = {
{
"BIG_BAD",
"WOLF",
},
};
drv;
}))

Expand Down

0 comments on commit 208c8d3

Please sign in to comment.