Skip non-serialisable *Value in output

Most notably this includes derivations which should be fixed and
serialised to store paths.
This commit is contained in:
adisbladis 2021-08-25 03:12:19 -05:00
parent be59cd8bfb
commit 4c28ae88a6
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -180,7 +180,15 @@ static void worker(
for (auto & name : drv->queryMetaNames()) {
PathSet context;
std::stringstream ss;
printValueAsJSON(state, true, *drv->queryMeta(name), ss, context);
auto metaValue = drv->queryMeta(name);
// Skip non-serialisable types
// TODO: Fix serialisation of derivations to store paths
if (metaValue == 0) {
continue;
}
printValueAsJSON(state, true, *metaValue, ss, context);
nlohmann::json field = nlohmann::json::parse(ss.str());
meta[name] = field;
}