nix-grpc-store-clang-tidy-0.2.2
checks.aarch64-darwin.clang-tidy
· build #770
· raw
1tribuchet: building on mac02
unpackPhase
2unpacking source archive /nix/store/cg0kqvfmmilqxhzjggy8hqwkfmib4xpd-source3source root is sourceconfigurePhase
4mesonConfigurePhase flags: --prefix=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain -Db_pch=false5The Meson build system6Version: 1.12.17Source dir: /private/var/tb/4/scratch/4342aa3e17441242/build/source8Build dir: /private/var/tb/4/scratch/4342aa3e17441242/build/source/build9Build type: native build10WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead11Project name: nix-grpc-store12Project version: 0.2.213C++ compiler for the host machine: clang++ (clang 22.1.8 "clang version 22.1.8")14C++ linker for the host machine: clang++ ld64 956.615Host machine cpu family: aarch6416Host machine cpu: aarch6417Found pkg-config: YES (/nix/store/8rqbivyzdx8xkj8k47b07f4089bz32pb-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.218Run-time dependency grpc++ found: YES 1.84.019Run-time dependency protobuf found: YES 36.2.020Run-time dependency libzstd found: YES 1.5.721Run-time dependency threads found: YES22Run-time dependency libcrypto found: YES 3.5.923Run-time dependency prometheus-cpp-core found: YES 1.3.024Run-time dependency prometheus-cpp-pull found: YES 1.3.025Run-time dependency absl_flat_hash_map found: YES 2026081726Run-time dependency absl_hash found: YES 2026081727Run-time dependency absl_synchronization found: YES 2026081728Compiler for C++ supports arguments -Werror=thread-safety: YES 29Run-time dependency nix-store found: YES 2.36.0pre20261025_d99b751630Run-time dependency nix-util found: YES 2.36.0pre20261025_d99b751631Run-time dependency jemalloc found: YES 5.4.0_032Run-time dependency libcurl found: YES 8.22.033Run-time dependency nlohmann_json found: YES 3.12.034Check usable header "jwt-cpp/traits/nlohmann-json/defaults.h" : YES 35Checking if "Store::addTempRoots" with dependencies nix-store, nix-util compiles: YES 36Program protoc found: YES (/nix/store/jxrris8n0dw7am1kzs3ygfqyd9l6s4l3-protobuf-36.2/bin/protoc)37Program grpc_cpp_plugin found: YES (/nix/store/hm4j3zqs3jvbg3gjgw33lc322yjb07f4-grpc-1.84.0/bin/grpc_cpp_plugin)38Run-time dependency dl found: YES39Program tests/farm-client-test.sh found: YES (/private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/farm-client-test.sh)40Program tests/oidc-test.sh found: YES (/private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/oidc-test.sh)41Program tests/reverse-gateway-test.sh found: YES (/private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/reverse-gateway-test.sh)42Build targets in project: 3643WARNING: Project specifies no minimum version but uses features which were added in versions:44 * 1.1: {'meson.options file'}4546nix-grpc-store 0.2.24748 User defined options49 auto_features: enabled50 b_pch : false51 bindir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/bin52 buildtype : plain53 includedir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/include54 infodir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/info55 libdir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/lib56 libexecdir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/libexec57 localedir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/locale58 mandir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/share/man59 prefix : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.260 sbindir : /nix/store/kqviar2hwd6plv2w42g71mfx8xnl65x5-nix-grpc-store-clang-tidy-0.2.2/sbin61 wrap_mode : nodownload6263Found ninja-1.13.2 at /nix/store/ndfr0d2nizw172ppn99n505ikpsq9727-ninja-1.13.2/bin/ninja64mesonConfigurePhase: enabled\ parallel\ buildingbuildPhase
65[1/2] Generating eds_proto with a custom command66[2/2] Generating nix_remote_proto with a custom command67[0/1] /nix/store/sn59lgid7r01w49nyz81hcp1rjmpby3m-meson-1.12.1/bin/meson --internal clangtidy /private/var/tb/4/scratch/4342aa3e17441242/build/source /private/var/tb/4/scratch/4342aa3e17441242/build/source/build --color always68>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/reverse-worker-test.cc69../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]70 553 | namespaceClaim && namespaceClaim->is_string()) {71 | ^72 | ( != nullptr)73../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]74 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {75 | ^76 | ( != nullptr)77../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]78 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {79 | ^80../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]81 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {82 | ^83../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]84 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {85 | ^86../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]87 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {88 | ^89 | ( != nullptr)90../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]91 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {92 | ^93../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]94 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)95 | ^96../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]97 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||98 | ^99../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]100 96 | result.push_back(static_cast<char>(size >> (i * 8)));101 | ^102../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]103 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,104 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~105../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'106 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,107 | ^~~~~108../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'109 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,110 | ^~~~~~~~111../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]112 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);113 | ^~~114../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]115 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);116 | ^117../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]118 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)119 | ^120../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]121 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)122 | ^123../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]124 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||125 | ^126../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]127 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;128 | ^ 129 | {130../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors]131 250 | unsigned char mac[EVP_MAX_MD_SIZE];132 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~133../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]134 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),135 | ~^136 | (137 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||138 | == nullptr)139../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]140 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||141 | ^142../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]143 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||144 | ^145../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]146 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);147 | ^148../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]149 23 | static constexpr size_t maxFrameBytes = 64 * 1024;150 | ^151../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning152 23 | static constexpr size_t maxFrameBytes = 64 * 1024;153 | ^~~~~~~~~154 | static_cast<const size_t>( )155../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type156 23 | static constexpr size_t maxFrameBytes = 64 * 1024;157 | ^~158 | static_cast<long>( )159../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]160 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;161 | ^162../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning163 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;164 | ^~~~~~~~~~~~~~~165 | static_cast<const size_t>( )166../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type167 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;168 | ^~~~~~~~169 | static_cast<long>( )170../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]171 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool172 | ^173../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]174 53 | auto data(uint64_t id, std::string_view bytes) -> bool175 | ^176../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]177 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);178 | ^179../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]180 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool181 | ^182../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]183 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool184 | ^185 | const &186../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]187 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;188 | ^ 189 | {190../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]191 81 | if (size > limit) return false;192 | ^ 193 | {194../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]195 83 | cv.wait(lock, stop, [&] {196 | ^197 | -> bool198../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]199 84 | auto it = streams.find(id);200 | ^201../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]202 87 | auto const it = streams.find(id);203 | ^204../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]205 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;206 | ^ 207 | {208../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]209 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }210 | ^211../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]212 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }213 | ^214../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]215 96 | auto acknowledge(uint64_t id) -> bool216 | ^217../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]218 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;219 | ^ 220 | {221../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]222 105 | if (!enqueue(std::move(msg))) return false;223 | ^ 224 | {225../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]226 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool227 | ^228 | const &229../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]230 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });231 | ^232 | -> bool233../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]234 145 | auto finished(uint64_t id) -> bool235 | ^236../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]237 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;238 | ^ 239 | {240../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]241 150 | if (removed) cv.notify_all();242 | ^ 243 | {244../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]245 156 | void acknowledgementSent(uint64_t id)246 | ^247../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]248 159 | if (acknowledged.erase(id)) streams.erase(id);249 | ^ 250 | != 0u251../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]252 159 | if (acknowledged.erase(id)) streams.erase(id);253 | ^ 254 | {255../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]256 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {257 | ^258../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]259 208 | auto terminal(uint64_t id, bool abort) -> bool260 | ^261../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]262 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};263 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~264 | .status= .prepared=265../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here266 41 | struct Result267 | ^268../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]269 65 | Role minRole;270 | ^271../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]272 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};273 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~274 | .status= .prepared=275../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here276 41 | struct Result277 | ^278../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]279 85 | return {status, {}};280 | ^~~~~~~~~~~~281 | .status=.prepared=282../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here283 41 | struct Result284 | ^285../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]286 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};287 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~288 | .status= .prepared=289../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here290 41 | struct Result291 | ^292../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]293 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};294 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~295 | .status= .prepared=296../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here297 41 | struct Result298 | ^299../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]300 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};301 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~302 | .status= .prepared=303../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here304 41 | struct Result305 | ^306../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]307 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};308 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~309 | .status= .prepared=310../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here311 41 | struct Result312 | ^313../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]314 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};315 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~316 | .status= .prepared=317../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here318 41 | struct Result319 | ^320../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]321 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};322 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~323 | .status= .prepared=324../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here325 41 | struct Result326 | ^327../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]328 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),329 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~330 | .status= .prepared=331 123 | std::string(drvPath), assignId}};332 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~333../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here334 41 | struct Result335 | ^336../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]337 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),338 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~339 | .session= .open=340 123 | std::string(drvPath), assignId}};341 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~342 | .drvPath= .assignId=343../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here344 33 | struct Prepared345 | ^346../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]347 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};348 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~349 | .status= .prepared=350../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here351 41 | struct Result352 | ^353../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]354 189 | return {status, {}};355 | ^~~~~~~~~~~~356 | .status=.prepared=357../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here358 41 | struct Result359 | ^360../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]361 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};362 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~363 | .status= .prepared=364../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here365 41 | struct Result366 | ^367../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]368 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};369 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~370 | .status= .prepared=371../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here372 41 | struct Result373 | ^374../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]375 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};376 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~377 | .status= .prepared=378../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here379 41 | struct Result380 | ^381../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]382 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};383 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~384 | .status= .prepared=385../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here386 41 | struct Result387 | ^388../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]389 218 | return {status, {}};390 | ^~~~~~~~~~~~391 | .status=.prepared=392../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here393 41 | struct Result394 | ^395../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]396 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};397 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~398 | .status= .prepared=399../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here400 41 | struct Result401 | ^402../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]403 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};404 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~405 | .status= .prepared=406../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here407 41 | struct Result408 | ^409../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]410 233 | Auth &auth;411 | ^412../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]413 234 | ReverseRegistry ®istry;414 | ^415../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]416 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {417 | ^418../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]419 82 | auto it = sessions.find(std::string(workerId));420 | ^421../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]422 92 | auto it = sessions.find(handle->workerId);423 | ^424../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]425 107 | auto it = sessions.find(handle->workerId);426 | ^427../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]428 130 | for (auto & [id, session] : sessions) {429 | ^430../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]431 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};432 | ^ 433 | {434../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]435 56 | if (!selection.status.ok()) return selection.status;436 | ^ 437 | {438../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]439 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};440 | ^ 441 | {442../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]443 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};444 | ^ 445 | {446../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]447 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};448 | ^ 449 | {450../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]451 61 | auto const id = session->transport->nextStreamId.fetch_add(1);452 | ^453../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]454 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};455 | ^ 456 | {457../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]458 64 | if (!selection.status.ok()) return selection.status;459 | ^ 460 | {461../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]462 65 | if (!selection.prepared || selection.prepared->session != session)463 | ^464 | {465 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};466 | 467../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]468 67 | if (request.ByteSizeLong() > maxRequestBytes)469 | ^470 | {471 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};472 | 473../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]474 70 | if (bytes.size() > maxRequestBytes)475 | ^476 | {477 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};478 | 479../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]480 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};481 | ^ 482 | {483../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]484 75 | if (!status.ok()) return status;485 | ^ 486 | {487../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]488 77 | struct Release {489 | ^490../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]491 77 | struct Release {492 | ^493 78 | ReverseTransport & transport;494 79 | uint64_t id;495 | 496 | {}497../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]498 78 | ReverseTransport & transport;499 | ^500../src/daemon/reverse-relay.hh:81:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]501 81 | ~Release() {502 | ^503/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:256:3: note: frame #0: unhandled exception of type 'out_of_range' may be thrown in function '__throw_out_of_range' here504 256 | throw out_of_range(__msg);505 | ^506/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/unordered_map:1692:5: note: frame #1: function 'at' calls function '__throw_out_of_range' here507 1692 | std::__throw_out_of_range("unordered_map::at: key not found");508 | ^509../src/daemon/reverse-frames.hh:211:59: note: frame #2: function 'terminal' calls function 'at' here510 211 | if (closed || !streams.contains(id) || (!abort && streams.at(id))) {511 | ^512../src/daemon/reverse-frames.hh:94:47: note: frame #3: function 'cancel' calls function 'terminal' here513 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }514 | ^515../src/daemon/reverse-relay.hh:84:40: note: frame #4: function '~Release' calls function 'cancel' here516 84 | if (!completed) (void) transport.outgoing.cancel(id);517 | ^518../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]519 84 | if (!completed) (void) transport.outgoing.cancel(id);520 | ^ 521 | {522../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]523 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));524 | ^ 525 | {526../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]527 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));528 | ^529../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]530 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));531 | ^532../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]533 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};534 | ^ 535 | {536../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]537 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))538 | ^539 | {540 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};541 | 542../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]543 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))544 | ^545 | {546 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};547 | 548../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]549 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};550 | ^ 551 | {552../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]553 111 | std::jthread monitor([&](std::stop_token stop) {554 | ^555 | -> auto556../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]557 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });558 | ^559../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]560 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });561 | ^562 | -> auto563../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]564 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};565 | ^ 566 | {567../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]568 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))569 | ^570 | {571 128 | return {grpc::StatusCode::UNAVAILABLE,572 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};573 | 574../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]575 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))576 | ^577 | {578 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};579 | 580../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]581 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};582 | ^ 583 | {584../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]585 135 | if (beforeAck) beforeAck();586 | ^ 587 | {588../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]589 136 | if (!transport.outgoing.acknowledge(id))590 | ^591 | {592 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};593 | 594../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]595 145 | if (pending.size() < 4) break;596 | ^ 597 | {598../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]599 147 | for (unsigned i = 0; i != 4; ++i)600 | ^601 | {602 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);603 | 604../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]605 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);606 | ^~~607../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]608 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);609 | ^610../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]611 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};612 | ^ 613 | {614../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]615 153 | if (pending.size() < *expected) break;616 | ^ 617 | {618../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]619 154 | if (!receive(std::string_view(pending).substr(0, *expected)))620 | ^621 | {622 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};623 | 624../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]625 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};626 | ^ 627 | {628../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]629 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};630 | ^ 631 | {632../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]633 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};634 | ^ 635 | {636../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]637 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))638 | ^639 | {640 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};641 | 642../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]643 169 | ReverseGateway & gateway;644 | ^645../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]646 170 | ReverseRegistry & registry;647 | ^648../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]649 32 | [[nodiscard]] auto open(uint64_t id) -> bool650 | ^651../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]652 51 | auto it = streams.find(frame.stream_id());653 | ^654../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]655 56 | if (!cancelled.contains(frame.stream_id())) return false;656 | ^ 657 | {658../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]659 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;660 | ^ 661 | {662../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]663 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool664 | ^665../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]666 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool667 | ^668 | const &669../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]670 104 | auto pending = [&] {671 | ^672 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>673../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]674 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });675 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~676 | std::ranges::find_if queue677../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]678 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });679 | ^680 | -> auto681../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]682 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });683 | ^684 | -> bool685../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]686 111 | auto it = pending();687 | ^688../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]689 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool690 | ^691../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]692 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);693 | ^ 694 | {695../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]696 168 | [[nodiscard]] auto finished(uint64_t id) -> bool697 | ^698../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]699 171 | auto it = streams.find(id);700 | ^701../src/daemon/reverse-worker.hh:26:41: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]702 26 | [[nodiscard]] auto message(uint64_t id, const nix::remote::BuildDerivationChunk & chunk,703 | ^704../src/daemon/reverse-worker.hh:27:48: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]705 27 | std::stop_token stop, const std::function<bool()> & cancelled = {}) -> bool706 | ^707 | const &708../src/daemon/reverse-worker.hh:30:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]709 30 | if (size > ReverseRelay::maxMessageBytes) return false;710 | ^ 711 | {712../src/daemon/reverse-worker.hh:32:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]713 32 | if (wire.size() > ReverseRelay::maxMessageBytes) return false;714 | ^ 715 | {716../src/daemon/reverse-worker.hh:36:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]717 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));718 | ^ 719 | {720../src/daemon/reverse-worker.hh:36:88: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]721 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));722 | ^723../src/daemon/reverse-worker.hh:36:98: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]724 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));725 | ^726../src/daemon/reverse-worker.hh:42:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]727 42 | if (!push(std::move(frame), stop, cancelled)) return false;728 | ^ 729 | {730../src/daemon/reverse-worker.hh:47:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]731 47 | [[nodiscard]] auto finish(uint64_t id, const grpc::Status & status, std::stop_token stop,732 | ^733../src/daemon/reverse-worker.hh:53:78: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]734 53 | frame.mutable_finish()->set_message(status.error_message().substr(0, 1024));735 | ^736../src/daemon/reverse-worker.hh:56:39: error: parameter 'stop' of type 'std::stop_token' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]737 16 | return push(std::move(frame), stop, {}, waitForSpace, std::move(afterAck));738 | ^ 739 | std::move( )740../src/daemon/reverse-worker.hh:67:84: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]741 67 | [[nodiscard]] auto take(nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool742 | ^743 | const &744../src/daemon/reverse-worker.hh:70:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]745 70 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });746 | ^747 | -> bool748../src/daemon/reverse-worker.hh:71:62: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]749 71 | if (closed || stop.stop_requested() || queue.empty()) return false;750 | ^ 751 | {752../src/daemon/reverse-worker.hh:79:46: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]753 79 | [[nodiscard]] auto acknowledged(uint64_t id) -> bool754 | ^755../src/daemon/reverse-worker.hh:83:13: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]756 83 | std::scoped_lock lock(mutex);757 | ^758 | const 759../src/daemon/reverse-worker.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]760 84 | auto it = afterAcks.find(id);761 | ^762../src/daemon/reverse-worker.hh:85:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]763 85 | if (it == afterAcks.end()) return false;764 | ^ 765 | {766../src/daemon/reverse-worker.hh:89:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]767 89 | if (completion) completion();768 | ^ 769 | {770../src/daemon/reverse-worker.hh:95:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]771 95 | std::scoped_lock lock(mutex);772 | ^773 | const 774../src/daemon/reverse-worker.hh:108:13: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]775 108 | std::scoped_lock lock(mutex);776 | ^777 | const 778../src/daemon/reverse-worker.hh:111:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]779 111 | for (auto & [id, complete] : pending) {780 | ^781../src/daemon/reverse-worker.hh:117:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]782 117 | void cancel(uint64_t id)783 | ^784../src/daemon/reverse-worker.hh:119:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]785 119 | std::scoped_lock lock(mutex);786 | ^787 | const 788../src/daemon/reverse-worker.hh:134:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]789 134 | } else ++it;790 | ^ 791 | {792../src/daemon/reverse-worker.hh:134:19: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors]793 134 | } else ++it;794 | ^ 795 | {796../src/daemon/reverse-worker.hh:141:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]797 141 | std::scoped_lock lock(mutex);798 | ^799 | const 800../src/daemon/reverse-worker.hh:146:82: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]801 146 | [[nodiscard]] auto push(nix::remote::ReverseWorkerMsg frame, std::stop_token stop,802 | ^803 | const &804../src/daemon/reverse-worker.hh:151:51: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]805 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false;806 | ^807../src/daemon/reverse-worker.hh:151:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]808 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false;809 | ^ 810 | {811../src/daemon/reverse-worker.hh:155:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]812 155 | && (!cancelled || !cancelled()))813 | ^814 | {815 156 | cv.wait_for(lock, std::chrono::milliseconds(25));816 | 817../src/daemon/reverse-worker.hh:156:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]818 156 | cv.wait_for(lock, std::chrono::milliseconds(25));819 | ^820../src/daemon/reverse-worker.hh:159:43: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]821 159 | || (cancelled && cancelled())) return false;822 | ^ 823 | {824../src/daemon/reverse-worker.hh:162:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]825 162 | || !afterAcks.emplace(frame.stream_id(), std::move(afterAck)).second) return false;826 | ^ 827 | {828../tests/reverse-worker-test.cc:8:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]829 8 | int main()830 | ^831/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:256:3: note: frame #0: unhandled exception of type 'out_of_range' may be thrown in function '__throw_out_of_range' here832 256 | throw out_of_range(__msg);833 | ^834/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2477:5: note: frame #1: function '__throw_out_of_range' calls function '__throw_out_of_range' here835 2477 | std::__throw_out_of_range("basic_string");836 | ^837/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1124:7: note: frame #2: function 'basic_string' calls function '__throw_out_of_range' here838 1124 | this->__throw_out_of_range();839 | ^840/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1750:12: note: frame #3: function 'substr' calls function 'basic_string' here841 1750 | return basic_string(*this, __pos, __n);842 | ^843../src/daemon/reverse-worker.hh:41:44: note: frame #4: function 'message' calls function 'substr' here844 41 | frame.mutable_data()->set_data(bytes.substr(offset, ReverseFrames::maxFrameBytes));845 | ^846../tests/reverse-worker-test.cc:14:12: note: frame #5: function 'main' calls function 'message' here847 14 | assert(replies.message(1, chunk, stop.get_token()));848 | ^849../tests/reverse-worker-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]850 8 | int main()851 | ~~~ ^ 852 | auto -> int853../tests/reverse-worker-test.cc:11:5: error: variable 'stop' of type 'std::stop_source' can be declared 'const' [misc-const-correctness,-warnings-as-errors]854 11 | std::stop_source stop;855 | ^856 | const 857../tests/reverse-worker-test.cc:12:18: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors]858 6 | #include "reverse-worker.hh"859 7 | 860 8 | int main()861 9 | {862 10 | nixgrpc::ReverseWorkerOutbound replies;863 11 | std::stop_source stop;864 12 | nix::remote::BuildDerivationChunk chunk;865 | ^866../tests/reverse-worker-test.cc:13:50: error: 130000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]867 13 | chunk.mutable_done()->set_result(std::string(130000, 'x'));868 | ^869../tests/reverse-worker-test.cc:15:36: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors]870 2 | #include <stop_token>871 3 | #include <string>872 4 | #include <thread>873 5 | 874 6 | #include "reverse-worker.hh"875 7 | 876 8 | int main()877 9 | {878 10 | nixgrpc::ReverseWorkerOutbound replies;879 11 | std::stop_source stop;880 12 | nix::remote::BuildDerivationChunk chunk;881 13 | chunk.mutable_done()->set_result(std::string(130000, 'x'));882 14 | assert(replies.message(1, chunk, stop.get_token()));883 15 | assert(replies.finish(1, grpc::Status::OK, stop.get_token()));884 | ^885../tests/reverse-worker-test.cc:16:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]886 16 | nix::remote::ReverseWorkerMsg frame;887 | ^888../tests/reverse-worker-test.cc:24:55: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]889 6 | assert(frame.data().data().size() <= nixgrpc::ReverseFrames::maxFrameBytes);890 | ^891../tests/reverse-worker-test.cc:28:5: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]892 2 | uint32_t length = 0;893 | ^894../tests/reverse-worker-test.cc:29:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]895 29 | for (unsigned i = 0; i != 4; ++i)896 | ^897 | {898 30 | length |= static_cast<uint32_t>(static_cast<unsigned char>(wire[i])) << (8 * i);899 | 900../tests/reverse-worker-test.cc:30:72: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]901 30 | length |= static_cast<uint32_t>(static_cast<unsigned char>(wire[i])) << (8 * i);902 | ^~~903../tests/reverse-worker-test.cc:30:82: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]904 30 | length |= static_cast<uint32_t>(static_cast<unsigned char>(wire[i])) << (8 * i);905 | ^906../tests/reverse-worker-test.cc:32:76: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]907 32 | assert(wire.size() == length + 4 && decoded.ParseFromArray(wire.data() + 4, static_cast<int>(length)));908 | ^909../tests/reverse-worker-test.cc:36:5: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors]910 36 | assert(replies.finish(10, grpc::Status::OK, stop.get_token(), true, [&] { retired = true; }));911 | ^912../tests/reverse-worker-test.cc:36:73: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]913 36 | assert(replies.finish(10, grpc::Status::OK, stop.get_token(), true, [&] { retired = true; }));914 | ^915 | -> void916/nix/store/svkkgla6ini4hg035ka7wb8idm301r1i-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'917 99 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)918 | ^919../tests/reverse-worker-test.cc:43:5: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors]920 43 | assert(lost.finish(11, grpc::Status::OK, stop.get_token(), true, [&] { abandoned = true; }));921 | ^922../tests/reverse-worker-test.cc:43:70: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]923 43 | assert(lost.finish(11, grpc::Status::OK, stop.get_token(), true, [&] { abandoned = true; }));924 | ^925 | -> void926/nix/store/svkkgla6ini4hg035ka7wb8idm301r1i-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'927 99 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)928 | ^929../tests/reverse-worker-test.cc:52:37: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]930 52 | assert(replies.finish(2, {grpc::StatusCode::CANCELLED, "cancelled"}, stop.get_token()));931 | ^932../tests/reverse-worker-test.cc:56:58: error: no header providing "nixgrpc::ReverseRelay" is directly included [misc-include-cleaner,-warnings-as-errors]933 6 | huge.mutable_done()->set_result(std::string(nixgrpc::ReverseRelay::maxMessageBytes + 1, 'x'));934 | ^935../tests/reverse-worker-test.cc:63:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]936 63 | for (uint64_t id = 1; id <= 10000; ++id) {937 | ^938../tests/reverse-worker-test.cc:63:33: error: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]939 63 | for (uint64_t id = 1; id <= 10000; ++id) {940 | ^941../tests/reverse-worker-test.cc:64:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]942 64 | if (!saturated.finish(id, {grpc::StatusCode::CANCELLED, std::string(1024, 'x')},943 | ^944../tests/reverse-worker-test.cc:76:33: error: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]945 76 | for (uint64_t id = 1; id <= 10000; ++id) {946 | ^947../tests/reverse-worker-test.cc:83:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]948 83 | std::jthread producer([&](std::stop_token workStop) {949 | ^950 | -> void951../tests/reverse-worker-test.cc:84:33: error: 10001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]952 84 | queued = blocked.finish(10001, {grpc::StatusCode::CANCELLED, statusText}, workStop);953 | ^954../tests/reverse-worker-test.cc:84:83: error: parameter 'workStop' of type 'std::stop_token' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors]955 5 | queued = blocked.finish(10001, {grpc::StatusCode::CANCELLED, statusText}, workStop);956 | ^ 957 | std::move( )958>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/dispatcher-bench.cc959../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]960 12 | #include <chrono>961 | 962 13 | #include <chrono>963 | ^~~~~~~~~~~~~~~~~964../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]965 90 | std::chrono::system_clock::time_point credentialExpiresAt{};966 | ^~967../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]968 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();969 | ^970../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]971 371 | auto const it = workerIds.find(std::string(addr));972 | ^973>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/src/client/channel.cc974[1/1] (1/2) Processing file /private/var/tb/4/scratch/4342aa3e17441242/build/source/src/client/channel.cc.975[1/1] (2/2) Processing file /private/var/tb/4/scratch/4342aa3e17441242/build/source/src/client/channel.cc.976>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/reverse-capability-test.cc977../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]978 553 | namespaceClaim && namespaceClaim->is_string()) {979 | ^980 | ( != nullptr)981../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]982 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {983 | ^984 | ( != nullptr)985../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]986 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {987 | ^988../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]989 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {990 | ^991../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]992 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {993 | ^994../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]995 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {996 | ^997 | ( != nullptr)998../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]999 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1000 | ^1001../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1002 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1003 | ^1004../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1005 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1006 | ^1007../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1008 96 | result.push_back(static_cast<char>(size >> (i * 8)));1009 | ^1010../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]1011 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1012 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1013../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1014 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1015 | ^~~~~1016../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1017 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1018 | ^~~~~~~~1019../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]1020 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1021 | ^~~1022../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1023 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1024 | ^1025../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1026 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1027 | ^1028../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1029 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1030 | ^1031../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1032 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1033 | ^1034../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1035 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1036 | ^ 1037 | {1038../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors]1039 250 | unsigned char mac[EVP_MAX_MD_SIZE];1040 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1041../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1042 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1043 | ~^1044 | (1045 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1046 | == nullptr)1047../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1048 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1049 | ^1050../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]1051 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1052 | ^1053../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1054 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1055 | ^1056../tests/reverse-capability-test.cc:7:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1057 7 | int main()1058 | ^1059/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:244:3: note: frame #0: unhandled exception of type 'length_error' may be thrown in function '__throw_length_error' here1060 244 | throw length_error(__msg);1061 | ^1062/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2473:5: note: frame #1: function '__throw_length_error' calls function '__throw_length_error' here1063 2473 | std::__throw_length_error("basic_string");1064 | ^1065/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2597:5: note: frame #2: function '__init' calls function '__throw_length_error' here1066 2597 | this->__throw_length_error();1067 | ^1068/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1090:97: note: frame #3: function 'basic_string' calls function '__init' here1069 1090 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c) { __init(__n, __c); }1070 | ^1071../src/daemon/reverse-capability.hh:43:21: note: frame #4: function 'newKey' calls function 'basic_string' here1072 43 | std::string key(keyBytes, '\0');1073 | ^1074../tests/reverse-capability-test.cc:12:16: note: frame #5: function 'main' calls function 'newKey' here1075 12 | auto key = ReverseCapability::newKey();1076 | ^1077../tests/reverse-capability-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1078 7 | int main()1079 | ~~~ ^ 1080 | auto -> int1081../tests/reverse-capability-test.cc:9:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1082 5 | #include "reverse-capability.hh"1083 6 | 1084 7 | int main()1085 8 | {1086 9 | using nixgrpc::Caller;1087 | ^1088../tests/reverse-capability-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1089 5 | #include "reverse-capability.hh"1090 6 | 1091 7 | int main()1092 8 | {1093 9 | using nixgrpc::Caller;1094 10 | using nixgrpc::ReverseCapability;1095 11 | using nixgrpc::Role;1096 | ^1097../tests/reverse-capability-test.cc:19:5: error: 'const auto worker' can be declared as 'const auto *const worker' [readability-qualified-auto,-warnings-as-errors]1098 19 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1099 | ^~~~~~~~~~1100 | const auto *const 1101../tests/reverse-capability-test.cc:20:56: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1102 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1103 | ^1104../tests/reverse-capability-test.cc:20:59: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1105 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1106 | ^1107../tests/reverse-capability-test.cc:20:101: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1108 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1109 | ^1110../tests/reverse-capability-test.cc:22:69: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1111 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1112 | ^1113../tests/reverse-capability-test.cc:22:72: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1114 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1115 | ^1116../tests/reverse-capability-test.cc:25:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1117 5 | nix::remote::ReverseOpen open;1118 | ^1119../tests/reverse-capability-test.cc:31:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]1120 31 | nix::remote::BuildDerivationRequest request;1121 | ^1122../tests/reverse-capability-test.cc:33:27: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1123 33 | request.set_assign_id(93);1124 | ^1125../tests/reverse-capability-test.cc:35:27: error: 94 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1126 35 | request.set_assign_id(94);1127 | ^1128../tests/reverse-capability-test.cc:37:27: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1129 37 | request.set_assign_id(93);1130 | ^1131../tests/reverse-capability-test.cc:38:40: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1132 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1133 | ^1134../tests/reverse-capability-test.cc:38:55: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors]1135 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1136 | ^1137../tests/reverse-capability-test.cc:67:60: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1138 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1139 | ^1140../tests/reverse-capability-test.cc:67:63: error: 44 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1141 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1142 | ^1143../tests/reverse-capability-test.cc:69:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1144 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1145 | ^1146../tests/reverse-capability-test.cc:69:76: error: 44 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1147 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1148 | ^1149../tests/reverse-capability-test.cc:71:62: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1150 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1151 | ^1152../tests/reverse-capability-test.cc:71:65: error: 45 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1153 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1154 | ^1155../tests/reverse-capability-test.cc:73:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1156 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1157 | ^1158../tests/reverse-capability-test.cc:73:76: error: 45 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1159 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1160 | ^1161../tests/reverse-capability-test.cc:75:18: error: no header providing "nix::remote::AddMultipleChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1162 75 | nix::remote::AddMultipleChunk first;1163 | ^1164../tests/reverse-capability-test.cc:80:62: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1165 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1166 | ^1167../tests/reverse-capability-test.cc:80:65: error: 47 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1168 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1169 | ^1170../tests/reverse-capability-test.cc:81:59: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1171 81 | "abc.drv", 93, 0, now);1172 | ^1173../tests/reverse-capability-test.cc:83:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1174 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1175 | ^1176../tests/reverse-capability-test.cc:83:76: error: 47 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1177 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1178 | ^1179../tests/reverse-capability-test.cc:97:69: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1180 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1181 | ^1182../tests/reverse-capability-test.cc:97:72: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1183 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1184 | ^1185../tests/reverse-capability-test.cc:98:66: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1186 98 | "abc.drv", 93, 0, now);1187 | ^1188../tests/reverse-capability-test.cc:100:87: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1189 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1190 | ^1191../tests/reverse-capability-test.cc:100:90: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1192 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1193 | ^1194../tests/reverse-capability-test.cc:105:24: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors]1195 3 | noRole.role = std::nullopt;1196 | ^1197../tests/reverse-capability-test.cc:109:65: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1198 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1199 | ^1200../tests/reverse-capability-test.cc:109:68: error: 46 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1201 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1202 | ^1203>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/tests/reverse-gateway-test.cc1204../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1205 553 | namespaceClaim && namespaceClaim->is_string()) {1206 | ^1207 | ( != nullptr)1208../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1209 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1210 | ^1211 | ( != nullptr)1212../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1213 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1214 | ^1215../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1216 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1217 | ^1218../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1219 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1220 | ^1221../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1222 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1223 | ^1224 | ( != nullptr)1225../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1226 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1227 | ^1228../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1229 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1230 | ^1231../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1232 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1233 | ^1234../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1235 96 | result.push_back(static_cast<char>(size >> (i * 8)));1236 | ^1237../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]1238 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1239 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1240../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1241 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1242 | ^~~~~1243../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1244 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1245 | ^~~~~~~~1246../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]1247 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1248 | ^~~1249../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1250 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1251 | ^1252../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1253 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1254 | ^1255../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1256 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1257 | ^1258../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1259 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1260 | ^1261../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1262 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1263 | ^ 1264 | {1265../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors]1266 250 | unsigned char mac[EVP_MAX_MD_SIZE];1267 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1268../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1269 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1270 | ~^1271 | (1272 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1273 | == nullptr)1274../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1275 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1276 | ^1277../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]1278 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1279 | ^1280../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1281 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1282 | ^1283../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1284 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1285 | ^1286../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1287 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1288 | ^~~~~~~~~1289 | static_cast<const size_t>( )1290../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1291 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1292 | ^~1293 | static_cast<long>( )1294../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1295 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1296 | ^1297../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1298 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1299 | ^~~~~~~~~~~~~~~1300 | static_cast<const size_t>( )1301../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1302 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1303 | ^~~~~~~~1304 | static_cast<long>( )1305../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1306 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1307 | ^1308../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1309 53 | auto data(uint64_t id, std::string_view bytes) -> bool1310 | ^1311../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1312 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1313 | ^1314../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1315 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1316 | ^1317../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1318 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1319 | ^1320 | const &1321../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1322 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1323 | ^ 1324 | {1325../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1326 81 | if (size > limit) return false;1327 | ^ 1328 | {1329../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1330 83 | cv.wait(lock, stop, [&] {1331 | ^1332 | -> bool1333../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1334 84 | auto it = streams.find(id);1335 | ^1336../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1337 87 | auto const it = streams.find(id);1338 | ^1339../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1340 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1341 | ^ 1342 | {1343../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1344 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1345 | ^1346../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1347 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1348 | ^1349../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1350 96 | auto acknowledge(uint64_t id) -> bool1351 | ^1352../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1353 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1354 | ^ 1355 | {1356../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1357 105 | if (!enqueue(std::move(msg))) return false;1358 | ^ 1359 | {1360../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1361 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1362 | ^1363 | const &1364../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1365 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1366 | ^1367 | -> bool1368../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1369 145 | auto finished(uint64_t id) -> bool1370 | ^1371../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1372 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1373 | ^ 1374 | {1375../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1376 150 | if (removed) cv.notify_all();1377 | ^ 1378 | {1379../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1380 156 | void acknowledgementSent(uint64_t id)1381 | ^1382../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1383 159 | if (acknowledged.erase(id)) streams.erase(id);1384 | ^ 1385 | != 0u1386../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1387 159 | if (acknowledged.erase(id)) streams.erase(id);1388 | ^ 1389 | {1390../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1391 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1392 | ^1393../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1394 208 | auto terminal(uint64_t id, bool abort) -> bool1395 | ^1396../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1397 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1398 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1399 | .status= .prepared=1400../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1401 41 | struct Result1402 | ^1403../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]1404 65 | Role minRole;1405 | ^1406../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1407 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};1408 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1409 | .status= .prepared=1410../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1411 41 | struct Result1412 | ^1413../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1414 85 | return {status, {}};1415 | ^~~~~~~~~~~~1416 | .status=.prepared=1417../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1418 41 | struct Result1419 | ^1420../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1421 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};1422 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1423 | .status= .prepared=1424../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1425 41 | struct Result1426 | ^1427../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1428 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};1429 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1430 | .status= .prepared=1431../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1432 41 | struct Result1433 | ^1434../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1435 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};1436 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1437 | .status= .prepared=1438../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1439 41 | struct Result1440 | ^1441../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1442 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};1443 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1444 | .status= .prepared=1445../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1446 41 | struct Result1447 | ^1448../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1449 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};1450 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1451 | .status= .prepared=1452../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1453 41 | struct Result1454 | ^1455../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1456 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};1457 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1458 | .status= .prepared=1459../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1460 41 | struct Result1461 | ^1462../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1463 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),1464 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1465 | .status= .prepared=1466 123 | std::string(drvPath), assignId}};1467 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1468../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1469 41 | struct Result1470 | ^1471../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]1472 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),1473 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1474 | .session= .open=1475 123 | std::string(drvPath), assignId}};1476 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1477 | .drvPath= .assignId=1478../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here1479 33 | struct Prepared1480 | ^1481../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1482 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1483 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1484 | .status= .prepared=1485../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1486 41 | struct Result1487 | ^1488../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1489 189 | return {status, {}};1490 | ^~~~~~~~~~~~1491 | .status=.prepared=1492../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1493 41 | struct Result1494 | ^1495../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1496 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};1497 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1498 | .status= .prepared=1499../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1500 41 | struct Result1501 | ^1502../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1503 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};1504 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1505 | .status= .prepared=1506../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1507 41 | struct Result1508 | ^1509../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1510 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};1511 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1512 | .status= .prepared=1513../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1514 41 | struct Result1515 | ^1516../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1517 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1518 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1519 | .status= .prepared=1520../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1521 41 | struct Result1522 | ^1523../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1524 218 | return {status, {}};1525 | ^~~~~~~~~~~~1526 | .status=.prepared=1527../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1528 41 | struct Result1529 | ^1530../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1531 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};1532 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1533 | .status= .prepared=1534../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1535 41 | struct Result1536 | ^1537../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1538 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};1539 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1540 | .status= .prepared=1541../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1542 41 | struct Result1543 | ^1544../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1545 233 | Auth &auth;1546 | ^1547../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1548 234 | ReverseRegistry ®istry;1549 | ^1550../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1551 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {1552 | ^1553../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1554 82 | auto it = sessions.find(std::string(workerId));1555 | ^1556../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1557 92 | auto it = sessions.find(handle->workerId);1558 | ^1559../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1560 107 | auto it = sessions.find(handle->workerId);1561 | ^1562../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1563 130 | for (auto & [id, session] : sessions) {1564 | ^1565../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1566 32 | [[nodiscard]] auto open(uint64_t id) -> bool1567 | ^1568../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1569 51 | auto it = streams.find(frame.stream_id());1570 | ^1571../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1572 56 | if (!cancelled.contains(frame.stream_id())) return false;1573 | ^ 1574 | {1575../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1576 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;1577 | ^ 1578 | {1579../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1580 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1581 | ^1582../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1583 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1584 | ^1585 | const &1586../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1587 104 | auto pending = [&] {1588 | ^1589 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>1590../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]1591 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1592 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~1593 | std::ranges::find_if queue1594../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1595 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1596 | ^1597 | -> auto1598../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1599 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });1600 | ^1601 | -> bool1602../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1603 111 | auto it = pending();1604 | ^1605../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1606 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool1607 | ^1608../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1609 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);1610 | ^ 1611 | {1612../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1613 168 | [[nodiscard]] auto finished(uint64_t id) -> bool1614 | ^1615../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1616 171 | auto it = streams.find(id);1617 | ^1618../src/daemon/reverse-upload-relay.hh:34:84: error: the parameter 'first' of type 'nix::remote::UploadBuildInputsChunk' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1619 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status1620 | ^1621 | const &1622../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1623 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)1624 | ^1625 | {1626 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};1627 | 1628../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1629 40 | if (!selection.status.ok()) return selection.status;1630 | ^ 1631 | {1632../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1633 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)1634 | ^1635 | {1636 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};1637 | 1638../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1639 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};1640 | ^ 1641 | {1642../src/daemon/reverse-upload-relay.hh:45:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1643 45 | auto const id = session->transport->nextStreamId.fetch_add(1);1644 | ^1645../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1646 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};1647 | ^ 1648 | {1649../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1650 48 | if (!selection.status.ok()) return selection.status;1651 | ^ 1652 | {1653../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1654 49 | if (!selection.prepared || selection.prepared->session != session)1655 | ^1656 | {1657 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};1658 | 1659../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1660 55 | || selection.prepared->assignId != first.assign_id())1661 | ^1662 | {1663 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};1664 | 1665../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1666 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};1667 | ^ 1668 | {1669../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1670 60 | if (!status.ok()) return status;1671 | ^ 1672 | {1673../src/daemon/reverse-upload-relay.hh:61:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]1674 61 | struct Release {1675 | ^1676../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]1677 61 | struct Release {1678 | ^1679 62 | ReverseTransport & transport;1680 63 | uint64_t id;1681 | 1682 | {}1683../src/daemon/reverse-upload-relay.hh:62:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1684 62 | ReverseTransport & transport;1685 | ^1686../src/daemon/reverse-upload-relay.hh:65:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1687 65 | ~Release() {1688 | ^1689/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here1690 67 | throw bad_array_new_length();1691 | ^1692/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here1693 101 | std::__throw_bad_array_new_length();1694 | ^1695/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here1696 112 | return {allocate(__n), __n};1697 | ^1698/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least' here1699 280 | return __alloc.allocate_at_least(__n);1700 | ^1701/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here1702 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);1703 | ^1704/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:330:25: note: frame #5: function '__split_buffer' calls function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here1705 330 | auto __allocation = std::__allocate_at_least(__alloc_, __cap);1706 | ^1707/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:465:47: note: frame #6: function 'emplace_back<nix::remote::ReverseFarmMsg *&>' calls function '__split_buffer' here1708 465 | __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc_);1709 | ^1710/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:2178:5: note: frame #7: function '__add_back_capacity' calls function 'emplace_back<nix::remote::ReverseFarmMsg *&>' here1711 2178 | __map_.emplace_back(__pt);1712 | ^1713/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:1605:5: note: frame #8: function 'push_back' calls function '__add_back_capacity' here1714 1605 | __add_back_capacity();1715 | ^1716../src/daemon/reverse-frames.hh:199:9: note: frame #9: function 'enqueue' calls function 'push_back' here1717 199 | queue.push_back(std::move(msg));1718 | ^1719../src/daemon/reverse-frames.hh:234:14: note: frame #10: function 'terminal' calls function 'enqueue' here1720 234 | if (!enqueue(std::move(msg))) {1721 | ^1722../src/daemon/reverse-frames.hh:94:47: note: frame #11: function 'cancel' calls function 'terminal' here1723 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1724 | ^1725../src/daemon/reverse-upload-relay.hh:66:40: note: frame #12: function '~Release' calls function 'cancel' here1726 66 | if (!completed) (void) transport.outgoing.cancel(id);1727 | ^1728../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1729 66 | if (!completed) (void) transport.outgoing.cancel(id);1730 | ^ 1731 | {1732../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]1733 70 | } release{transport, id};1734 | ^~~~~~~~~~~~~~~1735 | .transport=.id=1736../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here1737 61 | struct Release {1738 | ^1739../src/daemon/reverse-upload-relay.hh:75:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1740 75 | std::condition_variable_any cv;1741 | ^1742../src/daemon/reverse-upload-relay.hh:76:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1743 76 | std::jthread monitor([&](std::stop_token stop) {1744 | ^1745 | const 1746../src/daemon/reverse-upload-relay.hh:76:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1747 76 | std::jthread monitor([&](std::stop_token stop) {1748 | ^1749 | -> void1750../src/daemon/reverse-upload-relay.hh:76:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1751 76 | std::jthread monitor([&](std::stop_token stop) {1752 | ^1753 | const &1754../src/daemon/reverse-upload-relay.hh:87:67: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1755 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });1756 | ^1757../src/daemon/reverse-upload-relay.hh:87:72: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1758 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });1759 | ^1760 | -> bool1761../src/daemon/reverse-upload-relay.hh:90:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1762 90 | auto const live = [&] {1763 | ^1764 | -> bool1765../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1766 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;1767 | ^ 1768 | {1769../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1770 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;1771 | ^ 1772 | {1773../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1774 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);1775 | ^ 1776 | {1777../src/daemon/reverse-upload-relay.hh:99:52: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]1778 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);1779 | ^~~1780../src/daemon/reverse-upload-relay.hh:99:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1781 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);1782 | ^1783../src/daemon/reverse-upload-relay.hh:99:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1784 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);1785 | ^1786../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1787 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;1788 | ^ 1789 | {1790../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1791 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)1792 | ^1793 | {1794 102 | if (!live() || !transport.outgoing.waitData(id,1795 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;1796 | 1797../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1798 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;1799 | ^ 1800 | {1801../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1802 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};1803 | ^ 1804 | {1805../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1806 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};1807 | ^ 1808 | {1809../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1810 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};1811 | ^ 1812 | {1813../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1814 113 | if (!live() || !transport.outgoing.halfClose(id))1815 | ^1816 | {1817 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};1818 | 1819../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1820 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())1821 | ^1822 | {1823 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};1824 | 1825../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1826 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};1827 | ^ 1828 | {1829../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1830 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};1831 | ^ 1832 | {1833../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1834 120 | if (!transport.responses.finished(id))1835 | ^1836 | {1837 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};1838 | 1839../src/daemon/reverse-upload-relay.hh:127:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1840 127 | ReverseGateway & gateway;1841 | ^1842../src/daemon/reverse-upload-relay.hh:128:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1843 128 | ReverseRegistry & registry;1844 | ^1845../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1846 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1847 | ^1848../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning1849 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1850 | ^~~~~~~~~~~1851 | static_cast<const size_t>( )1852../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type1853 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1854 | ^~~~1855 | static_cast<long>( )1856../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1857 49 | if (failed || bytes.empty() || !consume) return fail();1858 | ^ 1859 | {1860../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors]1861 53 | buffer.append(bytes.data(), count);1862 | ~~~~~~^~~~1863../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1864 57 | for (unsigned i = 0; i < 4; ++i)1865 | ^1866 | {1867 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1868 | 1869../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]1870 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1871 | ^~~1872../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1873 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1874 | ^1875../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1876 59 | if (length == 0 || length > maxChunkBytes) return fail();1877 | ^ 1878 | {1879../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1880 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))1881 | ^1882../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1883 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))1884 | ^1885 | {1886 66 | return fail();1887 | 1888../tests/reverse-gateway-test.cc:14:7: error: class 'ClientService' can be moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage,-warnings-as-errors]1889 14 | class ClientService final : public nix::remote::NixRemote::Service1890 | ^1891../tests/reverse-gateway-test.cc:17:30: error: member 'gateway' of type 'nixgrpc::ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1892 17 | nixgrpc::ReverseGateway &gateway;1893 | ^1894../tests/reverse-gateway-test.cc:18:14: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors]1895 12 | #include "reverse-upload-relay.hh"1896 13 | 1897 14 | class ClientService final : public nix::remote::NixRemote::Service1898 15 | {1899 16 | public:1900 17 | nixgrpc::ReverseGateway &gateway;1901 18 | nixgrpc::ReverseRegistry ®istry;1902 | ^1903../tests/reverse-gateway-test.cc:18:31: error: member 'registry' of type 'nixgrpc::ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]1904 18 | nixgrpc::ReverseRegistry ®istry;1905 | ^1906../tests/reverse-gateway-test.cc:19:10: error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors]1907 9 | 1908 10 | #include "nix_remote.grpc.pb.h"1909 11 | #include "reverse-gateway.hh"1910 12 | #include "reverse-upload-relay.hh"1911 13 | 1912 14 | class ClientService final : public nix::remote::NixRemote::Service1913 15 | {1914 16 | public:1915 17 | nixgrpc::ReverseGateway &gateway;1916 18 | nixgrpc::ReverseRegistry ®istry;1917 19 | std::string worker;1918 | ^1919../tests/reverse-gateway-test.cc:20:11: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors]1920 2 | grpc::Status last;1921 | ^1922../tests/reverse-gateway-test.cc:21:10: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors]1923 9 | 1924 10 | #include "nix_remote.grpc.pb.h"1925 11 | #include "reverse-gateway.hh"1926 12 | #include "reverse-upload-relay.hh"1927 13 | 1928 14 | class ClientService final : public nix::remote::NixRemote::Service1929 15 | {1930 16 | public:1931 17 | nixgrpc::ReverseGateway &gateway;1932 18 | nixgrpc::ReverseRegistry ®istry;1933 19 | std::string worker;1934 20 | grpc::Status last;1935 21 | std::optional<nixgrpc::ReverseGateway::Prepared> prepared;1936 | ^1937../tests/reverse-gateway-test.cc:24:5: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]1938 2 | uint64_t assignId = 0;1939 | ^1940../tests/reverse-gateway-test.cc:25:5: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1941 25 | uint32_t buildMode = 0;1942 | ^1943../tests/reverse-gateway-test.cc:30:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]1944 2 | size_t resolverCalls = 0;1945 | ^1946../tests/reverse-gateway-test.cc:33:61: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1947 9 | : gateway(gateway), registry(registry), worker(std::move(worker)) {}1948 | ^1949../tests/reverse-gateway-test.cc:36:60: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1950 11 | grpc::ServerReader<nix::remote::UploadBuildInputsChunk> * reader,1951 | ^1952../tests/reverse-gateway-test.cc:37:41: error: no header providing "nix::remote::AddMultipleReply" is directly included [misc-include-cleaner,-warnings-as-errors]1953 37 | nix::remote::AddMultipleReply *) -> grpc::Status override1954 | ^1955../tests/reverse-gateway-test.cc:37:59: error: all parameters should be named in a function [readability-named-parameter,-warnings-as-errors]1956 37 | nix::remote::AddMultipleReply *) -> grpc::Status override1957 | ^1958 | /*response*/1959../tests/reverse-gateway-test.cc:39:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1960 39 | if (!uploadRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test upload disabled"};1961 | ^ 1962 | {1963../tests/reverse-gateway-test.cc:39:48: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]1964 39 | if (!uploadRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test upload disabled"};1965 | ^1966../tests/reverse-gateway-test.cc:41:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1967 41 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty upload"};1968 | ^ 1969 | {1970../tests/reverse-gateway-test.cc:44:9: error: variable 'relay' of type 'nixgrpc::ReverseUploadRelay' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1971 44 | nixgrpc::ReverseUploadRelay relay(gateway, registry);1972 | ^1973 | const 1974../tests/reverse-gateway-test.cc:45:33: error: an exception may be thrown in function '(lambda at ../tests/reverse-gateway-test.cc:45:33)' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1975 45 | return relay.call(*ctx, [&, drv, assignId](uint64_t id) {1976 | ^1977/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here1978 67 | throw bad_array_new_length();1979 | ^1980/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here1981 101 | std::__throw_bad_array_new_length();1982 | ^1983/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here1984 112 | return {allocate(__n), __n};1985 | ^1986/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least' here1987 280 | return __alloc.allocate_at_least(__n);1988 | ^1989/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least<std::allocator<char>>' here1990 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);1991 | ^1992/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2580:25: note: frame #5: function '__init_copy_ctor_external' calls function '__allocate_at_least<std::allocator<char>>' here1993 2580 | auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);1994 | ^1995/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1007:7: note: frame #6: function 'basic_string' calls function '__init_copy_ctor_external' here1996 1007 | __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());1997 | ^1998../tests/reverse-gateway-test.cc:45:33: note: frame #7: function '(lambda at ../tests/reverse-gateway-test.cc:45:33)' calls function 'basic_string' here1999 45 | return relay.call(*ctx, [&, drv, assignId](uint64_t id) {2000 | ^loading 9,067 hidden lines…
11068 136 | if (!transport.outgoing.acknowledge(id))11069 | ^11070 | {11071 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};11072 | 11073../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11074 145 | if (pending.size() < 4) break;11075 | ^ 11076 | {11077../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11078 147 | for (unsigned i = 0; i != 4; ++i)11079 | ^11080 | {11081 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);11082 | 11083../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11084 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);11085 | ^~~11086../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11087 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);11088 | ^11089../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11090 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};11091 | ^ 11092 | {11093../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11094 153 | if (pending.size() < *expected) break;11095 | ^ 11096 | {11097../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11098 154 | if (!receive(std::string_view(pending).substr(0, *expected)))11099 | ^11100 | {11101 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};11102 | 11103../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11104 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};11105 | ^ 11106 | {11107../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11108 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};11109 | ^ 11110 | {11111../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11112 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};11113 | ^ 11114 | {11115../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11116 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))11117 | ^11118 | {11119 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};11120 | 11121../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11122 169 | ReverseGateway & gateway;11123 | ^11124../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11125 170 | ReverseRegistry & registry;11126 | ^11127../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11128 48 | std::scoped_lock lock(mutex);11129 | ^11130 | const 11131../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11132 53 | auto const id = event->streamId;11133 | ^11134../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11135 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {11136 | ^11137 | -> bool11138../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11139 77 | if (auto it = uploads.find(id); it != uploads.end())11140 | ^11141../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11142 77 | if (auto it = uploads.find(id); it != uploads.end())11143 | ^11144 | {11145 78 | return it->second->feed(frame.data().data());11146 | 11147../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11148 86 | for (unsigned i = 0; i != 4; ++i)11149 | ^11150 | {11151 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);11152 | 11153../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11154 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);11155 | ^~~11156../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11157 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);11158 | ^11159../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11160 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();11161 | ^11162../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11163 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();11164 | ^ 11165 | {11166../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11167 95 | auto it = requests.find(id);11168 | ^11169../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11170 108 | if (auto it = uploads.find(id); it != uploads.end()) {11171 | ^11172../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11173 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();11174 | ^ 11175 | {11176../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11177 114 | if (ready && ready->id == id) ready.reset();11178 | ^ 11179 | {11180../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11181 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }11182 | ^11183 | const 11184../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11185 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }11186 | ^11187 | const 11188../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11189 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }11190 | ^11191 | const 11192../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11193 130 | std::scoped_lock lock(mutex);11194 | ^11195 | const 11196../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11197 131 | for (auto & [id, pipe] : uploads) pipe->cancel();11198 | ^11199../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11200 131 | for (auto & [id, pipe] : uploads) pipe->cancel();11201 | ^ 11202 | {11203../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11204 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {11205 | ^11206../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11207 142 | std::scoped_lock lock(mutex);11208 | ^11209 | const 11210../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11211 148 | std::scoped_lock lock(mutex);11212 | ^11213 | const 11214../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11215 149 | for (auto & [id, pipe] : uploads) pipe->cancel();11216 | ^11217../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11218 149 | for (auto & [id, pipe] : uploads) pipe->cancel();11219 | ^ 11220 | {11221../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11222 32 | [[nodiscard]] auto open(uint64_t id) -> bool11223 | ^11224../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11225 51 | auto it = streams.find(frame.stream_id());11226 | ^11227../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11228 56 | if (!cancelled.contains(frame.stream_id())) return false;11229 | ^ 11230 | {11231../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11232 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;11233 | ^ 11234 | {11235../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11236 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool11237 | ^11238../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]11239 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool11240 | ^11241 | const &11242../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11243 104 | auto pending = [&] {11244 | ^11245 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>11246../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]11247 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });11248 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~11249 | std::ranges::find_if queue11250../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11251 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });11252 | ^11253 | -> auto11254../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11255 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });11256 | ^11257 | -> bool11258../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11259 111 | auto it = pending();11260 | ^11261../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11262 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool11263 | ^11264../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11265 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);11266 | ^ 11267 | {11268../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11269 168 | [[nodiscard]] auto finished(uint64_t id) -> bool11270 | ^11271../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11272 171 | auto it = streams.find(id);11273 | ^11274../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11275 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {11276 | ^11277../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11278 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {11279 | ^11280 | -> bool11281../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]11282 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {11283 | ^11284../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11285 33 | if (assigned && !assigned()) return false;11286 | ^ 11287 | {11288../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11289 35 | std::scoped_lock lock(mutex);11290 | ^11291 | const 11292../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11293 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;11294 | ^ 11295 | {11296../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11297 42 | if (!ok) cancel();11298 | ^ 11299 | {11300../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11301 49 | std::scoped_lock lock(mutex);11302 | ^11303 | const 11304../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11305 68 | if (closed) return false;11306 | ^ 11307 | {11308../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11309 79 | if (ended || !chunks.empty()) break;11310 | ^ 11311 | {11312../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11313 80 | cv.wait_for(lock, std::chrono::milliseconds(25));11314 | ^11315../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11316 82 | if (chunks.empty()) return false;11317 | ^ 11318 | {11319../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11320 92 | std::scoped_lock lock(mutex);11321 | ^11322 | const 11323../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11324 103 | cv.wait_for(lock, std::chrono::milliseconds(25));11325 | ^11326../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11327 113 | if (!ended || closed || !chunks.empty()) return false;11328 | ^ 11329 | {11330../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11331 120 | std::scoped_lock lock(mutex);11332 | ^11333 | const 11334../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11335 129 | std::scoped_lock lock(mutex);11336 | ^11337 | const 11338../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]11339 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11340 | ^11341../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning11342 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11343 | ^~~~~~~~~~~11344 | static_cast<const size_t>( )11345../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type11346 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11347 | ^~~~11348 | static_cast<long>( )11349../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11350 49 | if (failed || bytes.empty() || !consume) return fail();11351 | ^ 11352 | {11353../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors]11354 53 | buffer.append(bytes.data(), count);11355 | ~~~~~~^~~~11356../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11357 57 | for (unsigned i = 0; i < 4; ++i)11358 | ^11359 | {11360 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11361 | 11362../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11363 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11364 | ^~~11365../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11366 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11367 | ^11368../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11369 59 | if (length == 0 || length > maxChunkBytes) return fail();11370 | ^ 11371 | {11372../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11373 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))11374 | ^11375../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11376 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))11377 | ^11378 | {11379 66 | return fail();11380 | 11381../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]11382 327 | char extra;11383 | ^ 11384 | = 011385../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11386 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");11387 | ^ 11388 | {11389../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11390 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");11391 | ^ 11392 | {11393../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11394 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");11395 | ^ 11396 | {11397../tests/reverse-request-test.cc:11:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]11398 11 | int main()11399 | ^11400/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here11401 67 | throw bad_array_new_length();11402 | ^11403/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here11404 101 | std::__throw_bad_array_new_length();11405 | ^11406/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here11407 112 | return {allocate(__n), __n};11408 | ^11409/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least' here11410 280 | return __alloc.allocate_at_least(__n);11411 | ^11412/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least<std::allocator<char>>' here11413 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);11414 | ^11415/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2603:25: note: frame #5: function '__init' calls function '__allocate_at_least<std::allocator<char>>' here11416 2603 | auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__n) + 1);11417 | ^11418/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1090:97: note: frame #6: function 'basic_string' calls function '__init' here11419 1090 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c) { __init(__n, __c); }11420 | ^11421../src/daemon/reverse-capability.hh:43:21: note: frame #7: function 'newKey' calls function 'basic_string' here11422 43 | std::string key(keyBytes, '\0');11423 | ^11424../tests/reverse-request-test.cc:13:16: note: frame #8: function 'main' calls function 'newKey' here11425 13 | auto key = nixgrpc::ReverseCapability::newKey();11426 | ^11427../tests/reverse-request-test.cc:11:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]11428 11 | int main()11429 | ~~~ ^ 11430 | auto -> int11431../tests/reverse-request-test.cc:13:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11432 9 | #include "reverse-request.hh"11433 10 | 11434 11 | int main()11435 12 | {11436 13 | auto key = nixgrpc::ReverseCapability::newKey();11437 | ^11438../tests/reverse-request-test.cc:16:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11439 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write,11440 | ^11441 | const 11442../tests/reverse-request-test.cc:16:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]11443 8 | #include "pump.hh"11444 9 | #include "reverse-request.hh"11445 10 | 11446 11 | int main()11447 12 | {11448 13 | auto key = nixgrpc::ReverseCapability::newKey();11449 14 | assert(key);11450 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";11451 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write,11452 | ^11453../tests/reverse-request-test.cc:16:68: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]11454 8 | #include "pump.hh"11455 9 | #include "reverse-request.hh"11456 10 | 11457 11 | int main()11458 12 | {11459 13 | auto key = nixgrpc::ReverseCapability::newKey();11460 14 | assert(key);11461 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";11462 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write,11463 | ^11464../tests/reverse-request-test.cc:18:114: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11465 18 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "BuildDerivation", writer, "assigned.drv", 42, 0);11466 | ^11467../tests/reverse-request-test.cc:21:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11468 8 | #include "pump.hh"11469 9 | #include "reverse-request.hh"11470 10 | 11471 11 | int main()11472 12 | {11473 13 | auto key = nixgrpc::ReverseCapability::newKey();11474 14 | assert(key);11475 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";11476 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write,11477 17 | .kind = nixgrpc::Caller::Kind::named};11478 18 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "BuildDerivation", writer, "assigned.drv", 42, 0);11479 19 | assert(token);11480 20 | nixgrpc::ReverseRequest requests(worker, 1, *key);11481 21 | nix::remote::ReverseFarmMsg frame;11482 | ^11483../tests/reverse-request-test.cc:26:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]11484 26 | nix::remote::BuildDerivationRequest build;11485 | ^11486../tests/reverse-request-test.cc:28:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11487 28 | build.set_assign_id(42);11488 | ^11489../tests/reverse-request-test.cc:40:27: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11490 40 | decoded.set_assign_id(43);11491 | ^11492../tests/reverse-request-test.cc:44:113: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11493 44 | auto next = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42, 0);11494 | ^11495../tests/reverse-request-test.cc:91:81: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11496 91 | writer, "assigned.drv", 42);11497 | ^11498../tests/reverse-request-test.cc:93:54: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11499 93 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) {11500 | ^11501 | -> bool11502../tests/reverse-request-test.cc:93:79: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]11503 2 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) {11504 | ^11505../tests/reverse-request-test.cc:93:88: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11506 93 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) {11507 | ^11508../tests/reverse-request-test.cc:94:47: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11509 94 | return drv == "assigned.drv" && id == 42;11510 | ^11511../tests/reverse-request-test.cc:103:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]11512 103 | nix::remote::UploadBuildInputsChunk header;11513 | ^11514../tests/reverse-request-test.cc:105:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11515 105 | header.set_assign_id(42);11516 | ^11517../tests/reverse-request-test.cc:109:37: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]11518 109 | auto const length = static_cast<uint32_t>(bytes.size());11519 | ^11520../tests/reverse-request-test.cc:110:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11521 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11522 | ^ 11523 | {11524../tests/reverse-request-test.cc:110:83: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11525 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11526 | ^11527../tests/reverse-request-test.cc:110:93: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11528 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11529 | ^11530../tests/reverse-request-test.cc:124:54: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11531 124 | nixgrpc::ReverseRequest aborted(worker, 1, *key, [](std::string_view, uint64_t) { return true; });11532 | ^11533 | -> bool11534../tests/reverse-request-test.cc:133:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11535 133 | std::jthread reader([&] {11536 | ^11537 | -> void11538../tests/reverse-request-test.cc:142:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11539 142 | nixgrpc::ReverseRequest malformed(worker, 1, *key, [](std::string_view, uint64_t) { return true; });11540 | ^11541 | -> bool11542../tests/reverse-request-test.cc:152:14: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11543 10 | nixgrpc::ReverseUploadPipe pressured(upload->delegated);11544 | ^11545../tests/reverse-request-test.cc:153:17: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]11546 2 | std::atomic<size_t> consumed{0};11547 | ^11548../tests/reverse-request-test.cc:154:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11549 154 | std::jthread consumer([&] {11550 | ^11551 | -> void11552../tests/reverse-request-test.cc:163:53: error: 96 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11553 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x'));11554 | ^11555../tests/reverse-request-test.cc:163:53: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]11556../tests/reverse-request-test.cc:163:53: note: make conversion explicit to silence this warning11557 2 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x'));11558 | ^~~~~~~~~11559 | static_cast<size_type>( )11560../tests/reverse-request-test.cc:163:53: note: perform multiplication in a wider type11561 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x'));11562 | ^~11563 | static_cast<long>( )11564../tests/reverse-request-test.cc:163:58: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11565 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x'));11566 | ^11567../tests/reverse-request-test.cc:167:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11568 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast<char>((nextSize >> (8 * i)) & 0xff));11569 | ^ 11570 | {11571../tests/reverse-request-test.cc:167:91: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11572 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast<char>((nextSize >> (8 * i)) & 0xff));11573 | ^11574../tests/reverse-request-test.cc:167:101: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11575 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast<char>((nextSize >> (8 * i)) & 0xff));11576 | ^11577../tests/reverse-request-test.cc:169:17: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors]11578 169 | for (size_t n = 0; n < 48; ++n) {11579 | ^11580../tests/reverse-request-test.cc:169:28: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11581 169 | for (size_t n = 0; n < 48; ++n) {11582 | ^11583../tests/reverse-request-test.cc:170:80: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]11584 9 | for (size_t offset = 0; offset < nextFramed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)11585 | ^11586../tests/reverse-request-test.cc:170:109: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11587 170 | for (size_t offset = 0; offset < nextFramed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)11588 | ^11589 | {11590 171 | assert(pressured.feed(std::string_view(nextFramed).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes)));11591 | 11592../tests/reverse-request-test.cc:192:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11593 192 | std::jthread producer([&] {11594 | ^11595 | -> void11596../tests/reverse-request-test.cc:193:21: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors]11597 193 | for (size_t n = 0; n < 1000; ++n)11598 | ^11599../tests/reverse-request-test.cc:193:32: error: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11600 193 | for (size_t n = 0; n < 1000; ++n)11601 | ^11602../tests/reverse-request-test.cc:193:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11603 193 | for (size_t n = 0; n < 1000; ++n)11604 | ^11605 | {11606 194 | if (!interrupted.feed(nextFramed)) { exited = true; return; }11607 | 11608../tests/reverse-request-test.cc:203:17: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors]11609 203 | for (size_t n = 0; n < 100; ++n) {11610 | ^11611../tests/reverse-request-test.cc:203:28: error: 100 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11612 203 | for (size_t n = 0; n < 100; ++n) {11613 | ^11614../tests/reverse-request-test.cc:213:26: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11615 213 | header.set_assign_id(43);11616 | ^11617../tests/reverse-request-test.cc:217:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11618 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((wrongSize >> (8 * i)) & 0xff));11619 | ^ 11620 | {11621../tests/reverse-request-test.cc:217:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11622 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((wrongSize >> (8 * i)) & 0xff));11623 | ^11624../tests/reverse-request-test.cc:217:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11625 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((wrongSize >> (8 * i)) & 0xff));11626 | ^11627../tests/reverse-request-test.cc:222:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11628 222 | header.set_assign_id(42);11629 | ^11630../tests/reverse-request-test.cc:227:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11631 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((unsignedSize >> (8 * i)) & 0xff));11632 | ^ 11633 | {11634../tests/reverse-request-test.cc:227:96: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11635 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((unsignedSize >> (8 * i)) & 0xff));11636 | ^11637../tests/reverse-request-test.cc:227:106: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11638 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast<char>((unsignedSize >> (8 * i)) & 0xff));11639 | ^11640../tests/reverse-request-test.cc:231:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11641 231 | nixgrpc::ReverseRequest stale(worker, 1, *key, [](std::string_view, uint64_t) { return false; });11642 | ^11643 | -> bool11644../tests/reverse-request-test.cc:238:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11645 238 | nixgrpc::ReverseUploadPipe revoked(upload->delegated, [&] { return expected.load(); });11646 | ^11647 | -> bool11648../tests/reverse-request-test.cc:243:71: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11649 243 | nixgrpc::ReverseUploadPipe revokedWhileReading(upload->delegated, [&] { return readingLive.load(); });11650 | ^11651 | -> bool11652../tests/reverse-request-test.cc:244:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11653 244 | std::jthread waiting([&] {11654 | ^11655 | -> void11656../tests/reverse-request-test.cc:256:23: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11657 256 | std::string plain(5 * 1024 * 1024, 'a');11658 | ^11659../tests/reverse-request-test.cc:256:23: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]11660../tests/reverse-request-test.cc:256:23: note: make conversion explicit to silence this warning11661 256 | std::string plain(5 * 1024 * 1024, 'a');11662 | ^~~~~~~~~~~~~~~11663 | static_cast<size_type>( )11664../tests/reverse-request-test.cc:256:23: note: perform multiplication in a wider type11665 256 | std::string plain(5 * 1024 * 1024, 'a');11666 | ^~~~~~~~11667 | static_cast<long>( )11668../tests/reverse-request-test.cc:256:27: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11669 256 | std::string plain(5 * 1024 * 1024, 'a');11670 | ^11671../tests/reverse-request-test.cc:256:34: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11672 256 | std::string plain(5 * 1024 * 1024, 'a');11673 | ^11674../tests/reverse-request-test.cc:266:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11675 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((dataSize >> (8 * i)) & 0xff));11676 | ^ 11677 | {11678../tests/reverse-request-test.cc:266:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11679 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((dataSize >> (8 * i)) & 0xff));11680 | ^11681../tests/reverse-request-test.cc:266:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11682 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((dataSize >> (8 * i)) & 0xff));11683 | ^11684../tests/reverse-request-test.cc:268:101: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11685 268 | for (size_t offset = 0; offset < framed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)11686 | ^11687 | {11688 269 | assert(compressed.feed(std::string_view(framed).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes)));11689 | 11690../tests/reverse-request-test.cc:274:26: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11691 6 | compressed, std::move(*firstCompressed.mutable_data()));11692 | ^11693../tests/reverse-request-test.cc:282:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11694 282 | auto checkInvalidFrame = [&](std::string badCompressed) {11695 | ^11696 | -> void11697../tests/reverse-request-test.cc:290:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11698 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11699 | ^ 11700 | {11701../tests/reverse-request-test.cc:290:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11702 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11703 | ^11704../tests/reverse-request-test.cc:290:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11705 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11706 | ^11707../tests/reverse-request-test.cc:292:109: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11708 292 | for (size_t offset = 0; offset < framedPart.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)11709 | ^11710 | {11711 293 | assert(bad.feed(std::string_view(framedPart).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes)));11712 | 11713../tests/reverse-request-test.cc:306:27: error: no header providing "nix::Error" is directly included [misc-include-cleaner,-warnings-as-errors]11714 2 | catch (const nix::Error &) { rejected = true; }11715 | ^11716>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/4/scratch/4342aa3e17441242/build/source/build /private/var/tb/4/scratch/4342aa3e17441242/build/source/src/daemon/main.cc11717../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]11718 12 | #include <chrono>11719 | 11720 13 | #include <chrono>11721 | ^~~~~~~~~~~~~~~~~11722../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]11723 90 | std::chrono::system_clock::time_point credentialExpiresAt{};11724 | ^~11725../src/daemon/main.cc:354:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11726 354 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) {11727 | ^11728 | -> bool11729../src/daemon/main.cc:367:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]11730 15 | const std::function<bool()> & cancelled,11731 | ^11732../src/daemon/main.cc:378:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11733 378 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status;11734 | ^ 11735 | {11736../src/daemon/main.cc:382:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11737 382 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"};11738 | ^ 11739 | {11740../src/daemon/main.cc:383:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11741 383 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"};11742 | ^ 11743 | {11744../src/daemon/main.cc:384:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11745 384 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"};11746 | ^ 11747 | {11748../src/daemon/main.cc:387:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11749 387 | nix::StorePath drvPath(request.drv_path());11750 | ^11751 | const 11752../src/daemon/main.cc:391:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11753 391 | auto const sendLog = [&](nixgrpc::BuildEvent event) {11754 | ^11755 | -> void11756../src/daemon/main.cc:392:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11757 392 | if (!emit(nixgrpc::toChunk<nix::remote::BuildDerivationChunk>(std::move(event))))11758 | ^11759 | {11760 393 | throw nixgrpc::CancelledWait("reverse build response closed");11761 | 11762../src/daemon/main.cc:401:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11763 401 | auto const retireUnacknowledged = [&] {11764 | ^11765 | -> void11766../src/daemon/main.cc:402:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11767 402 | if (afterFinish) std::exchange(afterFinish, nullptr)();11768 | ^ 11769 | {11770../src/daemon/main.cc:414:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11771 414 | if (status.ok() && !emit(chunk))11772 | ^11773 | {11774 415 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"};11775 | 11776../src/daemon/main.cc:416:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11777 416 | if (!status.ok()) retireUnacknowledged();11778 | ^ 11779 | {11780../src/daemon/main.cc:421:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11781 421 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call,11782 | ^11783../src/daemon/main.cc:424:24: note: nesting level increased to 111784 424 | return guarded([&] -> grpc::Status {11785 | ^11786../src/daemon/main.cc:425:13: note: +2, including nesting penalty of 1, nesting level increased to 211787 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11788 | ^11789../src/daemon/main.cc:425:32: note: +111790 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11791 | ^11792../src/daemon/main.cc:428:13: note: +2, including nesting penalty of 1, nesting level increased to 211793 428 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs",11794 | ^11795../src/daemon/main.cc:430:31: note: nesting level increased to 211796 430 | auto const live = [&] {11797 | ^11798../src/daemon/main.cc:432:21: note: +111799 432 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId);11800 | ^11801../src/daemon/main.cc:434:13: note: +2, including nesting penalty of 1, nesting level increased to 211802 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11803 | ^11804../src/daemon/main.cc:436:13: note: +2, including nesting penalty of 1, nesting level increased to 211805 436 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first)11806 | ^11807../src/daemon/main.cc:437:17: note: +111808 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11809 | ^11810../src/daemon/main.cc:438:48: note: +2, including nesting penalty of 1, nesting level increased to 211811 438 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair;11812 | ^11813../src/daemon/main.cc:439:55: note: +2, including nesting penalty of 1, nesting level increased to 211814 439 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs;11815 | ^11816../src/daemon/main.cc:458:17: note: nesting level increased to 211817 458 | CheckedSource(nix::Source & inner, std::function<bool()> valid)11818 | ^11819../src/daemon/main.cc:464:17: note: nesting level increased to 211820 464 | auto read(char * data, size_t length) -> size_t override {11821 | ^11822../src/daemon/main.cc:465:21: note: +3, including nesting penalty of 2, nesting level increased to 311823 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11824 | ^11825../src/daemon/main.cc:471:21: note: +3, including nesting penalty of 2, nesting level increased to 311826 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11827 | ^11828../src/daemon/main.cc:449:19: note: nesting level increased to 211829 449 | class CheckedSource : public nix::Source {11830 | ^11831../src/daemon/main.cc:449:19: note: nesting level increased to 211832../src/daemon/main.cc:449:19: note: nesting level increased to 211833../src/daemon/main.cc:449:19: note: nesting level increased to 211834../src/daemon/main.cc:449:19: note: nesting level increased to 211835../src/daemon/main.cc:483:68: note: +2, including nesting penalty of 1, nesting level increased to 211836 483 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair,11837 | ^11838../src/daemon/main.cc:484:68: note: +2, including nesting penalty of 1, nesting level increased to 211839 484 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs,11840 | ^11841../src/daemon/main.cc:485:17: note: nesting level increased to 211842 485 | [&] { return !live(); }, imported,11843 | ^11844../src/daemon/main.cc:486:17: note: nesting level increased to 211845 486 | [&] {11846 | ^11847../src/daemon/main.cc:493:21: note: +3, including nesting penalty of 2, nesting level increased to 311848 493 | if (!call.pipe->endWithoutTrailingData() || !live())11849 | ^11850../src/daemon/main.cc:493:62: note: +111851 493 | if (!call.pipe->endWithoutTrailingData() || !live())11852 | ^11853../src/daemon/main.cc:497:56: note: nesting level increased to 211854 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11855 | ^11856../src/daemon/main.cc:498:13: note: +2, including nesting penalty of 1, nesting level increased to 211857 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11858 | ^11859../src/daemon/main.cc:425:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11860 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11861 | ^11862../src/daemon/main.cc:426:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11863 426 | call.delegated.drvPath, call.delegated.assignId))11864 | ^11865 | {11866 427 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};11867 | 11868../src/daemon/main.cc:429:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11869 429 | nixgrpc::Role::write); !status.ok()) return status;11870 | ^ 11871 | {11872../src/daemon/main.cc:430:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11873 430 | auto const live = [&] {11874 | ^11875 | -> bool11876../src/daemon/main.cc:434:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11877 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11878 | ^ 11879 | {11880../src/daemon/main.cc:437:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11881 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11882 | ^ 11883 | {11884../src/daemon/main.cc:441:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11885 89 | nixgrpc::ZstdReaderSource<nixgrpc::ReverseUploadPipe, nix::remote::AddMultipleChunk> source(11886 | ^11887../src/daemon/main.cc:450:31: error: member 'inner' of type 'nix::Source &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11888 450 | nix::Source & inner;11889 | ^11890../src/daemon/main.cc:465:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11891 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11892 | ^ 11893 | {11894../src/daemon/main.cc:471:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11895 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11896 | ^ 11897 | {11898../src/daemon/main.cc:485:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11899 485 | [&] { return !live(); }, imported,11900 | ^11901 | -> bool11902../src/daemon/main.cc:486:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11903 486 | [&] {11904 | ^11905 | -> void11906../src/daemon/main.cc:493:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11907 493 | if (!call.pipe->endWithoutTrailingData() || !live())11908 | ^11909 | {11910 494 | throw nix::Error("reverse upload incomplete or assignment changed");11911 | 11912../src/daemon/main.cc:497:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11913 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11914 | ^11915 | -> bool11916../src/daemon/main.cc:498:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11917 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11918 | ^ 11919 | {11920../src/daemon/main.cc:641:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11921 641 | if (beforeApply) beforeApply();11922 | ^ 11923 | {11924../src/daemon/main.cc:650:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11925 650 | if (beforeApply) beforeApply();11926 | ^ 11927 | {11928../src/daemon/main.cc:652:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11929 652 | if (beforeApply) beforeApply();11930 | ^ 11931 | {11932../src/daemon/main.cc:716:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11933 716 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder)11934 | ^11935 | {11936 717 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"};11937 | 11938../src/daemon/main.cc:719:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11939 719 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"};11940 | ^ 11941 | {11942../src/daemon/main.cc:722:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors]11943 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk()11944 | ^11945../src/daemon/main.cc:723:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11946 723 | || drv.empty() || assignment == 0)11947 | ^11948 | {11949 724 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"};11950 | 11951../src/daemon/main.cc:726:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11952 726 | if (caller.kind != nixgrpc::Caller::Kind::named)11953 | ^11954 | {11955 727 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"};11956 | 11957../src/daemon/main.cc:729:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11958 729 | !status.ok()) return status;11959 | ^ 11960 | {11961../src/daemon/main.cc:731:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11962 731 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"};11963 | ^ 11964 | {11965../src/daemon/main.cc:732:35: error: an exception may be thrown in function '(lambda at ../src/daemon/main.cc:732:35)' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]11966 732 | auto const assigned = [this, pod = *pod, drv, assignment] {11967 | ^11968/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here11969 67 | throw bad_array_new_length();11970 | ^11971/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here11972 101 | std::__throw_bad_array_new_length();11973 | ^11974/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here11975 112 | return {allocate(__n), __n};11976 | ^11977/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least' here11978 280 | return __alloc.allocate_at_least(__n);11979 | ^11980/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least<std::allocator<char>>' here11981 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);11982 | ^11983/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2580:25: note: frame #5: function '__init_copy_ctor_external' calls function '__allocate_at_least<std::allocator<char>>' here11984 2580 | auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);11985 | ^11986/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1007:7: note: frame #6: function 'basic_string' calls function '__init_copy_ctor_external' here11987 1007 | __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());11988 | ^11989../src/daemon/main.cc:732:35: note: frame #7: function '(lambda at ../src/daemon/main.cc:732:35)' calls function 'basic_string' here11990 732 | auto const assigned = [this, pod = *pod, drv, assignment] {11991 | ^11992../src/daemon/main.cc:732:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11993 732 | auto const assigned = [this, pod = *pod, drv, assignment] {11994 | ^11995 | -> bool11996../src/daemon/main.cc:736:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11997 736 | [&](uint64_t id) {11998 | ^11999 | -> Result12000../src/daemon/main.cc:736:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12001 736 | [&](uint64_t id) {12002 | ^12003../src/daemon/main.cc:738:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12004 738 | [this](std::string_view path, uint64_t assignId) {12005 | ^12006 | -> std::optional<std::string>12007../src/daemon/main.cc:741:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12008 741 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); },12009 | ^12010 | -> bool12011../src/daemon/main.cc:1011:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12012 1011 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"};12013 | ^ 12014 | {12015../src/daemon/main.cc:1108:37: error: implicit conversion 'std::string *' (aka 'basic_string<char> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12016 1108 | if (!missing.empty() && missingInput) {12017 | ^ 12018 | ( != nullptr)12019../src/daemon/main.cc:1167:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12020 1167 | auto BuildDerivation(12021 | ^12022../src/daemon/main.cc:1172:24: note: nesting level increased to 112023 1172 | return guarded([&] -> grpc::Status {12024 | ^12025../src/daemon/main.cc:1176:13: note: +2, including nesting penalty of 1, nesting level increased to 212026 1176 | if (request->protocol() != nixcompat::kBuildProtocolWire12027 | ^12028../src/daemon/main.cc:1177:17: note: +112029 1177 | || request->build_mode() > static_cast<uint32_t>(nix::bmCheck)) {12030 | ^12031../src/daemon/main.cc:1184:17: note: +2, including nesting penalty of 1, nesting level increased to 212032 1184 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt;12033 | ^12034../src/daemon/main.cc:1183:51: note: +112035 1183 | auto const selectedPod = reverseRelay && coord.dispatcher12036 | ^12037../src/daemon/main.cc:1185:13: note: +2, including nesting penalty of 1, nesting level increased to 212038 1185 | if (selectedPod) {12039 | ^12040../src/daemon/main.cc:1188:21: note: nesting level increased to 312041 1188 | [&](uint64_t id) {12042 | ^12043../src/daemon/main.cc:1190:29: note: nesting level increased to 412044 1190 | [this](std::string_view drv, uint64_t assignment) {12045 | ^12046../src/daemon/main.cc:1193:34: note: nesting level increased to 312047 1193 | }, *request, [&](std::string_view wire) {12048 | ^12049../src/daemon/main.cc:1195:25: note: +4, including nesting penalty of 3, nesting level increased to 412050 1195 | if (!chunk.ParseFromArray(wire.data(), static_cast<int>(wire.size()))12051 | ^12052../src/daemon/main.cc:1196:103: note: +112053 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())12054 | ^12055../src/daemon/main.cc:1198:25: note: +4, including nesting penalty of 3, nesting level increased to 412056 1198 | if (!writer->Write(chunk)) return false;12057 | ^12058../src/daemon/main.cc:1199:25: note: +4, including nesting penalty of 3, nesting level increased to 412059 1199 | if (chunk.has_done()) receivedDone = true;12060 | ^12061../src/daemon/main.cc:1201:24: note: nesting level increased to 312062 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),12063 | ^12064../src/daemon/main.cc:1204:24: note: nesting level increased to 312065 1204 | }, [&] { return receivedDone.load(); });12066 | ^12067../src/daemon/main.cc:1206:21: note: +3, including nesting penalty of 2, nesting level increased to 312068 1206 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status;12069 | ^12070../src/daemon/main.cc:1205:36: note: +112071 1205 | return status.ok() && !receivedDone.load()12072 | ^12073../src/daemon/main.cc:1212:13: note: +2, including nesting penalty of 1, nesting level increased to 212074 1212 | if (!coord.builder) {12075 | ^12076../src/daemon/main.cc:1217:38: note: nesting level increased to 212077 1217 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void {12078 | ^12079../src/daemon/main.cc:1231:13: note: +2, including nesting penalty of 1, nesting level increased to 212080 1231 | for (auto & [name, path] : staticOutputs(*localStore, drv)) {12081 | ^12082../src/daemon/main.cc:1239:13: note: +2, including nesting penalty of 1, nesting level increased to 212083 1239 | if (auto const status =12084 | ^12085../src/daemon/main.cc:1240:27: note: nesting level increased to 212086 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,12087 | ^12088../src/daemon/main.cc:1243:17: note: +3, including nesting penalty of 2, nesting level increased to 312089 1243 | if (!missingInput.empty()) {12090 | ^12091../src/daemon/main.cc:1188:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12092 1188 | [&](uint64_t id) {12093 | ^12094 | -> Result12095../src/daemon/main.cc:1188:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12096 1188 | [&](uint64_t id) {12097 | ^12098../src/daemon/main.cc:1190:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12099 1190 | [this](std::string_view drv, uint64_t assignment) {12100 | ^12101 | -> std::optional<std::string>12102../src/daemon/main.cc:1193:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12103 1193 | }, *request, [&](std::string_view wire) {12104 | ^12105 | -> bool12106../src/daemon/main.cc:1196:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12107 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())12108 | ^12109 | {12110 1197 | return false;12111 | 12112../src/daemon/main.cc:1198:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12113 1198 | if (!writer->Write(chunk)) return false;12114 | ^ 12115 | {12116../src/daemon/main.cc:1199:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12117 1199 | if (chunk.has_done()) receivedDone = true;12118 | ^ 12119 | {12120../src/daemon/main.cc:1201:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12121 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),12122 | ^12123 1202 | pod = *selectedPod] {12124 | -> bool12125../src/daemon/main.cc:1204:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12126 1204 | }, [&] { return receivedDone.load(); });12127 | ^12128 | -> bool12129../src/daemon/main.cc:1240:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12130 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,12131 | ^12132 | -> bool12133../src/daemon/main.cc:1498:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12134 1498 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) {12135 | ^12136 | -> auto12137../src/daemon/main.cc:1501:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12138 1501 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) {12139 | ^12140 | -> auto12141../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12142 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result12143 | ^12144../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 112145 522 | if (!parsed) {12146 | ^12147../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 112148 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : "";12149 | ^12150../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 112151 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) {12152 | ^12153../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 212154 528 | if (provider.issuer != iss) {12155 | ^12156../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 212157 531 | if (!parsed->has_expires_at()) {12158 | ^12159../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 212160 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) {12161 | ^12162../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 312163 538 | if (!err) {12164 | ^12165../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 212166 542 | if (err) {12167 | ^12168../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 212169 547 | if (sub.empty() || sub.contains('\0')) {12170 | ^12171../src/daemon/oidc.hh:547:29: note: +112172 547 | if (sub.empty() || sub.contains('\0')) {12173 | ^12174../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 212175 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace");12176 | ^12177../src/daemon/oidc.hh:553:32: note: +112178 553 | namespaceClaim && namespaceClaim->is_string()) {12179 | ^12180../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 212181 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12182 | ^12183../src/daemon/oidc.hh:556:82: note: +112184 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12185 | ^12186../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 312187 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12188 | ^12189../src/daemon/oidc.hh:557:67: note: +112190 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12191 | ^12192../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 312193 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12194 | ^12195../src/daemon/oidc.hh:560:66: note: +112196 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12197 | ^12198../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 212199 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12200 | ^12201../src/daemon/oidc.hh:564:91: note: +112202 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12203 | ^12204../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 312205 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12206 | ^12207../src/daemon/oidc.hh:565:65: note: +112208 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12209 | ^12210../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 212211 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) {12212 | ^12213../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 312214 570 | if (aud->is_string()) {12215 | ^12216../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 312217 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {12218 | ^12219../src/daemon/oidc.hh:572:64: note: +112220 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {12221 | ^12222../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 212223 577 | if (parsed->has_issued_at()) {12224 | ^12225../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 212226 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"};12227 | ^12228../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12229 553 | namespaceClaim && namespaceClaim->is_string()) {12230 | ^12231 | ( != nullptr)12232../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12233 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12234 | ^12235 | ( != nullptr)12236../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12237 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12238 | ^12239../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12240 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12241 | ^12242../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12243 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12244 | ^12245../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12246 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12247 | ^12248 | ( != nullptr)12249../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12250 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12251 | ^12252../src/daemon/options.hh:45:50: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12253 45 | std::chrono::seconds reverseMaxTokenLifetime{600};12254 | ^12255../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12256 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)12257 | ^12258../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12259 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||12260 | ^12261../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12262 96 | result.push_back(static_cast<char>(size >> (i * 8)));12263 | ^12264../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]12265 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12266 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12267../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'12268 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12269 | ^~~~~12270../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'12271 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12272 | ^~~~~~~~12273../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]12274 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);12275 | ^~~12276../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12277 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);12278 | ^12279../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]12280 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)12281 | ^12282../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]12283 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)12284 | ^12285../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12286 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||12287 | ^12288../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12289 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;12290 | ^ 12291 | {12292../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors]12293 250 | unsigned char mac[EVP_MAX_MD_SIZE];12294 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12295../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12296 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),12297 | ~^12298 | (12299 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12300 | == nullptr)12301../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12302 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12303 | ^12304../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]12305 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12306 | ^12307../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12308 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);12309 | ^12310../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]12311 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12312 | ^12313../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning12314 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12315 | ^~~~~~~~~12316 | static_cast<const size_t>( )12317../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type12318 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12319 | ^~12320 | static_cast<long>( )12321../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]12322 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12323 | ^12324../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning12325 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12326 | ^~~~~~~~~~~~~~~12327 | static_cast<const size_t>( )12328../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type12329 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12330 | ^~~~~~~~12331 | static_cast<long>( )12332../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12333 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool12334 | ^12335../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12336 53 | auto data(uint64_t id, std::string_view bytes) -> bool12337 | ^12338../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12339 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);12340 | ^12341../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12342 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool12343 | ^12344../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]12345 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool12346 | ^12347 | const &12348../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12349 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;12350 | ^ 12351 | {12352../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12353 81 | if (size > limit) return false;12354 | ^ 12355 | {12356../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12357 83 | cv.wait(lock, stop, [&] {12358 | ^12359 | -> bool12360../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12361 84 | auto it = streams.find(id);12362 | ^12363../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12364 87 | auto const it = streams.find(id);12365 | ^12366../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12367 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;12368 | ^ 12369 | {12370../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12371 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }12372 | ^12373../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12374 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }12375 | ^12376../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12377 96 | auto acknowledge(uint64_t id) -> bool12378 | ^12379../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12380 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;12381 | ^ 12382 | {12383../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12384 105 | if (!enqueue(std::move(msg))) return false;12385 | ^ 12386 | {12387../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]12388 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool12389 | ^12390 | const &12391../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12392 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });12393 | ^12394 | -> bool12395../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12396 145 | auto finished(uint64_t id) -> bool12397 | ^12398../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12399 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;12400 | ^ 12401 | {12402../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12403 150 | if (removed) cv.notify_all();12404 | ^ 12405 | {12406../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12407 156 | void acknowledgementSent(uint64_t id)12408 | ^12409../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12410 159 | if (acknowledged.erase(id)) streams.erase(id);12411 | ^ 12412 | != 0u12413../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12414 159 | if (acknowledged.erase(id)) streams.erase(id);12415 | ^ 12416 | {12417../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12418 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {12419 | ^12420../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12421 208 | auto terminal(uint64_t id, bool abort) -> bool12422 | ^12423../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12424 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12425 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12426 | .status= .prepared=12427../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12428 41 | struct Result12429 | ^12430../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]12431 65 | Role minRole;12432 | ^12433../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12434 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};12435 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12436 | .status= .prepared=12437../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12438 41 | struct Result12439 | ^12440../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12441 85 | return {status, {}};12442 | ^~~~~~~~~~~~12443 | .status=.prepared=12444../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12445 41 | struct Result12446 | ^12447../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12448 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};12449 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12450 | .status= .prepared=12451../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12452 41 | struct Result12453 | ^12454../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12455 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};12456 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12457 | .status= .prepared=12458../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12459 41 | struct Result12460 | ^12461../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12462 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};12463 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12464 | .status= .prepared=12465../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12466 41 | struct Result12467 | ^12468../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12469 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};12470 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12471 | .status= .prepared=12472../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12473 41 | struct Result12474 | ^12475../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12476 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};12477 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12478 | .status= .prepared=12479../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12480 41 | struct Result12481 | ^12482../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12483 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};12484 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12485 | .status= .prepared=12486../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12487 41 | struct Result12488 | ^12489../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12490 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),12491 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12492 | .status= .prepared=12493 123 | std::string(drvPath), assignId}};12494 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12495../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12496 41 | struct Result12497 | ^12498../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]12499 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),12500 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12501 | .session= .open=12502 123 | std::string(drvPath), assignId}};12503 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12504 | .drvPath= .assignId=12505../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here12506 33 | struct Prepared12507 | ^12508../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12509 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12510 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12511 | .status= .prepared=12512../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12513 41 | struct Result12514 | ^12515../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12516 189 | return {status, {}};12517 | ^~~~~~~~~~~~12518 | .status=.prepared=12519../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12520 41 | struct Result12521 | ^12522../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12523 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};12524 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12525 | .status= .prepared=12526../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12527 41 | struct Result12528 | ^12529../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12530 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};12531 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12532 | .status= .prepared=12533../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12534 41 | struct Result12535 | ^12536../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12537 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};12538 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12539 | .status= .prepared=12540../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12541 41 | struct Result12542 | ^12543../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12544 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12545 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12546 | .status= .prepared=12547../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12548 41 | struct Result12549 | ^12550../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12551 218 | return {status, {}};12552 | ^~~~~~~~~~~~12553 | .status=.prepared=12554../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12555 41 | struct Result12556 | ^12557../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12558 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};12559 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12560 | .status= .prepared=12561../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12562 41 | struct Result12563 | ^12564../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12565 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};12566 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12567 | .status= .prepared=12568../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12569 41 | struct Result12570 | ^12571../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]12572 233 | Auth &auth;12573 | ^12574../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]12575 234 | ReverseRegistry ®istry;12576 | ^12577../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12578 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional<Event>12579 | ^12580../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 112581 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12582 | ^12583../src/daemon/reverse-inbound.hh:45:79: note: +112584 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12585 | ^12586../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 212587 47 | rejection = closed ? "session closed" : "bad frame header";12588 | ^12589../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 112590 51 | if (frame.has_open())12591 | ^12592../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 212593 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12594 | ^12595../src/daemon/reverse-inbound.hh:53:30: note: +112596 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12597 | ^12598../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 312599 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams";12600 | ^12601../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212602 59 | if (!caller)12603 | ^12604../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 112605 69 | if (it == streams.end())12606 | ^12607../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212608 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()12609 | ^12610../src/daemon/reverse-inbound.hh:74:17: note: +112611 74 | && finishedIds.erase(id))12612 | ^12613../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112614 79 | if (frame.has_data())12615 | ^12616../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212617 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12618 | ^12619../src/daemon/reverse-inbound.hh:81:59: note: +112620 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12621 | ^12622../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 112623 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12624 | ^12625../src/daemon/reverse-inbound.hh:88:97: note: +112626 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12627 | ^12628../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112629 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12630 | ^12631../src/daemon/reverse-inbound.hh:93:72: note: +112632 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12633 | ^12634../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 212635 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; }12636 | ^12637../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12638 50 | auto const id = frame.stream_id();12639 | ^12640../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12641 68 | auto it = streams.find(id);12642 | ^12643../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12644 74 | && finishedIds.erase(id))12645 | ^ 12646 | ( != 0u)12647../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12648 74 | && finishedIds.erase(id))12649 | ^12650 | {12651 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};12652 | 12653../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12654 109 | auto finished(uint64_t id) -> bool12655 | ^12656../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12657 111 | if (cancelledIds.erase(id)) return true;12658 | ^ 12659 | != 0u12660../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12661 111 | if (cancelledIds.erase(id)) return true;12662 | ^ 12663 | {12664../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12665 112 | if (!streams.erase(id)) return false;12666 | ~^ 12667 | == 0u12668../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12669 112 | if (!streams.erase(id)) return false;12670 | ^ 12671 | {12672../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12673 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {12674 | ^12675../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12676 82 | auto it = sessions.find(std::string(workerId));12677 | ^12678../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12679 92 | auto it = sessions.find(handle->workerId);12680 | ^12681../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12682 107 | auto it = sessions.find(handle->workerId);12683 | ^12684../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12685 130 | for (auto & [id, session] : sessions) {12686 | ^12687../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12688 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select,12689 | ^12690../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 112691 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12692 | ^12693../src/daemon/reverse-relay.hh:49:21: note: +112694 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12695 | ^12696../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 112697 56 | if (!selection.status.ok()) return selection.status;12698 | ^12699../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 112700 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12701 | ^12702../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 112703 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12704 | ^12705../src/daemon/reverse-relay.hh:59:22: note: +112706 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12707 | ^12708../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 112709 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12710 | ^12711../src/daemon/reverse-relay.hh:60:27: note: +112712 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12713 | ^12714../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 112715 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12716 | ^12717../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 112718 64 | if (!selection.status.ok()) return selection.status;12719 | ^12720../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 112721 65 | if (!selection.prepared || selection.prepared->session != session)12722 | ^12723../src/daemon/reverse-relay.hh:65:33: note: +112724 65 | if (!selection.prepared || selection.prepared->session != session)12725 | ^12726../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 112727 67 | if (request.ByteSizeLong() > maxRequestBytes)12728 | ^12729../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 112730 70 | if (bytes.size() > maxRequestBytes)12731 | ^12732../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 112733 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12734 | ^12735../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112736 75 | if (!status.ok()) return status;12737 | ^12738../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 112739 81 | ~Release() {12740 | ^12741../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 212742 84 | if (!completed) (void) transport.outgoing.cancel(id);12743 | ^12744../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 112745 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12746 | ^12747../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 112748 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) {12749 | ^12750../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 212751 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12752 | ^12753../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 212754 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12755 | ^12756../src/daemon/reverse-relay.hh:100:44: note: +112757 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12758 | ^12759../src/daemon/reverse-relay.hh:100:62: note: +112760 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12761 | ^12762../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 212763 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12764 | ^12765../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112766 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12767 | ^12768../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 112769 111 | std::jthread monitor([&](std::stop_token stop) {12770 | ^12771../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 212772 113 | while (!stop.stop_requested()) {12773 | ^12774../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 312775 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)12776 | ^12777../src/daemon/reverse-relay.hh:115:22: note: +112778 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12779 | ^12780../src/daemon/reverse-relay.hh:115:60: note: +112781 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12782 | ^12783../src/daemon/reverse-relay.hh:115:80: note: +112784 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12785 | ^12786../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 312787 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12788 | ^12789../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 112790 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) {12791 | ^12792../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 212793 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12794 | ^12795../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 212796 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12797 | ^12798../src/daemon/reverse-relay.hh:127:44: note: +112799 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12800 | ^12801../src/daemon/reverse-relay.hh:127:82: note: +112802 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12803 | ^12804../src/daemon/reverse-relay.hh:127:102: note: +112805 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12806 | ^12807../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 312808 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12809 | ^12810../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 212811 130 | if (frame.has_finish()) {12812 | ^12813../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 312814 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12815 | ^12816../src/daemon/reverse-relay.hh:131:55: note: +112817 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12818 | ^12819../src/daemon/reverse-relay.hh:131:75: note: +112820 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12821 | ^12822../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 312823 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12824 | ^12825../src/daemon/reverse-relay.hh:133:38: note: +112826 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12827 | ^12828../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 312829 134 | if (resultReceived && resultReceived()) {12830 | ^12831../src/daemon/reverse-relay.hh:134:36: note: +112832 134 | if (resultReceived && resultReceived()) {12833 | ^12834../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 412835 135 | if (beforeAck) beforeAck();12836 | ^12837../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 412838 136 | if (!transport.outgoing.acknowledge(id))12839 | ^12840../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 212841 143 | while (true) {12842 | ^12843../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 312844 144 | if (!expected) {12845 | ^12846../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 412847 145 | if (pending.size() < 4) break;12848 | ^12849../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 412850 147 | for (unsigned i = 0; i != 4; ++i)12851 | ^12852../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 412853 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12854 | ^12855../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 312856 153 | if (pending.size() < *expected) break;12857 | ^12858../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 312859 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12860 | ^12861../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 212862 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12863 | ^12864../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 112865 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12866 | ^12867../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 112868 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12869 | ^12870../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 112871 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12872 | ^12873../src/daemon/reverse-relay.hh:163:47: note: +112874 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12875 | ^12876../src/daemon/reverse-relay.hh:163:67: note: +112877 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12878 | ^12879../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12880 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12881 | ^ 12882 | {12883../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12884 56 | if (!selection.status.ok()) return selection.status;12885 | ^ 12886 | {12887../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12888 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12889 | ^ 12890 | {12891../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12892 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12893 | ^ 12894 | {12895../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12896 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12897 | ^ 12898 | {12899../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12900 61 | auto const id = session->transport->nextStreamId.fetch_add(1);12901 | ^12902../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12903 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12904 | ^ 12905 | {12906../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12907 64 | if (!selection.status.ok()) return selection.status;12908 | ^ 12909 | {12910../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12911 65 | if (!selection.prepared || selection.prepared->session != session)12912 | ^12913 | {12914 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};12915 | 12916../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12917 67 | if (request.ByteSizeLong() > maxRequestBytes)12918 | ^12919 | {12920 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12921 | 12922../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12923 70 | if (bytes.size() > maxRequestBytes)12924 | ^12925 | {12926 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12927 | 12928../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12929 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12930 | ^ 12931 | {12932../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12933 75 | if (!status.ok()) return status;12934 | ^ 12935 | {12936../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]12937 77 | struct Release {12938 | ^12939../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]12940 77 | struct Release {12941 | ^12942 78 | ReverseTransport & transport;12943 79 | uint64_t id;12944 | 12945 | {}12946../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]12947 78 | ReverseTransport & transport;12948 | ^12949../src/daemon/reverse-relay.hh:81:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]12950 81 | ~Release() {12951 | ^12952/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:256:3: note: frame #0: unhandled exception of type 'out_of_range' may be thrown in function '__throw_out_of_range' here12953 256 | throw out_of_range(__msg);12954 | ^12955/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/unordered_map:1692:5: note: frame #1: function 'at' calls function '__throw_out_of_range' here12956 1692 | std::__throw_out_of_range("unordered_map::at: key not found");12957 | ^12958../src/daemon/reverse-frames.hh:211:59: note: frame #2: function 'terminal' calls function 'at' here12959 211 | if (closed || !streams.contains(id) || (!abort && streams.at(id))) {12960 | ^12961../src/daemon/reverse-frames.hh:94:47: note: frame #3: function 'cancel' calls function 'terminal' here12962 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }12963 | ^12964../src/daemon/reverse-relay.hh:84:40: note: frame #4: function '~Release' calls function 'cancel' here12965 84 | if (!completed) (void) transport.outgoing.cancel(id);12966 | ^12967../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12968 84 | if (!completed) (void) transport.outgoing.cancel(id);12969 | ^ 12970 | {12971../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12972 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12973 | ^ 12974 | {12975../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12976 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12977 | ^12978../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12979 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12980 | ^12981../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12982 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12983 | ^ 12984 | {12985../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12986 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12987 | ^12988 | {12989 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};12990 | 12991../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12992 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12993 | ^12994 | {12995 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};12996 | 12997../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12998 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12999 | ^ 13000 | {13001../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13002 111 | std::jthread monitor([&](std::stop_token stop) {13003 | ^13004 | const 13005../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13006 111 | std::jthread monitor([&](std::stop_token stop) {13007 | ^13008 | -> auto13009../src/daemon/reverse-relay.hh:111:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13010 111 | std::jthread monitor([&](std::stop_token stop) {13011 | ^13012 | const &13013../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13014 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13015 | ^13016../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13017 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13018 | ^13019 | -> auto13020../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13021 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};13022 | ^ 13023 | {13024../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13025 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))13026 | ^13027 | {13028 128 | return {grpc::StatusCode::UNAVAILABLE,13029 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};13030 | 13031../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13032 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))13033 | ^13034 | {13035 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};13036 | 13037../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13038 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};13039 | ^ 13040 | {13041../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13042 135 | if (beforeAck) beforeAck();13043 | ^ 13044 | {13045../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13046 136 | if (!transport.outgoing.acknowledge(id))13047 | ^13048 | {13049 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};13050 | 13051../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13052 145 | if (pending.size() < 4) break;13053 | ^ 13054 | {13055../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13056 147 | for (unsigned i = 0; i != 4; ++i)13057 | ^13058 | {13059 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13060 | 13061../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13062 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13063 | ^~~13064../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13065 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13066 | ^13067../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13068 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};13069 | ^ 13070 | {13071../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13072 153 | if (pending.size() < *expected) break;13073 | ^ 13074 | {13075../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13076 154 | if (!receive(std::string_view(pending).substr(0, *expected)))13077 | ^13078 | {13079 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};13080 | 13081../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13082 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};13083 | ^ 13084 | {13085../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13086 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};13087 | ^ 13088 | {13089../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13090 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};13091 | ^ 13092 | {13093../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13094 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))13095 | ^13096 | {13097 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};13098 | 13099../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13100 169 | ReverseGateway & gateway;13101 | ^13102../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13103 170 | ReverseRegistry & registry;13104 | ^13105../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13106 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool13107 | ^13108../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 113109 52 | if (!event) { rejection = inbound.lastRejection(); return false; }13110 | ^13111../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 113112 54 | switch (event->kind) {13113 | ^13114../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 213115 56 | if (!event->caller) { rejection = "open without caller"; return false; }13116 | ^13117../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 213118 59 | if (frame.open().method() == "UploadBuildInputs") {13119 | ^13120../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 313121 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {13122 | ^13123../src/daemon/reverse-request.hh:61:30: note: +113124 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {13125 | ^13126../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 313127 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {13128 | ^13129../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 213130 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }13131 | ^13132../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 213133 77 | if (auto it = uploads.find(id); it != uploads.end())13134 | ^13135../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 213136 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 413137 | ^13138../src/daemon/reverse-request.hh:82:17: note: +113139 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }13140 | ^13141../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 213142 84 | if (!pending.length && pending.wire.size() >= 4) {13143 | ^13144../src/daemon/reverse-request.hh:84:33: note: +113145 84 | if (!pending.length && pending.wire.size() >= 4) {13146 | ^13147../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 313148 86 | for (unsigned i = 0; i != 4; ++i)13149 | ^13150../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 313151 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }13152 | ^13153../src/daemon/reverse-request.hh:91:36: note: +113154 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;13155 | ^13156../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 213157 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13158 | ^13159../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 213160 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {13161 | ^13162../src/daemon/reverse-request.hh:96:60: note: +113163 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {13164 | ^13165../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 213166 108 | if (auto it = uploads.find(id); it != uploads.end()) {13167 | ^13168../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 213169 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13170 | ^13171../src/daemon/reverse-request.hh:112:29: note: +113172 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13173 | ^13174../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 213175 114 | if (ready && ready->id == id) ready.reset();13176 | ^13177../src/daemon/reverse-request.hh:114:23: note: +113178 114 | if (ready && ready->id == id) ready.reset();13179 | ^13180../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13181 48 | std::scoped_lock lock(mutex);13182 | ^13183 | const 13184../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13185 53 | auto const id = event->streamId;13186 | ^13187../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13188 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {13189 | ^13190 | -> bool13191../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13192 77 | if (auto it = uploads.find(id); it != uploads.end())13193 | ^13194../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13195 77 | if (auto it = uploads.find(id); it != uploads.end())13196 | ^13197 | {13198 78 | return it->second->feed(frame.data().data());13199 | 13200../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13201 86 | for (unsigned i = 0; i != 4; ++i)13202 | ^13203 | {13204 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13205 | 13206../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13207 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13208 | ^~~13209../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13210 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13211 | ^13212../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13213 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13214 | ^13215../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13216 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13217 | ^ 13218 | {13219../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13220 95 | auto it = requests.find(id);13221 | ^13222../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13223 108 | if (auto it = uploads.find(id); it != uploads.end()) {13224 | ^13225../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13226 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13227 | ^ 13228 | {13229../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13230 114 | if (ready && ready->id == id) ready.reset();13231 | ^ 13232 | {13233../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13234 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }13235 | ^13236 | const 13237../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13238 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }13239 | ^13240 | const 13241../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13242 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }13243 | ^13244 | const 13245../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13246 130 | std::scoped_lock lock(mutex);13247 | ^13248 | const 13249../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13250 131 | for (auto & [id, pipe] : uploads) pipe->cancel();13251 | ^13252../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13253 131 | for (auto & [id, pipe] : uploads) pipe->cancel();13254 | ^ 13255 | {13256../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13257 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {13258 | ^13259../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13260 142 | std::scoped_lock lock(mutex);13261 | ^13262 | const 13263../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13264 148 | std::scoped_lock lock(mutex);13265 | ^13266 | const 13267../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13268 149 | for (auto & [id, pipe] : uploads) pipe->cancel();13269 | ^13270../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13271 149 | for (auto & [id, pipe] : uploads) pipe->cancel();13272 | ^ 13273 | {13274../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13275 32 | [[nodiscard]] auto open(uint64_t id) -> bool13276 | ^13277../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13278 51 | auto it = streams.find(frame.stream_id());13279 | ^13280../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13281 56 | if (!cancelled.contains(frame.stream_id())) return false;13282 | ^ 13283 | {13284../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13285 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;13286 | ^ 13287 | {13288../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13289 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool13290 | ^13291../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13292 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool13293 | ^13294 | const &13295../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13296 104 | auto pending = [&] {13297 | ^13298 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>13299../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]13300 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });13301 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~13302 | std::ranges::find_if queue13303../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13304 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });13305 | ^13306 | -> auto13307../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13308 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });13309 | ^13310 | -> bool13311../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13312 111 | auto it = pending();13313 | ^13314../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13315 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool13316 | ^13317../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13318 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);13319 | ^ 13320 | {13321../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13322 168 | [[nodiscard]] auto finished(uint64_t id) -> bool13323 | ^13324../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13325 171 | auto it = streams.find(id);13326 | ^13327../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]13328 42 | if (context) {13329 | ^ 13330 | != nullptr13331../src/daemon/reverse-session.hh:54:22: error: member 'identity' of type 'WorkerIdentity &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13332 54 | WorkerIdentity & identity;13333 | ^13334../src/daemon/reverse-session.hh:55:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13335 55 | ReverseRegistry & registry;13336 | ^13337../src/daemon/reverse-session.hh:56:12: error: member 'workerAuth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13338 56 | Auth & workerAuth;13339 | ^13340../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13341 66 | auto Register(13342 | ^13343../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 113344 75 | if (!auth) {13345 | ^13346../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 113347 79 | if (transports.size() != 1 ||13348 | ^13349../src/daemon/reverse-session.hh:79:36: note: +113350 79 | if (transports.size() != 1 ||13351 | ^13352../src/daemon/reverse-session.hh:80:94: note: +113353 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" &&13354 | ^13355../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 113356 90 | if (caller.kind != Caller::Kind::named) {13357 | ^13358../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 113359 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) {13360 | ^13361../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 113362 100 | if (first == last || std::next(first) != last) {13363 | ^13364../src/daemon/reverse-session.hh:100:27: note: +113365 100 | if (first == last || std::next(first) != last) {13366 | ^13367../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 113368 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {13369 | ^13370../src/daemon/reverse-session.hh:105:40: note: +113371 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {13372 | ^13373../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 113374 111 | if (!stream->Read(&msg)) {13375 | ^13376../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 113377 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET13378 | ^13379../src/daemon/reverse-session.hh:115:13: note: +113380 115 | || !msg.credential().empty()) {13381 | ^13382../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113383 118 | if (msg.protocol() != reverseProtocolVersion) {13384 | ^13385../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 113386 122 | if (!bound) {13387 | ^13388../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 113389 128 | if (!sessionKey) {13390 | ^13391../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 113392 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },13393 | ^13394../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 113395 136 | if (!handle) {13396 | ^13397../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 113398 144 | ~Cleanup()13399 | ^13400../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 113401 139 | struct Cleanup13402 | ^13403../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 113404../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 113405 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13406 | ^13407../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 213408 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {13409 | ^13410../src/daemon/reverse-session.hh:160:43: note: +113411 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {13412 | ^13413../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 313414 161 | cv.wait_until(lock, stop, deadline, [] { return false; });13415 | ^13416../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 213417 163 | if (!stop.stop_requested()) {13418 | ^13419../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 113420 171 | if (!registry.current(*handle) || !stream->Write(ack)) {13421 | ^13422../src/daemon/reverse-session.hh:171:40: note: +113423 171 | if (!registry.current(*handle) || !stream->Write(ack)) {13424 | ^13425../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 113426 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13427 | ^13428../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 213429 179 | while (transport->outgoing.waitTake(frame, stop)) {13430 | ^13431../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 313432 180 | if (!registry.current(*handle) || !stream->Write(frame)) {13433 | ^13434../src/daemon/reverse-session.hh:180:48: note: +113435 180 | if (!registry.current(*handle) || !stream->Write(frame)) {13436 | ^13437../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 313438 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());13439 | ^13440../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 113441 187 | while (stream->Read(&msg)) {13442 | ^13443../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 213444 188 | if (!msg.credential().empty()) {13445 | ^13446../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 313447 191 | ? identity.renew(msg.credential(), bound->workerId)13448 | ^13449../src/daemon/reverse-session.hh:190:52: note: +113450 190 | && msg.worker_id().empty() && registry.current(*handle)13451 | ^13452../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 313453 193 | if (!renewed) {13454 | ^13455../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 213456 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {13457 | ^13458../src/daemon/reverse-session.hh:205:44: note: +113459 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {13460 | ^13461../src/daemon/reverse-session.hh:104:9: error: variable 'value' of type 'std::string_view' (aka 'basic_string_view<char>') can be declared 'const' [misc-const-correctness,-warnings-as-errors]13462 104 | std::string_view value(first->second.data(), first->second.size());13463 | ^13464 | const 13465../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13466 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },13467 | ^13468 | -> void13469../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13470 139 | struct Cleanup13471 | ^13472../src/daemon/reverse-session.hh:139:16: error: class 'Cleanup' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]13473 139 | struct Cleanup13474 | ^13475../src/daemon/reverse-session.hh:141:31: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13476 141 | ReverseRegistry & registry;13477 | ^13478../src/daemon/reverse-session.hh:144:13: error: an exception may be thrown in function '~Cleanup' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]13479 144 | ~Cleanup()13480 | ^13481/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:74:3: note: frame #0: unhandled exception of type 'bad_function_call' may be thrown in function '__throw_bad_function_call' here13482 74 | throw bad_function_call();13483 | ^13484/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:273:7: note: frame #1: function 'operator()' calls function '__throw_bad_function_call' here13485 273 | std::__throw_bad_function_call();13486 | ^13487/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:772:10: note: frame #2: function 'operator()' calls function 'operator()' here13488 772 | return __f_(std::forward<_ArgTypes>(__arg)...);13489 | ^13490../src/daemon/reverse-registry.hh:118:32: note: frame #3: function 'disconnected' calls function 'operator()' here13491 118 | removed->cancel();13492 | ^13493../src/daemon/reverse-session.hh:147:17: note: frame #4: function '~Cleanup' calls function 'disconnected' here13494 147 | registry.disconnected(handle, false);13495 | ^13496../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]13497 149 | } cleanup{registry, *handle, cancellation};13498 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~13499 | .registry=.handle= .cancellation=13500../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here13501 139 | struct Cleanup13502 | ^13503../src/daemon/reverse-session.hh:156:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13504 156 | std::condition_variable_any cv;13505 | ^13506../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13507 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13508 | ^13509 | const 13510../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13511 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13512 | ^13513 | -> void13514../src/daemon/reverse-session.hh:158:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13515 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13516 | ^13517 | const &13518../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13519 161 | cv.wait_until(lock, stop, deadline, [] { return false; });13520 | ^13521 | -> bool13522../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13523 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13524 | ^13525 | const 13526../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13527 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13528 | ^13529 | -> void13530../src/daemon/reverse-session.hh:177:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13531 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13532 | ^13533 | const &13534../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13535 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());13536 | ^ 13537 | {13538../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13539 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13540 | ^13541../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13542 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13543 | ^13544 | -> bool13545../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]13546 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13547 | ^13548../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13549 33 | if (assigned && !assigned()) return false;13550 | ^ 13551 | {13552../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13553 35 | std::scoped_lock lock(mutex);13554 | ^13555 | const 13556../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13557 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;13558 | ^ 13559 | {13560../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13561 42 | if (!ok) cancel();13562 | ^ 13563 | {13564../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13565 49 | std::scoped_lock lock(mutex);13566 | ^13567 | const 13568../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13569 68 | if (closed) return false;13570 | ^ 13571 | {13572../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13573 79 | if (ended || !chunks.empty()) break;13574 | ^ 13575 | {13576../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13577 80 | cv.wait_for(lock, std::chrono::milliseconds(25));13578 | ^13579../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13580 82 | if (chunks.empty()) return false;13581 | ^ 13582 | {13583../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13584 92 | std::scoped_lock lock(mutex);13585 | ^13586 | const 13587../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13588 103 | cv.wait_for(lock, std::chrono::milliseconds(25));13589 | ^13590../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13591 113 | if (!ended || closed || !chunks.empty()) return false;13592 | ^ 13593 | {13594../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13595 120 | std::scoped_lock lock(mutex);13596 | ^13597 | const 13598../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13599 129 | std::scoped_lock lock(mutex);13600 | ^13601 | const 13602../src/daemon/reverse-upload-relay.hh:33:24: error: function 'call' has cognitive complexity of 53 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13603 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned,13604 | ^13605../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 113606 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes13607 | ^13608../src/daemon/reverse-upload-relay.hh:37:63: note: +113609 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13610 | ^13611../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 113612 40 | if (!selection.status.ok()) return selection.status;13613 | ^13614../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 113615 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13616 | ^13617../src/daemon/reverse-upload-relay.hh:41:65: note: +113618 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13619 | ^13620../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 113621 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13622 | ^13623../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 113624 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13625 | ^13626../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 113627 48 | if (!selection.status.ok()) return selection.status;13628 | ^13629../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 113630 49 | if (!selection.prepared || selection.prepared->session != session)13631 | ^13632../src/daemon/reverse-upload-relay.hh:49:33: note: +113633 49 | if (!selection.prepared || selection.prepared->session != session)13634 | ^13635../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 113636 53 | if (!delegated || !ReverseUpload::first(*delegated, first)13637 | ^13638../src/daemon/reverse-upload-relay.hh:55:13: note: +113639 55 | || selection.prepared->assignId != first.assign_id())13640 | ^13641../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 113642 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13643 | ^13644../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 113645 60 | if (!status.ok()) return status;13646 | ^13647../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 113648 65 | ~Release() {13649 | ^13650../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 213651 66 | if (!completed) (void) transport.outgoing.cancel(id);13652 | ^13653../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 113654 76 | std::jthread monitor([&](std::stop_token stop) {13655 | ^13656../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 213657 78 | while (!stop.stop_requested()) {13658 | ^13659../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 313660 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)13661 | ^13662../src/daemon/reverse-upload-relay.hh:80:21: note: +113663 80 | || !assigned()) {13664 | ^13665../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 313666 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13667 | ^13668../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 113669 90 | auto const live = [&] {13670 | ^13671../src/daemon/reverse-upload-relay.hh:91:98: note: +113672 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned();13673 | ^13674../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 113675 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool {13676 | ^13677../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 213678 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13679 | ^13680../src/daemon/reverse-upload-relay.hh:95:27: note: +113681 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13682 | ^13683../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 213684 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13685 | ^13686../src/daemon/reverse-upload-relay.hh:97:30: note: +113687 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13688 | ^13689../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 213690 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13691 | ^13692../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 213693 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13694 | ^13695../src/daemon/reverse-upload-relay.hh:100:25: note: +113696 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13697 | ^13698../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 213699 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13700 | ^13701../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 313702 102 | if (!live() || !transport.outgoing.waitData(id,13703 | ^13704../src/daemon/reverse-upload-relay.hh:102:29: note: +113705 102 | if (!live() || !transport.outgoing.waitData(id,13706 | ^13707../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 113708 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13709 | ^13710../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 113711 108 | while (read(next)) {13712 | ^13713../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 213714 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13715 | ^13716../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 213717 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13718 | ^13719../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 113720 113 | if (!live() || !transport.outgoing.halfClose(id))13721 | ^13722../src/daemon/reverse-upload-relay.hh:113:21: note: +113723 113 | if (!live() || !transport.outgoing.halfClose(id))13724 | ^13725../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 113726 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13727 | ^13728../src/daemon/reverse-upload-relay.hh:116:75: note: +113729 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13730 | ^13731../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113732 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13733 | ^13734../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 113735 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13736 | ^13737../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 113738 120 | if (!transport.responses.finished(id))13739 | ^13740../src/daemon/reverse-upload-relay.hh:34:84: error: the parameter 'first' of type 'nix::remote::UploadBuildInputsChunk' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13741 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status13742 | ^13743 | const &13744../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13745 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13746 | ^13747 | {13748 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};13749 | 13750../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13751 40 | if (!selection.status.ok()) return selection.status;13752 | ^ 13753 | {13754../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13755 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13756 | ^13757 | {13758 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};13759 | 13760../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13761 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13762 | ^ 13763 | {13764../src/daemon/reverse-upload-relay.hh:45:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13765 45 | auto const id = session->transport->nextStreamId.fetch_add(1);13766 | ^13767../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13768 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13769 | ^ 13770 | {13771../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13772 48 | if (!selection.status.ok()) return selection.status;13773 | ^ 13774 | {13775../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13776 49 | if (!selection.prepared || selection.prepared->session != session)13777 | ^13778 | {13779 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};13780 | 13781../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13782 55 | || selection.prepared->assignId != first.assign_id())13783 | ^13784 | {13785 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};13786 | 13787../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13788 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13789 | ^ 13790 | {13791../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13792 60 | if (!status.ok()) return status;13793 | ^ 13794 | {13795../src/daemon/reverse-upload-relay.hh:61:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]13796 61 | struct Release {13797 | ^13798../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]13799 61 | struct Release {13800 | ^13801 62 | ReverseTransport & transport;13802 63 | uint64_t id;13803 | 13804 | {}13805../src/daemon/reverse-upload-relay.hh:62:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13806 62 | ReverseTransport & transport;13807 | ^13808../src/daemon/reverse-upload-relay.hh:65:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]13809 65 | ~Release() {13810 | ^13811/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:256:3: note: frame #0: unhandled exception of type 'out_of_range' may be thrown in function '__throw_out_of_range' here13812 256 | throw out_of_range(__msg);13813 | ^13814/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/unordered_map:1692:5: note: frame #1: function 'at' calls function '__throw_out_of_range' here13815 1692 | std::__throw_out_of_range("unordered_map::at: key not found");13816 | ^13817../src/daemon/reverse-frames.hh:211:59: note: frame #2: function 'terminal' calls function 'at' here13818 211 | if (closed || !streams.contains(id) || (!abort && streams.at(id))) {13819 | ^13820../src/daemon/reverse-frames.hh:94:47: note: frame #3: function 'cancel' calls function 'terminal' here13821 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }13822 | ^13823../src/daemon/reverse-upload-relay.hh:66:40: note: frame #4: function '~Release' calls function 'cancel' here13824 66 | if (!completed) (void) transport.outgoing.cancel(id);13825 | ^13826../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13827 66 | if (!completed) (void) transport.outgoing.cancel(id);13828 | ^ 13829 | {13830../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]13831 70 | } release{transport, id};13832 | ^~~~~~~~~~~~~~~13833 | .transport=.id=13834../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here13835 61 | struct Release {13836 | ^13837../src/daemon/reverse-upload-relay.hh:75:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13838 75 | std::condition_variable_any cv;13839 | ^13840../src/daemon/reverse-upload-relay.hh:76:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13841 76 | std::jthread monitor([&](std::stop_token stop) {13842 | ^13843 | const 13844../src/daemon/reverse-upload-relay.hh:76:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13845 76 | std::jthread monitor([&](std::stop_token stop) {13846 | ^13847 | -> void13848../src/daemon/reverse-upload-relay.hh:76:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13849 76 | std::jthread monitor([&](std::stop_token stop) {13850 | ^13851 | const &13852../src/daemon/reverse-upload-relay.hh:87:67: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13853 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13854 | ^13855../src/daemon/reverse-upload-relay.hh:87:72: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13856 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13857 | ^13858 | -> bool13859../src/daemon/reverse-upload-relay.hh:90:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13860 90 | auto const live = [&] {13861 | ^13862 | -> bool13863../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13864 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13865 | ^ 13866 | {13867../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13868 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13869 | ^ 13870 | {13871../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13872 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13873 | ^ 13874 | {13875../src/daemon/reverse-upload-relay.hh:99:52: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13876 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13877 | ^~~13878../src/daemon/reverse-upload-relay.hh:99:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13879 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13880 | ^13881../src/daemon/reverse-upload-relay.hh:99:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13882 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13883 | ^13884../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13885 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13886 | ^ 13887 | {13888../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13889 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13890 | ^13891 | {13892 102 | if (!live() || !transport.outgoing.waitData(id,13893 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13894 | 13895../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13896 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13897 | ^ 13898 | {13899../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13900 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13901 | ^ 13902 | {13903../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13904 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13905 | ^ 13906 | {13907../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13908 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13909 | ^ 13910 | {13911../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13912 113 | if (!live() || !transport.outgoing.halfClose(id))13913 | ^13914 | {13915 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};13916 | 13917../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13918 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13919 | ^13920 | {13921 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};13922 | 13923../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13924 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13925 | ^ 13926 | {13927../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13928 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13929 | ^ 13930 | {13931../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13932 120 | if (!transport.responses.finished(id))13933 | ^13934 | {13935 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};13936 | 13937../src/daemon/reverse-upload-relay.hh:127:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13938 127 | ReverseGateway & gateway;13939 | ^13940../src/daemon/reverse-upload-relay.hh:128:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13941 128 | ReverseRegistry & registry;13942 | ^13943../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]13944 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13945 | ^13946../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning13947 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13948 | ^~~~~~~~~~~13949 | static_cast<const size_t>( )13950../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type13951 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13952 | ^~~~13953 | static_cast<long>( )13954../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13955 49 | if (failed || bytes.empty() || !consume) return fail();13956 | ^ 13957 | {13958../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors]13959 53 | buffer.append(bytes.data(), count);13960 | ~~~~~~^~~~13961../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13962 57 | for (unsigned i = 0; i < 4; ++i)13963 | ^13964 | {13965 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13966 | 13967../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13968 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13969 | ^~~13970../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13971 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13972 | ^13973../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13974 59 | if (length == 0 || length > maxChunkBytes) return fail();13975 | ^ 13976 | {13977../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]13978 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))13979 | ^13980../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13981 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))13982 | ^13983 | {13984 66 | return fail();13985 | 13986../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13987 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();13988 | ^13989../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13990 371 | auto const it = workerIds.find(std::string(addr));13991 | ^13992../src/daemon/worker-identity.hh:20:22: error: member 'verifier' of type 'oidc::Verifier &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13993 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience13994 | ^13995../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13996 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13997 | ^13998 | -> bool13999../src/daemon/worker-identity.hh:29:103: error: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]14000 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {14001 | ^14002../src/daemon/worker-identity.hh:43:22: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]14003 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14004 | ^14005../src/daemon/worker-identity.hh:43:32: error: 13 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]14006 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14007 | ^14008../src/daemon/worker-identity.hh:43:43: error: 18 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]14009 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14010 | ^14011../src/daemon/worker-identity.hh:43:54: error: 23 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]14012 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14013 | ^14014../src/daemon/worker-identity.hh:44:24: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]14015 44 | if (uid[i] != '-') {14016 | ^~~14017../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]14018 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14019 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~14020 | < || > && < || >14021../src/daemon/worker-identity.hh:47:30: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]14022 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14023 | ^~~14024../src/daemon/worker-identity.hh:47:47: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]14025 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14026 | ^~~14027../src/daemon/worker-identity.hh:47:66: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]14028 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14029 | ^~~14030../src/daemon/worker-identity.hh:47:83: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]14031 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14032 | ^~~14033../src/daemon/worker-identity.hh:96:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]14034 96 | auto const & id = *result.identity;14035 | ^14036../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14037 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime14038 | ^~~~~~~~~~~~14039../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14040 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {14041 | ^~~~~~~~~~~~14042../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14043 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;14044 | ^~~~~~~~~14045../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14046 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};14047 | ^~~~~~~~~~~~14048../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]14049 327 | char extra;14050 | ^ 14051 | = 014052../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14053 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");14054 | ^ 14055 | {14056../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14057 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");14058 | ^ 14059 | {14060../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14061 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");14062 | ^ 14063 | {14064Errors encountered while running clang-tidy14065FAILED: [code=1] meson-internal__clang-tidy 14066/nix/store/sn59lgid7r01w49nyz81hcp1rjmpby3m-meson-1.12.1/bin/meson --internal clangtidy /private/var/tb/4/scratch/4342aa3e17441242/build/source /private/var/tb/4/scratch/4342aa3e17441242/build/source/build --color always14067ninja: build stopped: subcommand failed.