forked from lix-project/lix
libstore/build: add a few explanatory comments; simplify
This commit is contained in:
parent
287642f132
commit
102cb39086
|
@ -1177,6 +1177,7 @@ bool DerivationGoal::isReadDesc(int fd)
|
||||||
|
|
||||||
void DerivationGoal::handleChildOutput(int fd, std::string_view data)
|
void DerivationGoal::handleChildOutput(int fd, std::string_view data)
|
||||||
{
|
{
|
||||||
|
// local & `ssh://`-builds are dealt with here.
|
||||||
auto isWrittenToLog = isReadDesc(fd);
|
auto isWrittenToLog = isReadDesc(fd);
|
||||||
if (isWrittenToLog)
|
if (isWrittenToLog)
|
||||||
{
|
{
|
||||||
|
@ -1210,13 +1211,13 @@ void DerivationGoal::handleChildOutput(int fd, std::string_view data)
|
||||||
auto json = parseJSONMessage(currentHookLine);
|
auto json = parseJSONMessage(currentHookLine);
|
||||||
if (json) {
|
if (json) {
|
||||||
auto s = handleJSONLogMessage(*json, worker.act, hook->activities, true);
|
auto s = handleJSONLogMessage(*json, worker.act, hook->activities, true);
|
||||||
if (s && !isWrittenToLog && logSink) {
|
// ensure that logs from a builder using `ssh-ng://` as protocol
|
||||||
if ((*json)["type"] == resBuildLogLine) {
|
// are also available to `nix log`.
|
||||||
|
if (s && !isWrittenToLog && logSink && (*json)["type"] == resBuildLogLine) {
|
||||||
auto f = (*json)["fields"];
|
auto f = (*json)["fields"];
|
||||||
(*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n");
|
(*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
currentHookLine.clear();
|
currentHookLine.clear();
|
||||||
} else
|
} else
|
||||||
currentHookLine += c;
|
currentHookLine += c;
|
||||||
|
|
Loading…
Reference in a new issue