Skip to content

Commit

Permalink
Merge pull request #7764 from yorickvP/build-remote-warning
Browse files Browse the repository at this point in the history
build-remote: don't warn when all local build slots are taken
  • Loading branch information
thufschmitt committed Feb 22, 2023
2 parents 6589081 + 631ba64 commit 4a921ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/build-remote/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static int main_build_remote(int argc, char * * argv)
settings.set(name, value);
}

auto maxBuildJobs = settings.maxBuildJobs;
settings.maxBuildJobs.set("1"); // hack to make tests with local?root= work

initPlugins();
Expand Down Expand Up @@ -112,10 +113,14 @@ static int main_build_remote(int argc, char * * argv)
drvPath = store->parseStorePath(readString(source));
auto requiredFeatures = readStrings<std::set<std::string>>(source);

auto canBuildLocally = amWilling
/* It would be possible to build locally after some builds clear out,
so don't show the warning now: */
bool couldBuildLocally = maxBuildJobs > 0
&& ( neededSystem == settings.thisSystem
|| settings.extraPlatforms.get().count(neededSystem) > 0)
&& allSupportedLocally(*store, requiredFeatures);
/* It's possible to build this locally right now: */
bool canBuildLocally = amWilling && couldBuildLocally;

/* Error ignored here, will be caught later */
mkdir(currentLoad.c_str(), 0777);
Expand Down Expand Up @@ -214,7 +219,7 @@ static int main_build_remote(int argc, char * * argv)
% concatStringsSep<StringSet>(", ", m.supportedFeatures)
% concatStringsSep<StringSet>(", ", m.mandatoryFeatures);

printMsg(canBuildLocally ? lvlChatty : lvlWarn, error);
printMsg(couldBuildLocally ? lvlChatty : lvlWarn, error);

std::cerr << "# decline\n";
}
Expand Down

0 comments on commit 4a921ba

Please sign in to comment.