From 4c28ae88a6545c3a5c92a44557a7b67d74753181 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 25 Aug 2021 03:12:19 -0500 Subject: [PATCH] Skip non-serialisable *Value in output Most notably this includes derivations which should be fixed and serialised to store paths. --- src/nix-eval-jobs.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index a13e99f..8e35234 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -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; }