forked from lix-project/nix-eval-jobs
Merge pull request #207 from RaitoBezarius/input-drvs
feat: add inputDrvs to the JSON
This commit is contained in:
commit
73ee1712fa
|
@ -180,6 +180,7 @@ struct Drv {
|
||||||
std::string drvPath;
|
std::string drvPath;
|
||||||
bool isCached;
|
bool isCached;
|
||||||
std::map<std::string, std::string> outputs;
|
std::map<std::string, std::string> outputs;
|
||||||
|
std::map<std::string, std::set<std::string>> inputDrvs;
|
||||||
std::optional<nlohmann::json> meta;
|
std::optional<nlohmann::json> meta;
|
||||||
|
|
||||||
Drv(EvalState &state, DrvInfo &drvInfo) {
|
Drv(EvalState &state, DrvInfo &drvInfo) {
|
||||||
|
@ -224,6 +225,11 @@ struct Drv {
|
||||||
name = drvInfo.queryName();
|
name = drvInfo.queryName();
|
||||||
system = drvInfo.querySystem();
|
system = drvInfo.querySystem();
|
||||||
drvPath = localStore->printStorePath(drvInfo.requireDrvPath());
|
drvPath = localStore->printStorePath(drvInfo.requireDrvPath());
|
||||||
|
|
||||||
|
auto drv = localStore->readDerivation(drvInfo.requireDrvPath());
|
||||||
|
for (auto &input : drv.inputDrvs) {
|
||||||
|
inputDrvs[localStore->printStorePath(input.first)] = input.second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -231,7 +237,8 @@ static void to_json(nlohmann::json &json, const Drv &drv) {
|
||||||
json = nlohmann::json{{"name", drv.name},
|
json = nlohmann::json{{"name", drv.name},
|
||||||
{"system", drv.system},
|
{"system", drv.system},
|
||||||
{"drvPath", drv.drvPath},
|
{"drvPath", drv.drvPath},
|
||||||
{"outputs", drv.outputs}};
|
{"outputs", drv.outputs},
|
||||||
|
{"inputDrvs", drv.inputDrvs}};
|
||||||
|
|
||||||
if (drv.meta.has_value()) {
|
if (drv.meta.has_value()) {
|
||||||
json["meta"] = drv.meta.value();
|
json["meta"] = drv.meta.value();
|
||||||
|
|
Loading…
Reference in a new issue