1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 12:37:59 +02:00

Restore activity metadata

This allows the progress bar to display "building perl-5.22.3" instead
of "building /nix/store/<hash>-perl-5.22.3.drv".
This commit is contained in:
Eelco Dolstra 2017-08-25 14:53:50 +02:00
parent 1f56235438
commit 0e9ddcc306
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 43 additions and 27 deletions

View file

@ -1390,7 +1390,8 @@ void DerivationGoal::tryToBuild()
bool buildLocally = buildMode != bmNormal || drv->willBuildLocally();
auto started = [&]() {
act = std::make_unique<Activity>(*logger, actBuild, fmt("building '%s'", drvPath));
act = std::make_unique<Activity>(*logger, actBuild,
fmt("building '%s'", drvPath), Logger::Fields{drvPath});
mcRunningBuilds = std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds);
worker.updateProgress();
};
@ -2405,13 +2406,15 @@ struct BuilderLogger : Logger
prevLogger.log(lvl, fs);
}
void startActivity(ActivityId act, ActivityType type, const std::string & s) override
void startActivity(ActivityId act, ActivityType type,
const std::string & s, const Fields & fields) override
{
nlohmann::json json;
json["action"] = "start";
json["id"] = act;
json["type"] = type;
json["text"] = s;
// FIXME: handle fields
log(lvlError, "@nix " + json.dump());
}