Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libexpr/eval-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ std::vector<std::string> AttrCursor::getListOfStrings()
for (auto & elem : v.listItems())
res.push_back(std::string(root->state.forceStringNoCtx(*elem)));

cachedValue = {root->db->setListOfStrings(getKey(), res), res};
if (root->db)
cachedValue = {root->db->setListOfStrings(getKey(), res), res};

return res;
}
Expand Down
7 changes: 7 additions & 0 deletions tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ nix build -f multiple-outputs.nix --json 'e^*' --no-link | jq --exit-status '
(.outputs | keys == ["a", "b", "c"]))
'

# Make sure that `--impure` works (regression test for https://github.com/NixOS/nix/issues/6488)
nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a", "b"]))
'

testNormalization () {
clearStore
outPath=$(nix-build ./simple.nix --no-out-link)
Expand Down