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:
parent
1f56235438
commit
0e9ddcc306
4 changed files with 43 additions and 27 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue