diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-19T19·47+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-19T19·51+0100 |
commit | 39087321811e81e26a1a47d6967df1088dcf0e95 (patch) | |
tree | 57110be423eeb7869e9960466f4b17c0ea7cd961 /third_party/nix/src/build-remote | |
parent | cf40d08908ede4061eb15513b770c98877844b8b (diff) |
style(3p/nix): Final act in the brace-wrapping saga r/777
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.
Diffstat (limited to 'third_party/nix/src/build-remote')
-rw-r--r-- | third_party/nix/src/build-remote/build-remote.cc | 17 |
1 files changed, 11 insertions, 6 deletions
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<std::string>& 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 << "'"; |