1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00

BuildResult: Serialize builtOutputs

This commit is contained in:
Eelco Dolstra 2025-03-21 15:59:05 +01:00
parent c32441f207
commit bc3a847784

View file

@ -32,7 +32,14 @@ void to_json(nlohmann::json & json, const KeyedBuildResult & buildResult)
[&](const DerivedPathOpaque & opaque) { path["opaque"] = opaque.path.to_string(); }, [&](const DerivedPathOpaque & opaque) { path["opaque"] = opaque.path.to_string(); },
[&](const DerivedPathBuilt & drv) { [&](const DerivedPathBuilt & drv) {
path["drvPath"] = drv.drvPath->getBaseStorePath().to_string(); path["drvPath"] = drv.drvPath->getBaseStorePath().to_string();
path["outputs"] = drv.outputs.to_string(); path["outputs"] = drv.outputs;
auto outputs = nlohmann::json::object();
for (auto & [name, output] : buildResult.builtOutputs)
outputs[name] = {
{"path", output.outPath.to_string()},
{"signatures", output.signatures},
};
json["builtOutputs"] = std::move(outputs);
}, },
}, },
buildResult.path.raw()); buildResult.path.raw());