From 39087321811e81e26a1a47d6967df1088dcf0e95 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 20:47:23 +0100 Subject: style(3p/nix): Final act in the brace-wrapping saga This last change set was generated by a full clang-tidy run (including compilation): clang-tidy -p ~/projects/nix-build/ \ -checks=-*,readability-braces-around-statements -fix src/*/*.cc Actually running clang-tidy requires some massaging to make it play nice with Nix + meson, I'll be adding a wrapper or something for that soon. --- third_party/nix/src/build-remote/build-remote.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'third_party/nix/src/build-remote') diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc index dd7aea967923..ef139c6bdc11 100644 --- a/third_party/nix/src/build-remote/build-remote.cc +++ b/third_party/nix/src/build-remote/build-remote.cc @@ -39,10 +39,11 @@ static AutoCloseFD openSlotLock(const Machine& m, unsigned long long slot) { } static bool allSupportedLocally(const std::set& requiredFeatures) { - for (auto& feature : requiredFeatures) + for (auto& feature : requiredFeatures) { if (!settings.systemFeatures.get().count(feature)) { return false; } + } return true; } @@ -172,10 +173,11 @@ static int _main(int argc, char** argv) { } if (!bestSlotLock) { - if (rightType && !canBuildLocally) + if (rightType && !canBuildLocally) { std::cerr << "# postpone\n"; - else + } else { std::cerr << "# decline\n"; + } break; } @@ -194,8 +196,9 @@ static int _main(int argc, char** argv) { if (hasPrefix(bestMachine->storeUri, "ssh://")) { storeParams["max-connections"] = "1"; storeParams["log-fd"] = "4"; - if (bestMachine->sshKey != "") + if (bestMachine->sshKey != "") { storeParams["ssh-key"] = bestMachine->sshKey; + } } sshStore = openStore(bestMachine->storeUri, storeParams); @@ -254,15 +257,17 @@ static int _main(int argc, char** argv) { auto result = sshStore->buildDerivation(drvPath, drv); - if (!result.success()) + if (!result.success()) { throw Error("build of '%s' on '%s' failed: %s", drvPath, storeUri, result.errorMsg); + } PathSet missing; - for (auto& path : outputs) + for (auto& path : outputs) { if (!store->isValidPath(path)) { missing.insert(path); } + } if (!missing.empty()) { DLOG(INFO) << "copying outputs from '" << storeUri << "'"; -- cgit 1.4.1