aboutsummaryrefslogtreecommitdiff
path: root/src/build-remote
diff options
context:
space:
mode:
authorRebecca Turner <rbt@sent.as>2024-03-26 15:39:54 -0700
committerRebecca Turner <rbt@sent.as>2024-03-26 15:40:05 -0700
commit8e63eca912a01659cef81b9d6d1cc7cb11edfff5 (patch)
treede159e9a3c17068d55ab06920d3c587d4e2094c7 /src/build-remote
parentda22dbc33397c9c6c5d115ce753d5cf11585291e (diff)
Remove `HintFmt::operator%`
Change-Id: Ibcf1a7848b4b18ec9b0807628ff229079ae7a0fe
Diffstat (limited to 'src/build-remote')
-rw-r--r--src/build-remote/build-remote.cc47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index e2ada70cd..f7a159829 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -185,16 +185,6 @@ static int main_build_remote(int argc, char * * argv)
std::cerr << "# postpone\n";
else
{
- // build the hint template.
- std::string errorText =
- "Failed to find a machine for remote build!\n"
- "derivation: %s\nrequired (system, features): (%s, [%s])";
- errorText += "\n%s available machines:";
- errorText += "\n(systems, maxjobs, supportedFeatures, mandatoryFeatures)";
-
- for (unsigned int i = 0; i < machines.size(); ++i)
- errorText += "\n([%s], %s, [%s], [%s])";
-
// add the template values.
std::string drvstr;
if (drvPath.has_value())
@@ -202,19 +192,30 @@ static int main_build_remote(int argc, char * * argv)
else
drvstr = "<unknown>";
- auto error = HintFmt::fromFormatString(errorText);
- error
- % drvstr
- % neededSystem
- % concatStringsSep<StringSet>(", ", requiredFeatures)
- % machines.size();
-
- for (auto & m : machines)
- error
- % concatStringsSep<StringSet>(", ", m.systemTypes)
- % m.maxJobs
- % concatStringsSep<StringSet>(", ", m.supportedFeatures)
- % concatStringsSep<StringSet>(", ", m.mandatoryFeatures);
+ std::string machinesFormatted;
+
+ for (auto & m : machines) {
+ machinesFormatted += HintFmt(
+ "\n([%s], %s, [%s], [%s])",
+ concatStringsSep<StringSet>(", ", m.systemTypes),
+ m.maxJobs,
+ concatStringsSep<StringSet>(", ", m.supportedFeatures),
+ concatStringsSep<StringSet>(", ", m.mandatoryFeatures)
+ ).str();
+ }
+
+ auto error = HintFmt(
+ "Failed to find a machine for remote build!\n"
+ "derivation: %s\n"
+ "required (system, features): (%s, [%s])\n"
+ "%s available machines:\n"
+ "(systems, maxjobs, supportedFeatures, mandatoryFeatures)%s",
+ drvstr,
+ neededSystem,
+ concatStringsSep<StringSet>(", ", requiredFeatures),
+ machines.size(),
+ Uncolored(machinesFormatted)
+ );
printMsg(couldBuildLocally ? lvlChatty : lvlWarn, error.str());