about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index d76c8d1727fc..7fb5271f4a89 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -10,6 +10,7 @@
 #include "builtins.hh"
 #include "finally.hh"
 #include "compression.hh"
+#include "json.hh"
 
 #include <algorithm>
 #include <iostream>
@@ -2273,9 +2274,18 @@ void DerivationGoal::doExportReferencesGraph()
             }
         }
 
-        /* Write closure info to `fileName'. */
+        /* Write closure info to <fileName>. */
         writeFile(tmpDir + "/" + fileName,
             worker.store.makeValidityRegistration(paths, false, false));
+
+        /* Write a more comprehensive JSON serialisation to
+           <fileName>.json. */
+        std::ostringstream str;
+        {
+            JSONPlaceholder jsonRoot(str, true);
+            worker.store.pathInfoToJSON(jsonRoot, paths, false, true);
+        }
+        writeFile(tmpDir + "/" + fileName + ".json", str.str());
     }
 }