Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add fancy debug logs #3586

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/build-remote/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static int _main(int argc, char * * argv)
}
}
if (!free) {
debug("skipping '%s': no slots free", m.storeUri);
continue;
}
bool best = false;
Expand All @@ -162,7 +163,15 @@ static int _main(int argc, char * * argv)
bestLoad = load;
bestSlotLock = std::move(free);
bestMachine = &m;
} else {
debug("skipping '%s': there is a better machine", m.storeUri);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does better mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I'm not sure either, but I'm guessing it's based on the parameters above a machine that has a higher speed factor and is available right now

}
} else {
debug("skipping '%s': does not meet all condiditions\n - enabled = %s\n - system: type is matching = %s / required %s / got %s\n - features: all supported = %s / mandatory supported = %s / required %s / got %s", m.storeUri,
m.enabled,
std::find(m.systemTypes.begin(), m.systemTypes.end(), neededSystem) != m.systemTypes.end(), neededSystem, join(m.systemTypes, ","),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the join() function call here should be replaced by the concatStringsSep() one

m.allSupported(requiredFeatures), m.mandatoryMet(requiredFeatures), "", ""
);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/libstore/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ void DerivationGoal::tryToBuild()
return;
case rpDecline:
/* We should do it ourselves. */
debug("skip remote build...");
break;
}
}
Expand Down Expand Up @@ -1740,7 +1741,10 @@ void DerivationGoal::buildDone()

HookReply DerivationGoal::tryBuildHook()
{
if (!worker.tryBuildHook || !useDerivation) return rpDecline;
if (!worker.tryBuildHook || !useDerivation) {
debug("ignore build hook for '%s'...", worker.store.printStorePath(drvPath));
return rpDecline;
}

if (!worker.hook)
worker.hook = std::make_unique<HookInstance>();
Expand Down