mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
libstore/build: add a few explanatory comments; simplify
This commit is contained in:
parent
a539093919
commit
fd170774c6
1 changed files with 6 additions and 5 deletions
|
@ -1177,6 +1177,7 @@ bool DerivationGoal::isReadDesc(int fd)
|
||||||
|
|
||||||
void DerivationGoal::handleChildOutput(int fd, const string & data)
|
void DerivationGoal::handleChildOutput(int fd, const string & data)
|
||||||
{
|
{
|
||||||
|
// local & `ssh://`-builds are dealt with here.
|
||||||
auto isWrittenToLog = isReadDesc(fd);
|
auto isWrittenToLog = isReadDesc(fd);
|
||||||
if (isWrittenToLog)
|
if (isWrittenToLog)
|
||||||
{
|
{
|
||||||
|
@ -1210,11 +1211,11 @@ void DerivationGoal::handleChildOutput(int fd, const string & 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`.
|
||||||
auto f = (*json)["fields"];
|
if (s && !isWrittenToLog && logSink && (*json)["type"] == resBuildLogLine) {
|
||||||
(*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n");
|
auto f = (*json)["fields"];
|
||||||
}
|
(*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentHookLine.clear();
|
currentHookLine.clear();
|
||||||
|
|
Loading…
Reference in a new issue