nix-grpc-store-clang-tidy-0.2.2
checks.aarch64-linux.clang-tidy
· build #770
· raw
1tribuchet: building on eliza
unpackPhase
2unpacking source archive /nix/store/cg0kqvfmmilqxhzjggy8hqwkfmib4xpd-source3source root is sourceconfigurePhase
4mesonConfigurePhase flags: --prefix=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-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: /build/source8Build dir: /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++ ld.bfd 2.4615Host machine cpu family: aarch6416Host machine cpu: aarch6417Found pkg-config: YES (/nix/store/ilg26l78wi5v6nhdn4ffxba1f4yc1h9s-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/wq8r8l8dqynvgy22q9fs7pni029v7hf7-protobuf-36.2/bin/protoc)37Program grpc_cpp_plugin found: YES (/nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/bin/grpc_cpp_plugin)38Program mold found: YES (/nix/store/h4d6k29dw2p2jvwnff2n2dmcc5yq2xwy-mold-unwrapped-wrapper-3.0.0/bin/mold)39Run-time dependency dl found: YES40Program tests/farm-client-test.sh found: YES (/build/source/tests/farm-client-test.sh)41Program tests/oidc-test.sh found: YES (/build/source/tests/oidc-test.sh)42Program tests/reverse-gateway-test.sh found: YES (/build/source/tests/reverse-gateway-test.sh)43Build targets in project: 3744WARNING: Project specifies no minimum version but uses features which were added in versions:45 * 1.1: {'meson.options file'}4647nix-grpc-store 0.2.24849 User defined options50 auto_features: enabled51 b_pch : false52 bindir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/bin53 buildtype : plain54 includedir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/include55 infodir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/info56 libdir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/lib57 libexecdir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/libexec58 localedir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/locale59 mandir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/man60 prefix : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.261 sbindir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/sbin62 wrap_mode : nodownload6364Found ninja-1.13.2 at /nix/store/6iwk9hppg8q0fr54mg28klc1hgaizhaa-ninja-1.13.2/bin/ninja65mesonConfigurePhase: enabled\ parallel\ building66configurePhase completed in 48 secondsbuildPhase
67[1/2] Generating eds_proto with a custom command68[2/2] Generating nix_remote_proto with a custom command69[0/1] /nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always70>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-frames-test.cc71../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]72 23 | static constexpr size_t maxFrameBytes = 64 * 1024;73 | ^74../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning75 23 | static constexpr size_t maxFrameBytes = 64 * 1024;76 | ^~~~~~~~~77 | static_cast<const size_t>( )78../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type79 23 | static constexpr size_t maxFrameBytes = 64 * 1024;80 | ^~81 | static_cast<long>( )82../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]83 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;84 | ^85../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning86 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;87 | ^~~~~~~~~~~~~~~88 | static_cast<const size_t>( )89../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type90 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;91 | ^~~~~~~~92 | static_cast<long>( )93../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]94 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool95 | ^96../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]97 53 | auto data(uint64_t id, std::string_view bytes) -> bool98 | ^99../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]100 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);101 | ^102../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]103 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool104 | ^105../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]106 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool107 | ^108 | const &109../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]110 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;111 | ^ 112 | {113../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]114 81 | if (size > limit) return false;115 | ^ 116 | {117../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]118 83 | cv.wait(lock, stop, [&] {119 | ^120 | -> bool121../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]122 84 | auto it = streams.find(id);123 | ^124../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]125 87 | auto const it = streams.find(id);126 | ^127../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]128 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;129 | ^ 130 | {131../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]132 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }133 | ^134../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]135 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }136 | ^137../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]138 96 | auto acknowledge(uint64_t id) -> bool139 | ^140../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]141 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;142 | ^ 143 | {144../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]145 105 | if (!enqueue(std::move(msg))) return false;146 | ^ 147 | {148../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]149 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool150 | ^151 | const &152../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]153 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });154 | ^155 | -> bool156../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]157 145 | auto finished(uint64_t id) -> bool158 | ^159../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]160 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;161 | ^ 162 | {163../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]164 150 | if (removed) cv.notify_all();165 | ^ 166 | {167../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]168 156 | void acknowledgementSent(uint64_t id)169 | ^170../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]171 159 | if (acknowledged.erase(id)) streams.erase(id);172 | ^ 173 | != 0u174../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]175 159 | if (acknowledged.erase(id)) streams.erase(id);176 | ^ 177 | {178../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]179 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {180 | ^181../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]182 208 | auto terminal(uint64_t id, bool abort) -> bool183 | ^184../tests/reverse-frames-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]185 8 | int main()186 | ~~~ ^ 187 | auto -> int188../tests/reverse-frames-test.cc:11:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]189 6 | #include "reverse-frames.hh"190 7 | 191 8 | int main()192 9 | {193 10 | nixgrpc::ReverseFrames frames;194 11 | nix::remote::ReverseOpen start;195 | ^196../tests/reverse-frames-test.cc:26:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]197 26 | nix::remote::ReverseFarmMsg msg;198 | ^199../tests/reverse-frames-test.cc:52:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]200 2 | for (uint64_t id = 3; id < 3 + nixgrpc::ReverseFrames::maxStreams; ++id) {201 | ^202../tests/reverse-frames-test.cc:56:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]203 2 | size_t queued = 0;204 | ^205../tests/reverse-frames-test.cc:70:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]206 70 | std::jthread waiter([&] {207 | ^208 | -> void209../tests/reverse-frames-test.cc:87:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]210 87 | std::jthread producer([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });211 | ^212 | -> void213../tests/reverse-frames-test.cc:93:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]214 93 | std::jthread interrupted([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });215 | ^216 | -> void217../tests/reverse-frames-test.cc:103:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]218 103 | std::jthread discarded([&] { enqueued = cancelled.waitData(1, payload, stillRunning.get_token()); });219 | ^220 | -> void221>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-registry-test.cc222../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]223 23 | static constexpr size_t maxFrameBytes = 64 * 1024;224 | ^225../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning226 23 | static constexpr size_t maxFrameBytes = 64 * 1024;227 | ^~~~~~~~~228 | static_cast<const size_t>( )229../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type230 23 | static constexpr size_t maxFrameBytes = 64 * 1024;231 | ^~232 | static_cast<long>( )233../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]234 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;235 | ^236../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning237 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;238 | ^~~~~~~~~~~~~~~239 | static_cast<const size_t>( )240../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type241 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;242 | ^~~~~~~~243 | static_cast<long>( )244../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]245 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool246 | ^247../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]248 53 | auto data(uint64_t id, std::string_view bytes) -> bool249 | ^250../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]251 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);252 | ^253../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]254 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool255 | ^256../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]257 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool258 | ^259 | const &260../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]261 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;262 | ^ 263 | {264../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]265 81 | if (size > limit) return false;266 | ^ 267 | {268../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]269 83 | cv.wait(lock, stop, [&] {270 | ^271 | -> bool272../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]273 84 | auto it = streams.find(id);274 | ^275../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]276 87 | auto const it = streams.find(id);277 | ^278../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]279 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;280 | ^ 281 | {282../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]283 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }284 | ^285../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]286 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }287 | ^288../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]289 96 | auto acknowledge(uint64_t id) -> bool290 | ^291../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]292 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;293 | ^ 294 | {295../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]296 105 | if (!enqueue(std::move(msg))) return false;297 | ^ 298 | {299../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]300 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool301 | ^302 | const &303../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]304 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });305 | ^306 | -> bool307../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]308 145 | auto finished(uint64_t id) -> bool309 | ^310../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]311 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;312 | ^ 313 | {314../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]315 150 | if (removed) cv.notify_all();316 | ^ 317 | {318../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]319 156 | void acknowledgementSent(uint64_t id)320 | ^321../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]322 159 | if (acknowledged.erase(id)) streams.erase(id);323 | ^ 324 | != 0u325../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]326 159 | if (acknowledged.erase(id)) streams.erase(id);327 | ^ 328 | {329../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]330 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {331 | ^332../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]333 208 | auto terminal(uint64_t id, bool abort) -> bool334 | ^335../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]336 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {337 | ^338../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]339 82 | auto it = sessions.find(std::string(workerId));340 | ^341../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]342 92 | auto it = sessions.find(handle->workerId);343 | ^344../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]345 107 | auto it = sessions.find(handle->workerId);346 | ^347../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]348 130 | for (auto & [id, session] : sessions) {349 | ^350../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]351 32 | [[nodiscard]] auto open(uint64_t id) -> bool352 | ^353../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]354 51 | auto it = streams.find(frame.stream_id());355 | ^356../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]357 56 | if (!cancelled.contains(frame.stream_id())) return false;358 | ^ 359 | {360../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]361 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;362 | ^ 363 | {364../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]365 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool366 | ^367../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]368 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool369 | ^370 | const &371../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]372 104 | auto pending = [&] {373 | ^374 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>375../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]376 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });377 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~378 | std::ranges::find_if queue379../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]380 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });381 | ^382 | -> auto383../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]384 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });385 | ^386 | -> bool387../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]388 111 | auto it = pending();389 | ^390../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]391 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool392 | ^393../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]394 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);395 | ^ 396 | {397../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]398 168 | [[nodiscard]] auto finished(uint64_t id) -> bool399 | ^400../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]401 171 | auto it = streams.find(id);402 | ^403../tests/reverse-registry-test.cc:9:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]404 9 | int main()405 | ~~~ ^ 406 | auto -> int407../tests/reverse-registry-test.cc:14:57: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]408 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby409 | ^410 | -> void411/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'412 138 | ((__VA_ARGS__) \413 | ^414../tests/reverse-registry-test.cc:16:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]415 16 | assert(!registry.registerWorker("", "worker", [] {}));416 | ^417 | -> void418/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'419 138 | ((__VA_ARGS__) \420 | ^421../tests/reverse-registry-test.cc:17:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]422 17 | assert(!registry.registerWorker("other", "worker", [] {}));423 | ^424 | -> void425/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'426 138 | ((__VA_ARGS__) \427 | ^428../tests/reverse-registry-test.cc:18:115: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]429 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));430 | ^431 | -> void432/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'433 138 | ((__VA_ARGS__) \434 | ^435../tests/reverse-registry-test.cc:22:53: error: no header providing "nixgrpc::ReverseTransport" is directly included [misc-include-cleaner,-warnings-as-errors]436 8 | 437 9 | int main()438 10 | {439 11 | nixgrpc::ReverseRegistry registry;440 12 | int firstCancelled = 0;441 13 | int secondCancelled = 0;442 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby443 15 | registry.setActive(true);444 16 | assert(!registry.registerWorker("", "worker", [] {}));445 17 | assert(!registry.registerWorker("other", "worker", [] {}));446 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));447 19 | assert(!registry.registerWorker("worker", "worker", {}));448 20 | assert(!registry.find("worker"));449 21 | 450 22 | auto firstTransport = std::make_shared<nixgrpc::ReverseTransport>();451 | ^452../tests/reverse-registry-test.cc:23:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]453 23 | auto first = *registry.registerWorker("worker", "worker", [&] {454 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~455 24 | ++firstCancelled;456 | ~~~~~~~~~~~~~~~~~457 25 | // A session teardown can synchronously inspect the replacement.458 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~459 26 | assert(registry.find("worker"));460 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~461 27 | }, {}, firstTransport);462 | ~~~~~~~~~~~~~~~~~~~~~~463../tests/reverse-registry-test.cc:23:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]464 23 | auto first = *registry.registerWorker("worker", "worker", [&] {465 | ^466 | -> void467../tests/reverse-registry-test.cc:31:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]468 31 | auto other = *registry.registerWorker("other", "other", [] {});469 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~470../tests/reverse-registry-test.cc:31:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]471 31 | auto other = *registry.registerWorker("other", "other", [] {});472 | ^473 | -> void474../tests/reverse-registry-test.cc:32:20: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]475 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });476 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~477../tests/reverse-registry-test.cc:32:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]478 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });479 | ^480 | -> void481../tests/reverse-registry-test.cc:35:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]482 7 | nix::remote::ReverseWorkerMsg stale;483 | ^484../tests/reverse-registry-test.cc:50:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]485 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });486 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~487../tests/reverse-registry-test.cc:50:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]488 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });489 | ^490 | -> void491../tests/reverse-registry-test.cc:58:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]492 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });493 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~494../tests/reverse-registry-test.cc:58:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]495 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });496 | ^497 | -> void498../tests/reverse-registry-test.cc:64:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]499 64 | auto old = *registry.registerWorker("worker", "worker", [] {});500 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~501../tests/reverse-registry-test.cc:64:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]502 64 | auto old = *registry.registerWorker("worker", "worker", [] {});503 | ^504 | -> void505../tests/reverse-registry-test.cc:65:23: error: variable name 'go' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]506 65 | std::atomic<bool> go{false};507 | ^508../tests/reverse-registry-test.cc:66:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]509 66 | std::thread closeOld([&] {510 | ^511 | -> void512../tests/reverse-registry-test.cc:73:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]513 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});514 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~515../tests/reverse-registry-test.cc:73:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]516 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});517 | ^518 | -> void519>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-responses-test.cc520../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]521 23 | static constexpr size_t maxFrameBytes = 64 * 1024;522 | ^523../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning524 23 | static constexpr size_t maxFrameBytes = 64 * 1024;525 | ^~~~~~~~~526 | static_cast<const size_t>( )527../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type528 23 | static constexpr size_t maxFrameBytes = 64 * 1024;529 | ^~530 | static_cast<long>( )531../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]532 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;533 | ^534../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning535 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;536 | ^~~~~~~~~~~~~~~537 | static_cast<const size_t>( )538../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type539 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;540 | ^~~~~~~~541 | static_cast<long>( )542../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]543 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool544 | ^545../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]546 53 | auto data(uint64_t id, std::string_view bytes) -> bool547 | ^548../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]549 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);550 | ^551../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]552 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool553 | ^554../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]555 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool556 | ^557 | const &558../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]559 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;560 | ^ 561 | {562../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]563 81 | if (size > limit) return false;564 | ^ 565 | {566../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]567 83 | cv.wait(lock, stop, [&] {568 | ^569 | -> bool570../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]571 84 | auto it = streams.find(id);572 | ^573../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]574 87 | auto const it = streams.find(id);575 | ^576../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]577 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;578 | ^ 579 | {580../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]581 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }582 | ^583../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]584 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }585 | ^586../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]587 96 | auto acknowledge(uint64_t id) -> bool588 | ^589../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]590 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;591 | ^ 592 | {593../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]594 105 | if (!enqueue(std::move(msg))) return false;595 | ^ 596 | {597../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]598 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool599 | ^600 | const &601../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]602 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });603 | ^604 | -> bool605../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]606 145 | auto finished(uint64_t id) -> bool607 | ^608../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]609 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;610 | ^ 611 | {612../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]613 150 | if (removed) cv.notify_all();614 | ^ 615 | {616../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]617 156 | void acknowledgementSent(uint64_t id)618 | ^619../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]620 159 | if (acknowledged.erase(id)) streams.erase(id);621 | ^ 622 | != 0u623../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]624 159 | if (acknowledged.erase(id)) streams.erase(id);625 | ^ 626 | {627../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]628 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {629 | ^630../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]631 208 | auto terminal(uint64_t id, bool abort) -> bool632 | ^633../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]634 32 | [[nodiscard]] auto open(uint64_t id) -> bool635 | ^636../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]637 51 | auto it = streams.find(frame.stream_id());638 | ^639../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]640 56 | if (!cancelled.contains(frame.stream_id())) return false;641 | ^ 642 | {643../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]644 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;645 | ^ 646 | {647../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]648 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool649 | ^650../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]651 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool652 | ^653 | const &654../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]655 104 | auto pending = [&] {656 | ^657 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>658../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]659 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });660 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~661 | std::ranges::find_if queue662../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]663 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });664 | ^665 | -> auto666../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]667 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });668 | ^669 | -> bool670../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]671 111 | auto it = pending();672 | ^673../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]674 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool675 | ^676../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]677 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);678 | ^ 679 | {680../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]681 168 | [[nodiscard]] auto finished(uint64_t id) -> bool682 | ^683../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]684 171 | auto it = streams.find(id);685 | ^686../tests/reverse-responses-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]687 8 | int main()688 | ~~~ ^ 689 | auto -> int690../tests/reverse-responses-test.cc:13:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]691 6 | #include "reverse-responses.hh"692 7 | 693 8 | int main()694 9 | {695 10 | nixgrpc::ReverseResponses replies;696 11 | assert(!replies.open(0));697 12 | assert(replies.open(1) && !replies.open(1));698 13 | nix::remote::ReverseWorkerMsg response;699 | ^700../tests/reverse-responses-test.cc:23:60: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]701 6 | response.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x'));702 | ^703../tests/reverse-responses-test.cc:27:53: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]704 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));705 | ^706../tests/reverse-responses-test.cc:27:69: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]707 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));708 | ^709../tests/reverse-responses-test.cc:40:41: error: 123 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]710 40 | response.mutable_finish()->set_code(123);711 | ^712../tests/reverse-responses-test.cc:63:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]713 2 | size_t queued = 0;714 | ^715../tests/reverse-responses-test.cc:77:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]716 77 | std::jthread waiter([&] {717 | ^718 | -> void719../tests/reverse-responses-test.cc:79:37: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]720 79 | received = replies.waitTake(6, isolated, stop.get_token())721 | ^722../tests/reverse-responses-test.cc:80:40: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]723 80 | && isolated.stream_id() == 6 && isolated.data().data() == "only six";724 | ^725../tests/reverse-responses-test.cc:82:28: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]726 82 | response.set_stream_id(5);727 | ^728../tests/reverse-responses-test.cc:85:28: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]729 85 | response.set_stream_id(6);730 | ^731>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/dispatcher-session-test.cc732../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]733 12 | #include <chrono>734 | 735 13 | #include <chrono>736 | ^~~~~~~~~~~~~~~~~737../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]738 90 | std::chrono::system_clock::time_point credentialExpiresAt{};739 | ^~740../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]741 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();742 | ^743../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]744 371 | auto const it = workerIds.find(std::string(addr));745 | ^746../tests/dispatcher-session-test.cc:14:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]747 14 | int main()748 | ~~~ ^ 749 | auto -> int750../tests/dispatcher-session-test.cc:70:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]751 70 | if (msg.has_assigned()) directAssigned = !msg.assigned().reverse();752 | ^ 753 | {754../tests/dispatcher-session-test.cc:72:8: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]755 72 | }, [] {});756 | ^757 | -> void758../tests/dispatcher-session-test.cc:87:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]759 87 | .send = [](const nix::remote::SchedCmd &) { return true; },760 | ^761 | -> bool762../tests/dispatcher-session-test.cc:129:106: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]763 129 | auto follower = dispatcher.connectClient([](const nix::remote::SchedMsg &) -> bool { return true; }, [] {});764 | ^765 | -> void766../tests/dispatcher-session-test.cc:150:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]767 150 | .send = [&](const nix::remote::SchedCmd & cmd) {768 | ^769 | -> bool770../tests/dispatcher-session-test.cc:168:10: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]771 5 | for (uint32_t const version : {0U, nixgrpc::reverseProtocolVersion + 1}) {772 | ^773../tests/dispatcher-session-test.cc:182:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]774 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});775 | ^776 | -> bool777../tests/dispatcher-session-test.cc:182:103: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]778 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});779 | ^780 | -> void781../tests/dispatcher-session-test.cc:190:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]782 190 | .send = [](const nix::remote::SchedCmd &) { return true; },783 | ^784 | -> bool785>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/client/channel.cc786[1/1] (1/2) Processing file /build/source/src/client/channel.cc.787[1/1] (2/2) Processing file /build/source/src/client/channel.cc.788>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-roundtrip-test.cc789../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]790 553 | namespaceClaim && namespaceClaim->is_string()) {791 | ^792 | ( != nullptr)793../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]794 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {795 | ^796 | ( != nullptr)797../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]798 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {799 | ^800../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]801 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {802 | ^803../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]804 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {805 | ^806../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]807 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {808 | ^809 | ( != nullptr)810../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]811 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {812 | ^813../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]814 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)815 | ^816../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]817 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||818 | ^819../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]820 96 | result.push_back(static_cast<char>(size >> (i * 8)));821 | ^822../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]823 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,824 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~825../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'826 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,827 | ^~~~~828../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'829 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,830 | ^~~~~~~~831../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]832 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);833 | ^~~834../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]835 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);836 | ^837../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]838 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)839 | ^840../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]841 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)842 | ^843../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]844 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||845 | ^846../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]847 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;848 | ^ 849 | {850../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]851 250 | unsigned char mac[EVP_MAX_MD_SIZE];852 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~853../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]854 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),855 | ~^856 | (857 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||858 | == nullptr)859../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]860 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||861 | ^862../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]863 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||864 | ^865../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]866 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);867 | ^868../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]869 23 | static constexpr size_t maxFrameBytes = 64 * 1024;870 | ^871../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning872 23 | static constexpr size_t maxFrameBytes = 64 * 1024;873 | ^~~~~~~~~874 | static_cast<const size_t>( )875../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type876 23 | static constexpr size_t maxFrameBytes = 64 * 1024;877 | ^~878 | static_cast<long>( )879../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]880 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;881 | ^882../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning883 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;884 | ^~~~~~~~~~~~~~~885 | static_cast<const size_t>( )886../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type887 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;888 | ^~~~~~~~889 | static_cast<long>( )890../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]891 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool892 | ^893../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]894 53 | auto data(uint64_t id, std::string_view bytes) -> bool895 | ^896../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]897 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);898 | ^899../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]900 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool901 | ^902../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]903 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool904 | ^905 | const &906../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]907 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;908 | ^ 909 | {910../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]911 81 | if (size > limit) return false;912 | ^ 913 | {914../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]915 83 | cv.wait(lock, stop, [&] {916 | ^917 | -> bool918../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]919 84 | auto it = streams.find(id);920 | ^921../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]922 87 | auto const it = streams.find(id);923 | ^924../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]925 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;926 | ^ 927 | {928../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]929 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }930 | ^931../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]932 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }933 | ^934../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]935 96 | auto acknowledge(uint64_t id) -> bool936 | ^937../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]938 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;939 | ^ 940 | {941../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]942 105 | if (!enqueue(std::move(msg))) return false;943 | ^ 944 | {945../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]946 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool947 | ^948 | const &949../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]950 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });951 | ^952 | -> bool953../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]954 145 | auto finished(uint64_t id) -> bool955 | ^956../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]957 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;958 | ^ 959 | {960../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]961 150 | if (removed) cv.notify_all();962 | ^ 963 | {964../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]965 156 | void acknowledgementSent(uint64_t id)966 | ^967../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]968 159 | if (acknowledged.erase(id)) streams.erase(id);969 | ^ 970 | != 0u971../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]972 159 | if (acknowledged.erase(id)) streams.erase(id);973 | ^ 974 | {975../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]976 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {977 | ^978../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]979 208 | auto terminal(uint64_t id, bool abort) -> bool980 | ^981../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]982 50 | auto const id = frame.stream_id();983 | ^984../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]985 68 | auto it = streams.find(id);986 | ^987../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]988 74 | && finishedIds.erase(id))989 | ^ 990 | ( != 0u)991../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]992 74 | && finishedIds.erase(id))993 | ^994 | {995 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};996 | 997../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]998 109 | auto finished(uint64_t id) -> bool999 | ^1000../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1001 111 | if (cancelledIds.erase(id)) return true;1002 | ^ 1003 | != 0u1004../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1005 111 | if (cancelledIds.erase(id)) return true;1006 | ^ 1007 | {1008../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1009 112 | if (!streams.erase(id)) return false;1010 | ~^ 1011 | == 0u1012../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1013 112 | if (!streams.erase(id)) return false;1014 | ^ 1015 | {1016../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]1017 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {1018 | ^1019../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]1020 82 | auto it = sessions.find(std::string(workerId));1021 | ^1022../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]1023 92 | auto it = sessions.find(handle->workerId);1024 | ^1025../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]1026 107 | auto it = sessions.find(handle->workerId);1027 | ^1028../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]1029 130 | for (auto & [id, session] : sessions) {1030 | ^1031../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]1032 32 | [[nodiscard]] auto open(uint64_t id) -> bool1033 | ^1034../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]1035 51 | auto it = streams.find(frame.stream_id());1036 | ^1037../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1038 56 | if (!cancelled.contains(frame.stream_id())) return false;1039 | ^ 1040 | {1041../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1042 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;1043 | ^ 1044 | {1045../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]1046 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1047 | ^1048../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]1049 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1050 | ^1051 | const &1052../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1053 104 | auto pending = [&] {1054 | ^1055 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>1056../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]1057 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1058 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~1059 | std::ranges::find_if queue1060../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1061 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1062 | ^1063 | -> auto1064../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1065 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });1066 | ^1067 | -> bool1068../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]1069 111 | auto it = pending();1070 | ^1071../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]1072 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool1073 | ^1074../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1075 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);1076 | ^ 1077 | {1078../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]1079 168 | [[nodiscard]] auto finished(uint64_t id) -> bool1080 | ^1081../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]1082 171 | auto it = streams.find(id);1083 | ^1084../tests/reverse-roundtrip-test.cc:10:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1085 10 | int main()1086 | ~~~ ^ 1087 | auto -> int1088../tests/reverse-roundtrip-test.cc:12:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1089 4 | #include "reverse-capability.hh"1090 5 | #include "reverse-frames.hh"1091 6 | #include "reverse-inbound.hh"1092 7 | #include "reverse-registry.hh"1093 8 | #include "reverse-responses.hh"1094 9 | 1095 10 | int main()1096 11 | {1097 12 | using nixgrpc::Caller;1098 | ^1099../tests/reverse-roundtrip-test.cc:18:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1100 4 | #include "reverse-capability.hh"1101 5 | #include "reverse-frames.hh"1102 6 | #include "reverse-inbound.hh"1103 7 | #include "reverse-registry.hh"1104 8 | #include "reverse-responses.hh"1105 9 | 1106 10 | int main()1107 11 | {1108 12 | using nixgrpc::Caller;1109 13 | using nixgrpc::ReverseCapability;1110 14 | using nixgrpc::ReverseFrames;1111 15 | using nixgrpc::ReverseInbound;1112 16 | using nixgrpc::ReverseRegistry;1113 17 | using nixgrpc::ReverseResponses;1114 18 | using nixgrpc::Role;1115 | ^1116../tests/reverse-roundtrip-test.cc:25:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1117 25 | auto handle = registry.registerWorker(worker, worker, [] {}, *key);1118 | ^1119 | -> void1120../tests/reverse-roundtrip-test.cc:33:91: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1121 33 | "BuildDerivation", writer, "assigned.drv", 42, 0);1122 | ^1123../tests/reverse-roundtrip-test.cc:35:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1124 4 | nix::remote::ReverseOpen start;1125 | ^1126../tests/reverse-roundtrip-test.cc:38:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1127 3 | assert(outgoing.open(1, std::move(start)) && outgoing.data(1, "request bytes") && outgoing.halfClose(1));1128 | ^1129../tests/reverse-roundtrip-test.cc:40:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1130 40 | nix::remote::ReverseFarmMsg toWorker;1131 | ^1132../tests/reverse-roundtrip-test.cc:44:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]1133 44 | nix::remote::BuildDerivationRequest request;1134 | ^1135../tests/reverse-roundtrip-test.cc:46:27: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1136 46 | request.set_assign_id(42);1137 | ^1138../tests/reverse-roundtrip-test.cc:48:27: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1139 48 | request.set_assign_id(43);1140 | ^1141../tests/reverse-roundtrip-test.cc:50:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]1142 50 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::data);1143 | ^1144/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1145 138 | ((__VA_ARGS__) \1146 | ^~~~~~~~~~~1147../tests/reverse-roundtrip-test.cc:51:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]1148 51 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::halfClose);1149 | ^1150/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1151 138 | ((__VA_ARGS__) \1152 | ^~~~~~~~~~~1153../tests/reverse-roundtrip-test.cc:54:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1154 54 | nix::remote::ReverseWorkerMsg fromWorker;1155 | ^1156../tests/reverse-roundtrip-test.cc:58:55: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1157 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1158 | ^1159../tests/reverse-roundtrip-test.cc:58:71: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]1160 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1161 | ^1162../tests/reverse-roundtrip-test.cc:68:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1163 68 | auto replacement = registry.registerWorker(worker, worker, [] {}, *nextKey);1164 | ^1165 | -> void1166>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-capability-test.cc1167../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1168 553 | namespaceClaim && namespaceClaim->is_string()) {1169 | ^1170 | ( != nullptr)1171../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1172 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1173 | ^1174 | ( != nullptr)1175../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1176 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1177 | ^1178../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1179 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1180 | ^1181../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1182 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1183 | ^1184../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1185 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1186 | ^1187 | ( != nullptr)1188../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1189 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1190 | ^1191../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1192 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1193 | ^1194../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]1195 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1196 | ^1197../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]1198 96 | result.push_back(static_cast<char>(size >> (i * 8)));1199 | ^1200../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]1201 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1202 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1203../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1204 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1205 | ^~~~~1206../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1207 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1208 | ^~~~~~~~1209../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]1210 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1211 | ^~~1212../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]1213 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1214 | ^1215../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1216 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1217 | ^1218../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1219 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1220 | ^1221../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]1222 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1223 | ^1224../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1225 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1226 | ^ 1227 | {1228../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]1229 250 | unsigned char mac[EVP_MAX_MD_SIZE];1230 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1231../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1232 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1233 | ~^1234 | (1235 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1236 | == nullptr)1237../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1238 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1239 | ^1240../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]1241 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1242 | ^1243../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1244 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1245 | ^1246../tests/reverse-capability-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1247 7 | int main()1248 | ~~~ ^ 1249 | auto -> int1250../tests/reverse-capability-test.cc:9:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1251 5 | #include "reverse-capability.hh"1252 6 | 1253 7 | int main()1254 8 | {1255 9 | using nixgrpc::Caller;1256 | ^1257../tests/reverse-capability-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1258 5 | #include "reverse-capability.hh"1259 6 | 1260 7 | int main()1261 8 | {1262 9 | using nixgrpc::Caller;1263 10 | using nixgrpc::ReverseCapability;1264 11 | using nixgrpc::Role;1265 | ^1266../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]1267 19 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1268 | ^~~~~~~~~~1269 | const auto *const 1270../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]1271 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1272 | ^1273../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]1274 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1275 | ^1276../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]1277 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1278 | ^1279../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]1280 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1281 | ^1282../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]1283 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1284 | ^1285../tests/reverse-capability-test.cc:25:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1286 5 | nix::remote::ReverseOpen open;1287 | ^1288../tests/reverse-capability-test.cc:31:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]1289 31 | nix::remote::BuildDerivationRequest request;1290 | ^1291../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]1292 33 | request.set_assign_id(93);1293 | ^1294../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]1295 35 | request.set_assign_id(94);1296 | ^1297../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]1298 37 | request.set_assign_id(93);1299 | ^1300../tests/reverse-capability-test.cc:38:40: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1301 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1302 | ^1303../tests/reverse-capability-test.cc:38:55: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors]1304 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1305 | ^1306../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]1307 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1308 | ^1309../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]1310 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1311 | ^1312../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]1313 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1314 | ^1315../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]1316 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1317 | ^1318../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]1319 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1320 | ^1321../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]1322 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1323 | ^1324../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]1325 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1326 | ^1327../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]1328 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1329 | ^1330../tests/reverse-capability-test.cc:75:18: error: no header providing "nix::remote::AddMultipleChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1331 75 | nix::remote::AddMultipleChunk first;1332 | ^1333../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]1334 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1335 | ^1336../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]1337 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1338 | ^1339../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]1340 81 | "abc.drv", 93, 0, now);1341 | ^1342../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]1343 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1344 | ^1345../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]1346 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1347 | ^1348../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]1349 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1350 | ^1351../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]1352 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1353 | ^1354../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]1355 98 | "abc.drv", 93, 0, now);1356 | ^1357../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]1358 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1359 | ^1360../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]1361 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1362 | ^1363../tests/reverse-capability-test.cc:105:24: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors]1364 3 | noRole.role = std::nullopt;1365 | ^1366../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]1367 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1368 | ^1369../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]1370 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1371 | ^1372>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/dispatcher.cc1373../src/daemon/dispatcher.cc:175:24: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1374 175 | if (auto const it = workers.find(static_cast<sched::WorkerId>(wid));1375 | ^1376../src/daemon/dispatcher.cc:576:47: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]1377 576 | revokeOn(*wid, cancel.drv_path(), core.entry(*drv)->assignId);1378 | ^~~~~~~~~~~~~~~~1379../src/daemon/dispatcher.cc:600:33: error: 2 adjacent parameters of 'ownsAssignment' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]1380 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool1381 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1382../src/daemon/dispatcher.cc:600:50: note: the first parameter in the range is 'workerAddr'1383 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool1384 | ^~~~~~~~~~1385../src/daemon/dispatcher.cc:600:79: note: the last parameter in the range is 'drvPath'1386 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool1387 | ^~~~~~~1388../src/daemon/dispatcher.cc:634:16: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1389 634 | auto const it = core.findDrv(drvPath);1390 | ^1391../src/daemon/dispatcher.cc:658:5: error: replace loop by 'std::ranges::any_of()' [readability-use-anyofallof,-warnings-as-errors]1392 658 | for (const auto & [wid, worker] : workers) {1393 | ^1394../src/daemon/dispatcher.cc:666:36: error: 2 adjacent parameters of 'podOwnsAssignment' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]1395 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool1396 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1397../src/daemon/dispatcher.cc:666:53: note: the first parameter in the range is 'podId'1398 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool1399 | ^~~~~1400../src/daemon/dispatcher.cc:666:77: note: the last parameter in the range is 'drvPath'1401 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool1402 | ^~~~~~~1403../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]1404 12 | #include <chrono>1405 | 1406 13 | #include <chrono>1407 | ^~~~~~~~~~~~~~~~~1408../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]1409 90 | std::chrono::system_clock::time_point credentialExpiresAt{};1410 | ^~1411../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]1412 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();1413 | ^1414../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1415 371 | auto const it = workerIds.find(std::string(addr));1416 | ^1417>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-upload-test.cc1418../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1419 553 | namespaceClaim && namespaceClaim->is_string()) {1420 | ^1421 | ( != nullptr)1422../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1423 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1424 | ^1425 | ( != nullptr)1426../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1427 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1428 | ^1429../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1430 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1431 | ^1432../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1433 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1434 | ^1435../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1436 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1437 | ^1438 | ( != nullptr)1439../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1440 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1441 | ^1442../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1443 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1444 | ^1445../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]1446 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1447 | ^1448../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]1449 96 | result.push_back(static_cast<char>(size >> (i * 8)));1450 | ^1451../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]1452 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1453 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1454../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1455 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1456 | ^~~~~1457../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1458 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1459 | ^~~~~~~~1460../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]1461 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1462 | ^~~1463../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]1464 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1465 | ^1466../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1467 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1468 | ^1469../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1470 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1471 | ^1472../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]1473 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1474 | ^1475../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1476 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1477 | ^ 1478 | {1479../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]1480 250 | unsigned char mac[EVP_MAX_MD_SIZE];1481 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1482../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1483 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1484 | ~^1485 | (1486 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1487 | == nullptr)1488../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1489 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1490 | ^1491../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]1492 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1493 | ^1494../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1495 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1496 | ^1497../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]1498 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1499 | ^1500../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1501 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1502 | ^~~~~~~~~1503 | static_cast<const size_t>( )1504../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1505 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1506 | ^~1507 | static_cast<long>( )1508../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]1509 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1510 | ^1511../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1512 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1513 | ^~~~~~~~~~~~~~~1514 | static_cast<const size_t>( )1515../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1516 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1517 | ^~~~~~~~1518 | static_cast<long>( )1519../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]1520 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1521 | ^1522../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]1523 53 | auto data(uint64_t id, std::string_view bytes) -> bool1524 | ^1525../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]1526 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1527 | ^1528../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]1529 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1530 | ^1531../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]1532 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1533 | ^1534 | const &1535../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1536 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1537 | ^ 1538 | {1539../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1540 81 | if (size > limit) return false;1541 | ^ 1542 | {1543../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1544 83 | cv.wait(lock, stop, [&] {1545 | ^1546 | -> bool1547../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]1548 84 | auto it = streams.find(id);1549 | ^1550../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]1551 87 | auto const it = streams.find(id);1552 | ^1553../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1554 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1555 | ^ 1556 | {1557../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]1558 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1559 | ^1560../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]1561 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1562 | ^1563../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]1564 96 | auto acknowledge(uint64_t id) -> bool1565 | ^1566../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1567 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1568 | ^ 1569 | {1570../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1571 105 | if (!enqueue(std::move(msg))) return false;1572 | ^ 1573 | {1574../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]1575 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1576 | ^1577 | const &1578../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1579 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1580 | ^1581 | -> bool1582../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]1583 145 | auto finished(uint64_t id) -> bool1584 | ^1585../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1586 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1587 | ^ 1588 | {1589../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1590 150 | if (removed) cv.notify_all();1591 | ^ 1592 | {1593../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]1594 156 | void acknowledgementSent(uint64_t id)1595 | ^1596../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1597 159 | if (acknowledged.erase(id)) streams.erase(id);1598 | ^ 1599 | != 0u1600../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1601 159 | if (acknowledged.erase(id)) streams.erase(id);1602 | ^ 1603 | {1604../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]1605 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1606 | ^1607../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]1608 208 | auto terminal(uint64_t id, bool abort) -> bool1609 | ^1610../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]1611 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1612 | ^1613../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]1614 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1615 | ^1616 | -> bool1617../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]1618 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1619 | ^1620../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1621 33 | if (assigned && !assigned()) return false;1622 | ^ 1623 | {1624../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]1625 35 | std::scoped_lock lock(mutex);1626 | ^1627 | const 1628../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1629 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;1630 | ^ 1631 | {1632../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1633 42 | if (!ok) cancel();1634 | ^ 1635 | {1636../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]1637 49 | std::scoped_lock lock(mutex);1638 | ^1639 | const 1640../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1641 68 | if (closed) return false;1642 | ^ 1643 | {1644../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1645 79 | if (ended || !chunks.empty()) break;1646 | ^ 1647 | {1648../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]1649 80 | cv.wait_for(lock, std::chrono::milliseconds(25));1650 | ^1651../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1652 82 | if (chunks.empty()) return false;1653 | ^ 1654 | {1655../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]1656 92 | std::scoped_lock lock(mutex);1657 | ^1658 | const 1659../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]1660 103 | cv.wait_for(lock, std::chrono::milliseconds(25));1661 | ^1662../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1663 113 | if (!ended || closed || !chunks.empty()) return false;1664 | ^ 1665 | {1666../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]1667 120 | std::scoped_lock lock(mutex);1668 | ^1669 | const 1670../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]1671 129 | std::scoped_lock lock(mutex);1672 | ^1673 | const 1674../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]1675 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1676 | ^1677../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning1678 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1679 | ^~~~~~~~~~~1680 | static_cast<const size_t>( )1681../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type1682 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1683 | ^~~~1684 | static_cast<long>( )1685../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1686 49 | if (failed || bytes.empty() || !consume) return fail();1687 | ^ 1688 | {1689../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]1690 53 | buffer.append(bytes.data(), count);1691 | ~~~~~~^~~~1692../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1693 57 | for (unsigned i = 0; i < 4; ++i)1694 | ^1695 | {1696 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1697 | 1698../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]1699 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1700 | ^~~1701../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]1702 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1703 | ^1704../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1705 59 | if (length == 0 || length > maxChunkBytes) return fail();1706 | ^ 1707 | {1708../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1709 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))1710 | ^1711../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1712 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))1713 | ^1714 | {1715 66 | return fail();1716 | 1717../tests/reverse-upload-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1718 7 | int main()1719 | ~~~ ^ 1720 | auto -> int1721../tests/reverse-upload-test.cc:9:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]1722 4 | #include "reverse-upload.hh"1723 5 | #include "reverse-upload-pipe.hh"1724 6 | 1725 7 | int main()1726 8 | {1727 9 | auto key = nixgrpc::ReverseCapability::newKey();1728 | ^1729../tests/reverse-upload-test.cc:12:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1730 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1731 | ^1732 | const 1733../tests/reverse-upload-test.cc:12:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1734 4 | #include "reverse-upload.hh"1735 5 | #include "reverse-upload-pipe.hh"1736 6 | 1737 7 | int main()1738 8 | {1739 9 | auto key = nixgrpc::ReverseCapability::newKey();1740 10 | assert(key);1741 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1742 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1743 | ^1744../tests/reverse-upload-test.cc:12:63: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1745 4 | #include "reverse-upload.hh"1746 5 | #include "reverse-upload-pipe.hh"1747 6 | 1748 7 | int main()1749 8 | {1750 9 | auto key = nixgrpc::ReverseCapability::newKey();1751 10 | assert(key);1752 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1753 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1754 | ^1755../tests/reverse-upload-test.cc:14:116: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1756 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);1757 | ^1758../tests/reverse-upload-test.cc:19:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1759 4 | #include "reverse-upload.hh"1760 5 | #include "reverse-upload-pipe.hh"1761 6 | 1762 7 | int main()1763 8 | {1764 9 | auto key = nixgrpc::ReverseCapability::newKey();1765 10 | assert(key);1766 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1767 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1768 13 | .kind = nixgrpc::Caller::Kind::named};1769 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);1770 15 | assert(token);1771 16 | auto delegated = nixgrpc::ReverseCapability::verify(*key, *token, worker, 1, 1, "UploadBuildInputs");1772 17 | assert(delegated);1773 18 | 1774 19 | nix::remote::UploadBuildInputsChunk first;1775 | ^1776../tests/reverse-upload-test.cc:21:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1777 21 | first.set_assign_id(42);1778 | ^1779../tests/reverse-upload-test.cc:24:25: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1780 24 | first.set_assign_id(43);1781 | ^1782../tests/reverse-upload-test.cc:26:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1783 26 | first.set_assign_id(42);1784 | ^1785../tests/reverse-upload-test.cc:39:24: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1786 39 | next.set_assign_id(42);1787 | ^1788../tests/reverse-upload-test.cc:52:119: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1789 52 | auto buildToken = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42);1790 | ^1791../tests/reverse-upload-test.cc:62:50: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1792 62 | follow.mutable_chunk()->set_data(std::string(70000, 'z'));1793 | ^1794../tests/reverse-upload-test.cc:65:41: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1795 2 | auto const length = static_cast<uint32_t>(part.size());1796 | ^1797../tests/reverse-upload-test.cc:66:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1798 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1799 | ^ 1800 | {1801../tests/reverse-upload-test.cc:66:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1802 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1803 | ^1804../tests/reverse-upload-test.cc:66:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1805 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1806 | ^1807../tests/reverse-upload-test.cc:70:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]1808 2 | size_t count = 0;1809 | ^1810../tests/reverse-upload-test.cc:71:20: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1811 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {1812 | ^1813 | -> bool1814../tests/reverse-upload-test.cc:71:63: error: rvalue reference parameter 'part' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]1815 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {1816 | ^1817../tests/reverse-upload-test.cc:73:93: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1818 73 | return count == 1 ? part.chunk().data() == "header" : part.chunk().data().size() == 70000;1819 | ^1820../tests/reverse-upload-test.cc:75:61: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1821 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)1822 | ^1823../tests/reverse-upload-test.cc:75:67: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1824 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)1825 | ^1826 | {1827 76 | assert(decoder.feed(std::string_view(wire).substr(offset, 16381), consume));1828 | 1829../tests/reverse-upload-test.cc:86:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1830 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));1831 | ^1832 | -> bool1833/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1834 138 | ((__VA_ARGS__) \1835 | ^1836../tests/reverse-upload-test.cc:86:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]1837 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));1838 | ^1839../tests/reverse-upload-test.cc:89:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1840 89 | follow.set_assign_id(42);1841 | ^1842../tests/reverse-upload-test.cc:91:5: error: variable 'wireNext' of type 'std::string' (aka 'basic_string<char>') can be declared 'const' [misc-const-correctness,-warnings-as-errors]1843 91 | std::string wireNext = follow.SerializeAsString();1844 | ^1845 | const 1846../tests/reverse-upload-test.cc:95:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1847 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1848 | ^ 1849 | {1850../tests/reverse-upload-test.cc:95:92: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1851 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1852 | ^1853../tests/reverse-upload-test.cc:95:102: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1854 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1855 | ^1856../tests/reverse-upload-test.cc:98:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1857 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));1858 | ^1859 | -> bool1860/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1861 138 | ((__VA_ARGS__) \1862 | ^1863../tests/reverse-upload-test.cc:98:82: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]1864 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));1865 | ^1866../tests/reverse-upload-test.cc:106:53: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1867 106 | largePart.mutable_chunk()->set_data(std::string(70000, 'z'));1868 | ^1869../tests/reverse-upload-test.cc:108:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1870 108 | auto push = [&](std::string_view data) {1871 | ^1872 | -> void1873../tests/reverse-upload-test.cc:111:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1874 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1875 | ^ 1876 | {1877../tests/reverse-upload-test.cc:111:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1878 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1879 | ^1880../tests/reverse-upload-test.cc:111:99: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1881 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1882 | ^1883../tests/reverse-upload-test.cc:113:67: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1884 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)1885 | ^1886../tests/reverse-upload-test.cc:113:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1887 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)1888 | ^1889 | {1890 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1891 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1892 | 1893../tests/reverse-upload-test.cc:114:13: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors]1894 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1895 | ^1896../tests/reverse-upload-test.cc:114:20: error: side effects in the 1st macro argument '__VA_ARGS__' are repeated in macro expansion [bugprone-macro-repeated-side-effects,-warnings-as-errors]1897 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1898 | ^1899/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:137:13: note: macro 'assert' defined here1900 137 | # define assert(...) \1901 | ^1902../tests/reverse-upload-test.cc:115:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1903 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1904 | ^1905 | -> bool1906/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1907 138 | ((__VA_ARGS__) \1908 | ^1909../tests/reverse-upload-test.cc:115:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]1910 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1911 | ^1912../tests/reverse-upload-test.cc:118:28: error: 70 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1913 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);1914 | ^1915../tests/reverse-upload-test.cc:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1916 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);1917 | ^ 1918 | {1919../tests/reverse-upload-test.cc:125:18: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1920 125 | auto frame = [](const nix::remote::UploadBuildInputsChunk & chunk) {1921 | ^1922 | -> std::string1923../tests/reverse-upload-test.cc:129:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1924 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1925 | ^ 1926 | {1927../tests/reverse-upload-test.cc:129:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1928 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1929 | ^1930../tests/reverse-upload-test.cc:129:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1931 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1932 | ^1933../tests/reverse-upload-test.cc:136:28: error: 80 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1934 136 | for (size_t i = 0; i < 80; ++i) {1935 | ^1936>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-inbound-test.cc1937../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1938 553 | namespaceClaim && namespaceClaim->is_string()) {1939 | ^1940 | ( != nullptr)1941../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1942 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1943 | ^1944 | ( != nullptr)1945../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1946 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1947 | ^1948../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1949 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1950 | ^1951../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1952 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1953 | ^1954../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1955 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1956 | ^1957 | ( != nullptr)1958../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1959 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1960 | ^1961../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1962 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1963 | ^1964../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]1965 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1966 | ^1967../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]1968 96 | result.push_back(static_cast<char>(size >> (i * 8)));1969 | ^1970../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]1971 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1972 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1973../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1974 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1975 | ^~~~~1976../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1977 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1978 | ^~~~~~~~1979../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]1980 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1981 | ^~~1982../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]1983 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1984 | ^1985../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1986 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1987 | ^1988../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1989 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1990 | ^1991../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]1992 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1993 | ^1994../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1995 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1996 | ^ 1997 | {1998../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]1999 250 | unsigned char mac[EVP_MAX_MD_SIZE];2000 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~loading 8,466 hidden lines…
10467../src/daemon/reverse-relay.hh:131:75: note: +110468 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10469 | ^10470../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 310471 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};10472 | ^10473../src/daemon/reverse-relay.hh:133:38: note: +110474 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};10475 | ^10476../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 310477 134 | if (resultReceived && resultReceived()) {10478 | ^10479../src/daemon/reverse-relay.hh:134:36: note: +110480 134 | if (resultReceived && resultReceived()) {10481 | ^10482../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 410483 135 | if (beforeAck) beforeAck();10484 | ^10485../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 410486 136 | if (!transport.outgoing.acknowledge(id))10487 | ^10488../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 210489 143 | while (true) {10490 | ^10491../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 310492 144 | if (!expected) {10493 | ^10494../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 410495 145 | if (pending.size() < 4) break;10496 | ^10497../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 410498 147 | for (unsigned i = 0; i != 4; ++i)10499 | ^10500../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 410501 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};10502 | ^10503../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 310504 153 | if (pending.size() < *expected) break;10505 | ^10506../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 310507 154 | if (!receive(std::string_view(pending).substr(0, *expected)))10508 | ^10509../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 210510 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};10511 | ^10512../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 110513 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};10514 | ^10515../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 110516 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};10517 | ^10518../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 110519 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10520 | ^10521../src/daemon/reverse-relay.hh:163:47: note: +110522 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10523 | ^10524../src/daemon/reverse-relay.hh:163:67: note: +110525 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10526 | ^10527../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10528 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};10529 | ^ 10530 | {10531../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10532 56 | if (!selection.status.ok()) return selection.status;10533 | ^ 10534 | {10535../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10536 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};10537 | ^ 10538 | {10539../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10540 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};10541 | ^ 10542 | {10543../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10544 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};10545 | ^ 10546 | {10547../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]10548 61 | auto const id = session->transport->nextStreamId.fetch_add(1);10549 | ^10550../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10551 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};10552 | ^ 10553 | {10554../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10555 64 | if (!selection.status.ok()) return selection.status;10556 | ^ 10557 | {10558../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10559 65 | if (!selection.prepared || selection.prepared->session != session)10560 | ^10561 | {10562 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};10563 | 10564../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10565 67 | if (request.ByteSizeLong() > maxRequestBytes)10566 | ^10567 | {10568 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};10569 | 10570../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10571 70 | if (bytes.size() > maxRequestBytes)10572 | ^10573 | {10574 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};10575 | 10576../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10577 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};10578 | ^ 10579 | {10580../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10581 75 | if (!status.ok()) return status;10582 | ^ 10583 | {10584../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]10585 77 | struct Release {10586 | ^10587../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]10588 77 | struct Release {10589 | ^10590 78 | ReverseTransport & transport;10591 79 | uint64_t id;10592 | 10593 | {}10594../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]10595 78 | ReverseTransport & transport;10596 | ^10597../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10598 84 | if (!completed) (void) transport.outgoing.cancel(id);10599 | ^ 10600 | {10601../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10602 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));10603 | ^ 10604 | {10605../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]10606 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));10607 | ^10608../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]10609 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));10610 | ^10611../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10612 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};10613 | ^ 10614 | {10615../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10616 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))10617 | ^10618 | {10619 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};10620 | 10621../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10622 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))10623 | ^10624 | {10625 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};10626 | 10627../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10628 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};10629 | ^ 10630 | {10631../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10632 111 | std::jthread monitor([&](std::stop_token stop) {10633 | ^10634 | -> auto10635../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]10636 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });10637 | ^10638../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10639 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });10640 | ^10641 | -> auto10642../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10643 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};10644 | ^ 10645 | {10646../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10647 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))10648 | ^10649 | {10650 128 | return {grpc::StatusCode::UNAVAILABLE,10651 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};10652 | 10653../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10654 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10655 | ^10656 | {10657 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};10658 | 10659../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10660 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};10661 | ^ 10662 | {10663../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10664 135 | if (beforeAck) beforeAck();10665 | ^ 10666 | {10667../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10668 136 | if (!transport.outgoing.acknowledge(id))10669 | ^10670 | {10671 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};10672 | 10673../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10674 145 | if (pending.size() < 4) break;10675 | ^ 10676 | {10677../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10678 147 | for (unsigned i = 0; i != 4; ++i)10679 | ^10680 | {10681 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);10682 | 10683../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]10684 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);10685 | ^~~10686../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]10687 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);10688 | ^10689../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10690 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};10691 | ^ 10692 | {10693../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10694 153 | if (pending.size() < *expected) break;10695 | ^ 10696 | {10697../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10698 154 | if (!receive(std::string_view(pending).substr(0, *expected)))10699 | ^10700 | {10701 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};10702 | 10703../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10704 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};10705 | ^ 10706 | {10707../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10708 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};10709 | ^ 10710 | {10711../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10712 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};10713 | ^ 10714 | {10715../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10716 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))10717 | ^10718 | {10719 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};10720 | 10721../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]10722 169 | ReverseGateway & gateway;10723 | ^10724../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]10725 170 | ReverseRegistry & registry;10726 | ^10727../src/daemon/reverse-request.hh:24:12: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]10728 24 | struct Ready10729 | ^10730 25 | {10731 26 | uint64_t id;10732 | 10733 | {}10734../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]10735 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool10736 | ^10737../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 110738 52 | if (!event) { rejection = inbound.lastRejection(); return false; }10739 | ^10740../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 110741 54 | switch (event->kind) {10742 | ^10743../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 210744 56 | if (!event->caller) { rejection = "open without caller"; return false; }10745 | ^10746../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 210747 59 | if (frame.open().method() == "UploadBuildInputs") {10748 | ^10749../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 310750 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {10751 | ^10752../src/daemon/reverse-request.hh:61:30: note: +110753 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {10754 | ^10755../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 310756 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {10757 | ^10758../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 210759 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }10760 | ^10761../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 210762 77 | if (auto it = uploads.find(id); it != uploads.end())10763 | ^10764../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 210765 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 410766 | ^10767../src/daemon/reverse-request.hh:82:17: note: +110768 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }10769 | ^10770../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 210771 84 | if (!pending.length && pending.wire.size() >= 4) {10772 | ^10773../src/daemon/reverse-request.hh:84:33: note: +110774 84 | if (!pending.length && pending.wire.size() >= 4) {10775 | ^10776../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 310777 86 | for (unsigned i = 0; i != 4; ++i)10778 | ^10779../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 310780 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }10781 | ^10782../src/daemon/reverse-request.hh:91:36: note: +110783 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;10784 | ^10785../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 210786 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();10787 | ^10788../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 210789 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {10790 | ^10791../src/daemon/reverse-request.hh:96:60: note: +110792 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {10793 | ^10794../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 210795 108 | if (auto it = uploads.find(id); it != uploads.end()) {10796 | ^10797../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 210798 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();10799 | ^10800../src/daemon/reverse-request.hh:112:29: note: +110801 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();10802 | ^10803../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 210804 114 | if (ready && ready->id == id) ready.reset();10805 | ^10806../src/daemon/reverse-request.hh:114:23: note: +110807 114 | if (ready && ready->id == id) ready.reset();10808 | ^10809../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]10810 48 | std::scoped_lock lock(mutex);10811 | ^10812 | const 10813../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]10814 53 | auto const id = event->streamId;10815 | ^10816../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10817 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {10818 | ^10819 | -> bool10820../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]10821 77 | if (auto it = uploads.find(id); it != uploads.end())10822 | ^10823../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10824 77 | if (auto it = uploads.find(id); it != uploads.end())10825 | ^10826 | {10827 78 | return it->second->feed(frame.data().data());10828 | 10829../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10830 86 | for (unsigned i = 0; i != 4; ++i)10831 | ^10832 | {10833 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);10834 | 10835../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]10836 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);10837 | ^~~10838../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]10839 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);10840 | ^10841../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]10842 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();10843 | ^10844../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10845 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();10846 | ^ 10847 | {10848../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]10849 95 | auto it = requests.find(id);10850 | ^10851../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]10852 108 | if (auto it = uploads.find(id); it != uploads.end()) {10853 | ^10854../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10855 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();10856 | ^ 10857 | {10858../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10859 114 | if (ready && ready->id == id) ready.reset();10860 | ^ 10861 | {10862../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]10863 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }10864 | ^10865 | const 10866../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]10867 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }10868 | ^10869 | const 10870../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]10871 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }10872 | ^10873 | const 10874../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]10875 130 | std::scoped_lock lock(mutex);10876 | ^10877 | const 10878../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]10879 131 | for (auto & [id, pipe] : uploads) pipe->cancel();10880 | ^10881../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10882 131 | for (auto & [id, pipe] : uploads) pipe->cancel();10883 | ^ 10884 | {10885../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]10886 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {10887 | ^10888../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]10889 142 | std::scoped_lock lock(mutex);10890 | ^10891 | const 10892../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]10893 148 | std::scoped_lock lock(mutex);10894 | ^10895 | const 10896../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]10897 149 | for (auto & [id, pipe] : uploads) pipe->cancel();10898 | ^10899../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10900 149 | for (auto & [id, pipe] : uploads) pipe->cancel();10901 | ^ 10902 | {10903../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]10904 32 | [[nodiscard]] auto open(uint64_t id) -> bool10905 | ^10906../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]10907 51 | auto it = streams.find(frame.stream_id());10908 | ^10909../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10910 56 | if (!cancelled.contains(frame.stream_id())) return false;10911 | ^ 10912 | {10913../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10914 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;10915 | ^ 10916 | {10917../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]10918 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool10919 | ^10920../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]10921 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool10922 | ^10923 | const &10924../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10925 104 | auto pending = [&] {10926 | ^10927 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>10928../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]10929 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });10930 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~10931 | std::ranges::find_if queue10932../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10933 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });10934 | ^10935 | -> auto10936../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10937 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });10938 | ^10939 | -> bool10940../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]10941 111 | auto it = pending();10942 | ^10943../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]10944 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool10945 | ^10946../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10947 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);10948 | ^ 10949 | {10950../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]10951 168 | [[nodiscard]] auto finished(uint64_t id) -> bool10952 | ^10953../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]10954 171 | auto it = streams.find(id);10955 | ^10956../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]10957 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10958 | ^10959../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]10960 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10961 | ^10962 | -> bool10963../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]10964 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10965 | ^10966../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10967 33 | if (assigned && !assigned()) return false;10968 | ^ 10969 | {10970../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]10971 35 | std::scoped_lock lock(mutex);10972 | ^10973 | const 10974../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10975 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;10976 | ^ 10977 | {10978../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10979 42 | if (!ok) cancel();10980 | ^ 10981 | {10982../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]10983 49 | std::scoped_lock lock(mutex);10984 | ^10985 | const 10986../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10987 68 | if (closed) return false;10988 | ^ 10989 | {10990../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10991 79 | if (ended || !chunks.empty()) break;10992 | ^ 10993 | {10994../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]10995 80 | cv.wait_for(lock, std::chrono::milliseconds(25));10996 | ^10997../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10998 82 | if (chunks.empty()) return false;10999 | ^ 11000 | {11001../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]11002 92 | std::scoped_lock lock(mutex);11003 | ^11004 | const 11005../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]11006 103 | cv.wait_for(lock, std::chrono::milliseconds(25));11007 | ^11008../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11009 113 | if (!ended || closed || !chunks.empty()) return false;11010 | ^ 11011 | {11012../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]11013 120 | std::scoped_lock lock(mutex);11014 | ^11015 | const 11016../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]11017 129 | std::scoped_lock lock(mutex);11018 | ^11019 | const 11020../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]11021 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11022 | ^11023../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning11024 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11025 | ^~~~~~~~~~~11026 | static_cast<const size_t>( )11027../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type11028 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11029 | ^~~~11030 | static_cast<long>( )11031../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11032 49 | if (failed || bytes.empty() || !consume) return fail();11033 | ^ 11034 | {11035../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]11036 53 | buffer.append(bytes.data(), count);11037 | ~~~~~~^~~~11038../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11039 57 | for (unsigned i = 0; i < 4; ++i)11040 | ^11041 | {11042 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11043 | 11044../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]11045 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11046 | ^~~11047../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]11048 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11049 | ^11050../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11051 59 | if (length == 0 || length > maxChunkBytes) return fail();11052 | ^ 11053 | {11054../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11055 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))11056 | ^11057../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11058 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))11059 | ^11060 | {11061 66 | return fail();11062 | 11063../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]11064 26 | [[nodiscard]] auto message(uint64_t id, const nix::remote::BuildDerivationChunk & chunk,11065 | ^11066../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]11067 27 | std::stop_token stop, const std::function<bool()> & cancelled = {}) -> bool11068 | ^11069 | const &11070../src/daemon/reverse-worker.hh:30:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11071 30 | if (size > ReverseRelay::maxMessageBytes) return false;11072 | ^ 11073 | {11074../src/daemon/reverse-worker.hh:32:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11075 32 | if (wire.size() > ReverseRelay::maxMessageBytes) return false;11076 | ^ 11077 | {11078../src/daemon/reverse-worker.hh:36:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11079 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11080 | ^ 11081 | {11082../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]11083 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11084 | ^11085../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]11086 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));11087 | ^11088../src/daemon/reverse-worker.hh:42:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11089 42 | if (!push(std::move(frame), stop, cancelled)) return false;11090 | ^ 11091 | {11092../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]11093 47 | [[nodiscard]] auto finish(uint64_t id, const grpc::Status & status, std::stop_token stop,11094 | ^11095../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]11096 53 | frame.mutable_finish()->set_message(status.error_message().substr(0, 1024));11097 | ^11098../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]11099 16 | return push(std::move(frame), stop, {}, waitForSpace, std::move(afterAck));11100 | ^ 11101 | std::move( )11102../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]11103 67 | [[nodiscard]] auto take(nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool11104 | ^11105 | const &11106../src/daemon/reverse-worker.hh:70:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11107 70 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });11108 | ^11109 | -> bool11110../src/daemon/reverse-worker.hh:71:62: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11111 71 | if (closed || stop.stop_requested() || queue.empty()) return false;11112 | ^ 11113 | {11114../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]11115 79 | [[nodiscard]] auto acknowledged(uint64_t id) -> bool11116 | ^11117../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]11118 83 | std::scoped_lock lock(mutex);11119 | ^11120 | const 11121../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]11122 84 | auto it = afterAcks.find(id);11123 | ^11124../src/daemon/reverse-worker.hh:85:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11125 85 | if (it == afterAcks.end()) return false;11126 | ^ 11127 | {11128../src/daemon/reverse-worker.hh:89:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11129 89 | if (completion) completion();11130 | ^ 11131 | {11132../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]11133 95 | std::scoped_lock lock(mutex);11134 | ^11135 | const 11136../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]11137 108 | std::scoped_lock lock(mutex);11138 | ^11139 | const 11140../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]11141 111 | for (auto & [id, complete] : pending) {11142 | ^11143../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]11144 117 | void cancel(uint64_t id)11145 | ^11146../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]11147 119 | std::scoped_lock lock(mutex);11148 | ^11149 | const 11150../src/daemon/reverse-worker.hh:134:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11151 134 | } else ++it;11152 | ^ 11153 | {11154../src/daemon/reverse-worker.hh:134:19: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors]11155 134 | } else ++it;11156 | ^ 11157 | {11158../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]11159 141 | std::scoped_lock lock(mutex);11160 | ^11161 | const 11162../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]11163 146 | [[nodiscard]] auto push(nix::remote::ReverseWorkerMsg frame, std::stop_token stop,11164 | ^11165 | const &11166../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]11167 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false;11168 | ^11169../src/daemon/reverse-worker.hh:151:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11170 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false;11171 | ^ 11172 | {11173../src/daemon/reverse-worker.hh:155:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11174 155 | && (!cancelled || !cancelled()))11175 | ^11176 | {11177 156 | cv.wait_for(lock, std::chrono::milliseconds(25));11178 | 11179../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]11180 156 | cv.wait_for(lock, std::chrono::milliseconds(25));11181 | ^11182../src/daemon/reverse-worker.hh:159:43: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11183 159 | || (cancelled && cancelled())) return false;11184 | ^ 11185 | {11186../src/daemon/reverse-worker.hh:162:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11187 162 | || !afterAcks.emplace(frame.stream_id(), std::move(afterAck)).second) return false;11188 | ^ 11189 | {11190../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]11191 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();11192 | ^11193../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11194 371 | auto const it = workerIds.find(std::string(addr));11195 | ^11196>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/main.cc11197../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]11198 12 | #include <chrono>11199 | 11200 13 | #include <chrono>11201 | ^~~~~~~~~~~~~~~~~11202../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]11203 90 | std::chrono::system_clock::time_point credentialExpiresAt{};11204 | ^~11205../src/daemon/main.cc:354:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11206 354 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) {11207 | ^11208 | -> bool11209../src/daemon/main.cc:367:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]11210 15 | const std::function<bool()> & cancelled,11211 | ^11212../src/daemon/main.cc:378:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11213 378 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status;11214 | ^ 11215 | {11216../src/daemon/main.cc:382:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11217 382 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"};11218 | ^ 11219 | {11220../src/daemon/main.cc:383:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11221 383 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"};11222 | ^ 11223 | {11224../src/daemon/main.cc:384:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11225 384 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"};11226 | ^ 11227 | {11228../src/daemon/main.cc:387:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11229 387 | nix::StorePath drvPath(request.drv_path());11230 | ^11231 | const 11232../src/daemon/main.cc:391:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11233 391 | auto const sendLog = [&](nixgrpc::BuildEvent event) {11234 | ^11235 | -> void11236../src/daemon/main.cc:392:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11237 392 | if (!emit(nixgrpc::toChunk<nix::remote::BuildDerivationChunk>(std::move(event))))11238 | ^11239 | {11240 393 | throw nixgrpc::CancelledWait("reverse build response closed");11241 | 11242../src/daemon/main.cc:401:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11243 401 | auto const retireUnacknowledged = [&] {11244 | ^11245 | -> void11246../src/daemon/main.cc:402:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11247 402 | if (afterFinish) std::exchange(afterFinish, nullptr)();11248 | ^ 11249 | {11250../src/daemon/main.cc:414:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11251 414 | if (status.ok() && !emit(chunk))11252 | ^11253 | {11254 415 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"};11255 | 11256../src/daemon/main.cc:416:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11257 416 | if (!status.ok()) retireUnacknowledged();11258 | ^ 11259 | {11260../src/daemon/main.cc:421:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11261 421 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call,11262 | ^11263../src/daemon/main.cc:424:24: note: nesting level increased to 111264 424 | return guarded([&] -> grpc::Status {11265 | ^11266../src/daemon/main.cc:425:13: note: +2, including nesting penalty of 1, nesting level increased to 211267 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11268 | ^11269../src/daemon/main.cc:425:32: note: +111270 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11271 | ^11272../src/daemon/main.cc:428:13: note: +2, including nesting penalty of 1, nesting level increased to 211273 428 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs",11274 | ^11275../src/daemon/main.cc:430:31: note: nesting level increased to 211276 430 | auto const live = [&] {11277 | ^11278../src/daemon/main.cc:432:21: note: +111279 432 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId);11280 | ^11281../src/daemon/main.cc:434:13: note: +2, including nesting penalty of 1, nesting level increased to 211282 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11283 | ^11284../src/daemon/main.cc:436:13: note: +2, including nesting penalty of 1, nesting level increased to 211285 436 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first)11286 | ^11287../src/daemon/main.cc:437:17: note: +111288 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11289 | ^11290../src/daemon/main.cc:438:48: note: +2, including nesting penalty of 1, nesting level increased to 211291 438 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair;11292 | ^11293../src/daemon/main.cc:439:55: note: +2, including nesting penalty of 1, nesting level increased to 211294 439 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs;11295 | ^11296../src/daemon/main.cc:458:17: note: nesting level increased to 211297 458 | CheckedSource(nix::Source & inner, std::function<bool()> valid)11298 | ^11299../src/daemon/main.cc:464:17: note: nesting level increased to 211300 464 | auto read(char * data, size_t length) -> size_t override {11301 | ^11302../src/daemon/main.cc:465:21: note: +3, including nesting penalty of 2, nesting level increased to 311303 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11304 | ^11305../src/daemon/main.cc:471:21: note: +3, including nesting penalty of 2, nesting level increased to 311306 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11307 | ^11308../src/daemon/main.cc:449:19: note: nesting level increased to 211309 449 | class CheckedSource : public nix::Source {11310 | ^11311../src/daemon/main.cc:449:19: note: nesting level increased to 211312../src/daemon/main.cc:449:19: note: nesting level increased to 211313../src/daemon/main.cc:449:19: note: nesting level increased to 211314../src/daemon/main.cc:449:19: note: nesting level increased to 211315../src/daemon/main.cc:483:68: note: +2, including nesting penalty of 1, nesting level increased to 211316 483 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair,11317 | ^11318../src/daemon/main.cc:484:68: note: +2, including nesting penalty of 1, nesting level increased to 211319 484 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs,11320 | ^11321../src/daemon/main.cc:485:17: note: nesting level increased to 211322 485 | [&] { return !live(); }, imported,11323 | ^11324../src/daemon/main.cc:486:17: note: nesting level increased to 211325 486 | [&] {11326 | ^11327../src/daemon/main.cc:493:21: note: +3, including nesting penalty of 2, nesting level increased to 311328 493 | if (!call.pipe->endWithoutTrailingData() || !live())11329 | ^11330../src/daemon/main.cc:493:62: note: +111331 493 | if (!call.pipe->endWithoutTrailingData() || !live())11332 | ^11333../src/daemon/main.cc:497:56: note: nesting level increased to 211334 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11335 | ^11336../src/daemon/main.cc:498:13: note: +2, including nesting penalty of 1, nesting level increased to 211337 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11338 | ^11339../src/daemon/main.cc:425:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11340 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11341 | ^11342../src/daemon/main.cc:426:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11343 426 | call.delegated.drvPath, call.delegated.assignId))11344 | ^11345 | {11346 427 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};11347 | 11348../src/daemon/main.cc:429:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11349 429 | nixgrpc::Role::write); !status.ok()) return status;11350 | ^ 11351 | {11352../src/daemon/main.cc:430:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11353 430 | auto const live = [&] {11354 | ^11355 | -> bool11356../src/daemon/main.cc:434:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11357 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11358 | ^ 11359 | {11360../src/daemon/main.cc:437:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11361 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11362 | ^ 11363 | {11364../src/daemon/main.cc:441:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11365 89 | nixgrpc::ZstdReaderSource<nixgrpc::ReverseUploadPipe, nix::remote::AddMultipleChunk> source(11366 | ^11367../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]11368 450 | nix::Source & inner;11369 | ^11370../src/daemon/main.cc:465:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11371 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11372 | ^ 11373 | {11374../src/daemon/main.cc:471:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11375 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11376 | ^ 11377 | {11378../src/daemon/main.cc:485:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11379 485 | [&] { return !live(); }, imported,11380 | ^11381 | -> bool11382../src/daemon/main.cc:486:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11383 486 | [&] {11384 | ^11385 | -> void11386../src/daemon/main.cc:493:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11387 493 | if (!call.pipe->endWithoutTrailingData() || !live())11388 | ^11389 | {11390 494 | throw nix::Error("reverse upload incomplete or assignment changed");11391 | 11392../src/daemon/main.cc:497:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11393 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11394 | ^11395 | -> bool11396../src/daemon/main.cc:498:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11397 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11398 | ^ 11399 | {11400../src/daemon/main.cc:641:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11401 641 | if (beforeApply) beforeApply();11402 | ^ 11403 | {11404../src/daemon/main.cc:650:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11405 650 | if (beforeApply) beforeApply();11406 | ^ 11407 | {11408../src/daemon/main.cc:652:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11409 652 | if (beforeApply) beforeApply();11410 | ^ 11411 | {11412../src/daemon/main.cc:716:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11413 716 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder)11414 | ^11415 | {11416 717 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"};11417 | 11418../src/daemon/main.cc:719:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11419 719 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"};11420 | ^ 11421 | {11422../src/daemon/main.cc:722:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors]11423 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk()11424 | ^11425../src/daemon/main.cc:723:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11426 723 | || drv.empty() || assignment == 0)11427 | ^11428 | {11429 724 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"};11430 | 11431../src/daemon/main.cc:726:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11432 726 | if (caller.kind != nixgrpc::Caller::Kind::named)11433 | ^11434 | {11435 727 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"};11436 | 11437../src/daemon/main.cc:729:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11438 729 | !status.ok()) return status;11439 | ^ 11440 | {11441../src/daemon/main.cc:731:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11442 731 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"};11443 | ^ 11444 | {11445../src/daemon/main.cc:732:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11446 732 | auto const assigned = [this, pod = *pod, drv, assignment] {11447 | ^11448 | -> bool11449../src/daemon/main.cc:736:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11450 736 | [&](uint64_t id) {11451 | ^11452 | -> Result11453../src/daemon/main.cc:736:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11454 736 | [&](uint64_t id) {11455 | ^11456../src/daemon/main.cc:738:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11457 738 | [this](std::string_view path, uint64_t assignId) {11458 | ^11459 | -> std::optional<std::string>11460../src/daemon/main.cc:741:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11461 741 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); },11462 | ^11463 | -> bool11464../src/daemon/main.cc:1011:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11465 1011 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"};11466 | ^ 11467 | {11468../src/daemon/main.cc:1108:37: error: implicit conversion 'std::string *' (aka 'basic_string<char> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11469 1108 | if (!missing.empty() && missingInput) {11470 | ^ 11471 | ( != nullptr)11472../src/daemon/main.cc:1167:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11473 1167 | auto BuildDerivation(11474 | ^11475../src/daemon/main.cc:1172:24: note: nesting level increased to 111476 1172 | return guarded([&] -> grpc::Status {11477 | ^11478../src/daemon/main.cc:1176:13: note: +2, including nesting penalty of 1, nesting level increased to 211479 1176 | if (request->protocol() != nixcompat::kBuildProtocolWire11480 | ^11481../src/daemon/main.cc:1177:17: note: +111482 1177 | || request->build_mode() > static_cast<uint32_t>(nix::bmCheck)) {11483 | ^11484../src/daemon/main.cc:1184:17: note: +2, including nesting penalty of 1, nesting level increased to 211485 1184 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt;11486 | ^11487../src/daemon/main.cc:1183:51: note: +111488 1183 | auto const selectedPod = reverseRelay && coord.dispatcher11489 | ^11490../src/daemon/main.cc:1185:13: note: +2, including nesting penalty of 1, nesting level increased to 211491 1185 | if (selectedPod) {11492 | ^11493../src/daemon/main.cc:1188:21: note: nesting level increased to 311494 1188 | [&](uint64_t id) {11495 | ^11496../src/daemon/main.cc:1190:29: note: nesting level increased to 411497 1190 | [this](std::string_view drv, uint64_t assignment) {11498 | ^11499../src/daemon/main.cc:1193:34: note: nesting level increased to 311500 1193 | }, *request, [&](std::string_view wire) {11501 | ^11502../src/daemon/main.cc:1195:25: note: +4, including nesting penalty of 3, nesting level increased to 411503 1195 | if (!chunk.ParseFromArray(wire.data(), static_cast<int>(wire.size()))11504 | ^11505../src/daemon/main.cc:1196:103: note: +111506 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11507 | ^11508../src/daemon/main.cc:1198:25: note: +4, including nesting penalty of 3, nesting level increased to 411509 1198 | if (!writer->Write(chunk)) return false;11510 | ^11511../src/daemon/main.cc:1199:25: note: +4, including nesting penalty of 3, nesting level increased to 411512 1199 | if (chunk.has_done()) receivedDone = true;11513 | ^11514../src/daemon/main.cc:1201:24: note: nesting level increased to 311515 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11516 | ^11517../src/daemon/main.cc:1204:24: note: nesting level increased to 311518 1204 | }, [&] { return receivedDone.load(); });11519 | ^11520../src/daemon/main.cc:1206:21: note: +3, including nesting penalty of 2, nesting level increased to 311521 1206 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status;11522 | ^11523../src/daemon/main.cc:1205:36: note: +111524 1205 | return status.ok() && !receivedDone.load()11525 | ^11526../src/daemon/main.cc:1212:13: note: +2, including nesting penalty of 1, nesting level increased to 211527 1212 | if (!coord.builder) {11528 | ^11529../src/daemon/main.cc:1217:38: note: nesting level increased to 211530 1217 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void {11531 | ^11532../src/daemon/main.cc:1231:13: note: +2, including nesting penalty of 1, nesting level increased to 211533 1231 | for (auto & [name, path] : staticOutputs(*localStore, drv)) {11534 | ^11535../src/daemon/main.cc:1239:13: note: +2, including nesting penalty of 1, nesting level increased to 211536 1239 | if (auto const status =11537 | ^11538../src/daemon/main.cc:1240:27: note: nesting level increased to 211539 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11540 | ^11541../src/daemon/main.cc:1243:17: note: +3, including nesting penalty of 2, nesting level increased to 311542 1243 | if (!missingInput.empty()) {11543 | ^11544../src/daemon/main.cc:1188:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11545 1188 | [&](uint64_t id) {11546 | ^11547 | -> Result11548../src/daemon/main.cc:1188:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11549 1188 | [&](uint64_t id) {11550 | ^11551../src/daemon/main.cc:1190:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11552 1190 | [this](std::string_view drv, uint64_t assignment) {11553 | ^11554 | -> std::optional<std::string>11555../src/daemon/main.cc:1193:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11556 1193 | }, *request, [&](std::string_view wire) {11557 | ^11558 | -> bool11559../src/daemon/main.cc:1196:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11560 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11561 | ^11562 | {11563 1197 | return false;11564 | 11565../src/daemon/main.cc:1198:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11566 1198 | if (!writer->Write(chunk)) return false;11567 | ^ 11568 | {11569../src/daemon/main.cc:1199:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11570 1199 | if (chunk.has_done()) receivedDone = true;11571 | ^ 11572 | {11573../src/daemon/main.cc:1201:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11574 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11575 | ^11576 1202 | pod = *selectedPod] {11577 | -> bool11578../src/daemon/main.cc:1204:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11579 1204 | }, [&] { return receivedDone.load(); });11580 | ^11581 | -> bool11582../src/daemon/main.cc:1240:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11583 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11584 | ^11585 | -> bool11586../src/daemon/main.cc:1498:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11587 1498 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) {11588 | ^11589 | -> auto11590../src/daemon/main.cc:1501:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11591 1501 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) {11592 | ^11593 | -> auto11594../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11595 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result11596 | ^11597../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 111598 522 | if (!parsed) {11599 | ^11600../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 111601 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : "";11602 | ^11603../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 111604 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) {11605 | ^11606../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 211607 528 | if (provider.issuer != iss) {11608 | ^11609../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 211610 531 | if (!parsed->has_expires_at()) {11611 | ^11612../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 211613 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) {11614 | ^11615../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 311616 538 | if (!err) {11617 | ^11618../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 211619 542 | if (err) {11620 | ^11621../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 211622 547 | if (sub.empty() || sub.contains('\0')) {11623 | ^11624../src/daemon/oidc.hh:547:29: note: +111625 547 | if (sub.empty() || sub.contains('\0')) {11626 | ^11627../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 211628 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace");11629 | ^11630../src/daemon/oidc.hh:553:32: note: +111631 553 | namespaceClaim && namespaceClaim->is_string()) {11632 | ^11633../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 211634 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11635 | ^11636../src/daemon/oidc.hh:556:82: note: +111637 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11638 | ^11639../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 311640 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11641 | ^11642../src/daemon/oidc.hh:557:67: note: +111643 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11644 | ^11645../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 311646 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11647 | ^11648../src/daemon/oidc.hh:560:66: note: +111649 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11650 | ^11651../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 211652 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11653 | ^11654../src/daemon/oidc.hh:564:91: note: +111655 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11656 | ^11657../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 311658 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11659 | ^11660../src/daemon/oidc.hh:565:65: note: +111661 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11662 | ^11663../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 211664 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) {11665 | ^11666../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 311667 570 | if (aud->is_string()) {11668 | ^11669../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 311670 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11671 | ^11672../src/daemon/oidc.hh:572:64: note: +111673 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11674 | ^11675../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 211676 577 | if (parsed->has_issued_at()) {11677 | ^11678../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 211679 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"};11680 | ^11681../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11682 553 | namespaceClaim && namespaceClaim->is_string()) {11683 | ^11684 | ( != nullptr)11685../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11686 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11687 | ^11688 | ( != nullptr)11689../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11690 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11691 | ^11692../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11693 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11694 | ^11695../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11696 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11697 | ^11698../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11699 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11700 | ^11701 | ( != nullptr)11702../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11703 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11704 | ^11705../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]11706 45 | std::chrono::seconds reverseMaxTokenLifetime{600};11707 | ^11708../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11709 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)11710 | ^11711../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]11712 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||11713 | ^11714../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]11715 96 | result.push_back(static_cast<char>(size >> (i * 8)));11716 | ^11717../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]11718 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11719 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11720../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'11721 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11722 | ^~~~~11723../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'11724 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11725 | ^~~~~~~~11726../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]11727 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11728 | ^~~11729../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]11730 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11731 | ^11732../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11733 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)11734 | ^11735../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11736 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)11737 | ^11738../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]11739 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||11740 | ^11741../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11742 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;11743 | ^ 11744 | {11745../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]11746 250 | unsigned char mac[EVP_MAX_MD_SIZE];11747 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11748../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11749 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),11750 | ~^11751 | (11752 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11753 | == nullptr)11754../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11755 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11756 | ^11757../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]11758 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11759 | ^11760../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11761 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);11762 | ^11763../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]11764 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11765 | ^11766../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning11767 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11768 | ^~~~~~~~~11769 | static_cast<const size_t>( )11770../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type11771 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11772 | ^~11773 | static_cast<long>( )11774../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]11775 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11776 | ^11777../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning11778 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11779 | ^~~~~~~~~~~~~~~11780 | static_cast<const size_t>( )11781../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type11782 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11783 | ^~~~~~~~11784 | static_cast<long>( )11785../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]11786 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool11787 | ^11788../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]11789 53 | auto data(uint64_t id, std::string_view bytes) -> bool11790 | ^11791../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]11792 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);11793 | ^11794../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]11795 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11796 | ^11797../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]11798 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11799 | ^11800 | const &11801../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11802 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;11803 | ^ 11804 | {11805../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11806 81 | if (size > limit) return false;11807 | ^ 11808 | {11809../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11810 83 | cv.wait(lock, stop, [&] {11811 | ^11812 | -> bool11813../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]11814 84 | auto it = streams.find(id);11815 | ^11816../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]11817 87 | auto const it = streams.find(id);11818 | ^11819../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11820 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;11821 | ^ 11822 | {11823../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]11824 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }11825 | ^11826../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]11827 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }11828 | ^11829../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]11830 96 | auto acknowledge(uint64_t id) -> bool11831 | ^11832../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11833 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;11834 | ^ 11835 | {11836../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11837 105 | if (!enqueue(std::move(msg))) return false;11838 | ^ 11839 | {11840../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]11841 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool11842 | ^11843 | const &11844../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11845 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });11846 | ^11847 | -> bool11848../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]11849 145 | auto finished(uint64_t id) -> bool11850 | ^11851../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11852 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;11853 | ^ 11854 | {11855../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11856 150 | if (removed) cv.notify_all();11857 | ^ 11858 | {11859../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]11860 156 | void acknowledgementSent(uint64_t id)11861 | ^11862../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11863 159 | if (acknowledged.erase(id)) streams.erase(id);11864 | ^ 11865 | != 0u11866../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11867 159 | if (acknowledged.erase(id)) streams.erase(id);11868 | ^ 11869 | {11870../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]11871 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {11872 | ^11873../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]11874 208 | auto terminal(uint64_t id, bool abort) -> bool11875 | ^11876../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11877 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11878 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11879 | .status= .prepared=11880../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11881 41 | struct Result11882 | ^11883../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]11884 65 | Role minRole;11885 | ^11886../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11887 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};11888 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11889 | .status= .prepared=11890../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11891 41 | struct Result11892 | ^11893../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11894 85 | return {status, {}};11895 | ^~~~~~~~~~~~11896 | .status=.prepared=11897../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11898 41 | struct Result11899 | ^11900../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11901 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};11902 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11903 | .status= .prepared=11904../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11905 41 | struct Result11906 | ^11907../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11908 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11909 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11910 | .status= .prepared=11911../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11912 41 | struct Result11913 | ^11914../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11915 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};11916 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11917 | .status= .prepared=11918../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11919 41 | struct Result11920 | ^11921../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11922 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};11923 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11924 | .status= .prepared=11925../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11926 41 | struct Result11927 | ^11928../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11929 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};11930 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11931 | .status= .prepared=11932../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11933 41 | struct Result11934 | ^11935../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11936 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};11937 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11938 | .status= .prepared=11939../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11940 41 | struct Result11941 | ^11942../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11943 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11944 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11945 | .status= .prepared=11946 123 | std::string(drvPath), assignId}};11947 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11948../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11949 41 | struct Result11950 | ^11951../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]11952 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11953 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11954 | .session= .open=11955 123 | std::string(drvPath), assignId}};11956 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11957 | .drvPath= .assignId=11958../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here11959 33 | struct Prepared11960 | ^11961../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11962 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11963 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11964 | .status= .prepared=11965../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11966 41 | struct Result11967 | ^11968../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11969 189 | return {status, {}};11970 | ^~~~~~~~~~~~11971 | .status=.prepared=11972../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11973 41 | struct Result11974 | ^11975../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11976 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11977 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11978 | .status= .prepared=11979../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11980 41 | struct Result11981 | ^11982../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11983 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};11984 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11985 | .status= .prepared=11986../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11987 41 | struct Result11988 | ^11989../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11990 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};11991 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11992 | .status= .prepared=11993../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11994 41 | struct Result11995 | ^11996../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11997 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11998 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11999 | .status= .prepared=12000../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12001 41 | struct Result12002 | ^12003../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12004 218 | return {status, {}};12005 | ^~~~~~~~~~~~12006 | .status=.prepared=12007../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12008 41 | struct Result12009 | ^12010../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12011 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};12012 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12013 | .status= .prepared=12014../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12015 41 | struct Result12016 | ^12017../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12018 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};12019 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12020 | .status= .prepared=12021../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12022 41 | struct Result12023 | ^12024../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]12025 233 | Auth &auth;12026 | ^12027../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]12028 234 | ReverseRegistry ®istry;12029 | ^12030../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12031 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional<Event>12032 | ^12033../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 112034 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12035 | ^12036../src/daemon/reverse-inbound.hh:45:79: note: +112037 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12038 | ^12039../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 212040 47 | rejection = closed ? "session closed" : "bad frame header";12041 | ^12042../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 112043 51 | if (frame.has_open())12044 | ^12045../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 212046 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12047 | ^12048../src/daemon/reverse-inbound.hh:53:30: note: +112049 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12050 | ^12051../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 312052 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams";12053 | ^12054../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212055 59 | if (!caller)12056 | ^12057../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 112058 69 | if (it == streams.end())12059 | ^12060../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212061 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()12062 | ^12063../src/daemon/reverse-inbound.hh:74:17: note: +112064 74 | && finishedIds.erase(id))12065 | ^12066../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112067 79 | if (frame.has_data())12068 | ^12069../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212070 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12071 | ^12072../src/daemon/reverse-inbound.hh:81:59: note: +112073 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12074 | ^12075../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 112076 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12077 | ^12078../src/daemon/reverse-inbound.hh:88:97: note: +112079 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12080 | ^12081../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112082 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12083 | ^12084../src/daemon/reverse-inbound.hh:93:72: note: +112085 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12086 | ^12087../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 212088 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; }12089 | ^12090../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]12091 50 | auto const id = frame.stream_id();12092 | ^12093../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]12094 68 | auto it = streams.find(id);12095 | ^12096../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12097 74 | && finishedIds.erase(id))12098 | ^ 12099 | ( != 0u)12100../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12101 74 | && finishedIds.erase(id))12102 | ^12103 | {12104 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};12105 | 12106../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]12107 109 | auto finished(uint64_t id) -> bool12108 | ^12109../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12110 111 | if (cancelledIds.erase(id)) return true;12111 | ^ 12112 | != 0u12113../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12114 111 | if (cancelledIds.erase(id)) return true;12115 | ^ 12116 | {12117../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12118 112 | if (!streams.erase(id)) return false;12119 | ~^ 12120 | == 0u12121../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12122 112 | if (!streams.erase(id)) return false;12123 | ^ 12124 | {12125../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]12126 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {12127 | ^12128../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]12129 82 | auto it = sessions.find(std::string(workerId));12130 | ^12131../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]12132 92 | auto it = sessions.find(handle->workerId);12133 | ^12134../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]12135 107 | auto it = sessions.find(handle->workerId);12136 | ^12137../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]12138 130 | for (auto & [id, session] : sessions) {12139 | ^12140../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12141 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select,12142 | ^12143../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 112144 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12145 | ^12146../src/daemon/reverse-relay.hh:49:21: note: +112147 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12148 | ^12149../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 112150 56 | if (!selection.status.ok()) return selection.status;12151 | ^12152../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 112153 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12154 | ^12155../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 112156 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12157 | ^12158../src/daemon/reverse-relay.hh:59:22: note: +112159 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12160 | ^12161../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 112162 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12163 | ^12164../src/daemon/reverse-relay.hh:60:27: note: +112165 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12166 | ^12167../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 112168 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12169 | ^12170../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 112171 64 | if (!selection.status.ok()) return selection.status;12172 | ^12173../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 112174 65 | if (!selection.prepared || selection.prepared->session != session)12175 | ^12176../src/daemon/reverse-relay.hh:65:33: note: +112177 65 | if (!selection.prepared || selection.prepared->session != session)12178 | ^12179../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 112180 67 | if (request.ByteSizeLong() > maxRequestBytes)12181 | ^12182../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 112183 70 | if (bytes.size() > maxRequestBytes)12184 | ^12185../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 112186 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12187 | ^12188../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112189 75 | if (!status.ok()) return status;12190 | ^12191../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 112192 81 | ~Release() {12193 | ^12194../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 212195 84 | if (!completed) (void) transport.outgoing.cancel(id);12196 | ^12197../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 112198 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12199 | ^12200../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 112201 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) {12202 | ^12203../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 212204 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12205 | ^12206../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 212207 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12208 | ^12209../src/daemon/reverse-relay.hh:100:44: note: +112210 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12211 | ^12212../src/daemon/reverse-relay.hh:100:62: note: +112213 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12214 | ^12215../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 212216 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12217 | ^12218../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112219 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12220 | ^12221../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 112222 111 | std::jthread monitor([&](std::stop_token stop) {12223 | ^12224../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 212225 113 | while (!stop.stop_requested()) {12226 | ^12227../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 312228 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)12229 | ^12230../src/daemon/reverse-relay.hh:115:22: note: +112231 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12232 | ^12233../src/daemon/reverse-relay.hh:115:60: note: +112234 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12235 | ^12236../src/daemon/reverse-relay.hh:115:80: note: +112237 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12238 | ^12239../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 312240 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12241 | ^12242../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 112243 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) {12244 | ^12245../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 212246 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12247 | ^12248../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 212249 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12250 | ^12251../src/daemon/reverse-relay.hh:127:44: note: +112252 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12253 | ^12254../src/daemon/reverse-relay.hh:127:82: note: +112255 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12256 | ^12257../src/daemon/reverse-relay.hh:127:102: note: +112258 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12259 | ^12260../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 312261 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12262 | ^12263../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 212264 130 | if (frame.has_finish()) {12265 | ^12266../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 312267 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12268 | ^12269../src/daemon/reverse-relay.hh:131:55: note: +112270 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12271 | ^12272../src/daemon/reverse-relay.hh:131:75: note: +112273 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12274 | ^12275../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 312276 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12277 | ^12278../src/daemon/reverse-relay.hh:133:38: note: +112279 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12280 | ^12281../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 312282 134 | if (resultReceived && resultReceived()) {12283 | ^12284../src/daemon/reverse-relay.hh:134:36: note: +112285 134 | if (resultReceived && resultReceived()) {12286 | ^12287../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 412288 135 | if (beforeAck) beforeAck();12289 | ^12290../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 412291 136 | if (!transport.outgoing.acknowledge(id))12292 | ^12293../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 212294 143 | while (true) {12295 | ^12296../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 312297 144 | if (!expected) {12298 | ^12299../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 412300 145 | if (pending.size() < 4) break;12301 | ^12302../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 412303 147 | for (unsigned i = 0; i != 4; ++i)12304 | ^12305../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 412306 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12307 | ^12308../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 312309 153 | if (pending.size() < *expected) break;12310 | ^12311../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 312312 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12313 | ^12314../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 212315 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12316 | ^12317../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 112318 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12319 | ^12320../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 112321 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12322 | ^12323../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 112324 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12325 | ^12326../src/daemon/reverse-relay.hh:163:47: note: +112327 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12328 | ^12329../src/daemon/reverse-relay.hh:163:67: note: +112330 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12331 | ^12332../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12333 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12334 | ^ 12335 | {12336../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12337 56 | if (!selection.status.ok()) return selection.status;12338 | ^ 12339 | {12340../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12341 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12342 | ^ 12343 | {12344../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12345 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12346 | ^ 12347 | {12348../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12349 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12350 | ^ 12351 | {12352../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]12353 61 | auto const id = session->transport->nextStreamId.fetch_add(1);12354 | ^12355../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12356 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12357 | ^ 12358 | {12359../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12360 64 | if (!selection.status.ok()) return selection.status;12361 | ^ 12362 | {12363../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12364 65 | if (!selection.prepared || selection.prepared->session != session)12365 | ^12366 | {12367 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};12368 | 12369../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12370 67 | if (request.ByteSizeLong() > maxRequestBytes)12371 | ^12372 | {12373 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12374 | 12375../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12376 70 | if (bytes.size() > maxRequestBytes)12377 | ^12378 | {12379 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12380 | 12381../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12382 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12383 | ^ 12384 | {12385../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12386 75 | if (!status.ok()) return status;12387 | ^ 12388 | {12389../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]12390 77 | struct Release {12391 | ^12392../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]12393 77 | struct Release {12394 | ^12395 78 | ReverseTransport & transport;12396 79 | uint64_t id;12397 | 12398 | {}12399../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]12400 78 | ReverseTransport & transport;12401 | ^12402../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12403 84 | if (!completed) (void) transport.outgoing.cancel(id);12404 | ^ 12405 | {12406../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12407 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12408 | ^ 12409 | {12410../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]12411 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12412 | ^12413../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]12414 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12415 | ^12416../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12417 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12418 | ^ 12419 | {12420../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12421 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12422 | ^12423 | {12424 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};12425 | 12426../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12427 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12428 | ^12429 | {12430 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};12431 | 12432../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12433 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12434 | ^ 12435 | {12436../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12437 111 | std::jthread monitor([&](std::stop_token stop) {12438 | ^12439 | const 12440../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12441 111 | std::jthread monitor([&](std::stop_token stop) {12442 | ^12443 | -> auto12444../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]12445 111 | std::jthread monitor([&](std::stop_token stop) {12446 | ^12447 | const &12448../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]12449 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12450 | ^12451../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12452 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12453 | ^12454 | -> auto12455../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12456 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12457 | ^ 12458 | {12459../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12460 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12461 | ^12462 | {12463 128 | return {grpc::StatusCode::UNAVAILABLE,12464 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12465 | 12466../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12467 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12468 | ^12469 | {12470 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12471 | 12472../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12473 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12474 | ^ 12475 | {12476../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12477 135 | if (beforeAck) beforeAck();12478 | ^ 12479 | {12480../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12481 136 | if (!transport.outgoing.acknowledge(id))12482 | ^12483 | {12484 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};12485 | 12486../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12487 145 | if (pending.size() < 4) break;12488 | ^ 12489 | {12490../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12491 147 | for (unsigned i = 0; i != 4; ++i)12492 | ^12493 | {12494 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12495 | 12496../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]12497 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12498 | ^~~12499../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]12500 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12501 | ^12502../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12503 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12504 | ^ 12505 | {12506../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12507 153 | if (pending.size() < *expected) break;12508 | ^ 12509 | {12510../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12511 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12512 | ^12513 | {12514 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};12515 | 12516../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12517 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12518 | ^ 12519 | {12520../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12521 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12522 | ^ 12523 | {12524../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12525 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12526 | ^ 12527 | {12528../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12529 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12530 | ^12531 | {12532 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12533 | 12534../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]12535 169 | ReverseGateway & gateway;12536 | ^12537../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]12538 170 | ReverseRegistry & registry;12539 | ^12540../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12541 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool12542 | ^12543../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 112544 52 | if (!event) { rejection = inbound.lastRejection(); return false; }12545 | ^12546../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 112547 54 | switch (event->kind) {12548 | ^12549../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 212550 56 | if (!event->caller) { rejection = "open without caller"; return false; }12551 | ^12552../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212553 59 | if (frame.open().method() == "UploadBuildInputs") {12554 | ^12555../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 312556 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12557 | ^12558../src/daemon/reverse-request.hh:61:30: note: +112559 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12560 | ^12561../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 312562 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12563 | ^12564../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212565 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }12566 | ^12567../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 212568 77 | if (auto it = uploads.find(id); it != uploads.end())12569 | ^12570../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212571 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 412572 | ^12573../src/daemon/reverse-request.hh:82:17: note: +112574 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }12575 | ^12576../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 212577 84 | if (!pending.length && pending.wire.size() >= 4) {12578 | ^12579../src/daemon/reverse-request.hh:84:33: note: +112580 84 | if (!pending.length && pending.wire.size() >= 4) {12581 | ^12582../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 312583 86 | for (unsigned i = 0; i != 4; ++i)12584 | ^12585../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 312586 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }12587 | ^12588../src/daemon/reverse-request.hh:91:36: note: +112589 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;12590 | ^12591../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 212592 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12593 | ^12594../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 212595 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12596 | ^12597../src/daemon/reverse-request.hh:96:60: note: +112598 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12599 | ^12600../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 212601 108 | if (auto it = uploads.find(id); it != uploads.end()) {12602 | ^12603../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 212604 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12605 | ^12606../src/daemon/reverse-request.hh:112:29: note: +112607 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12608 | ^12609../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 212610 114 | if (ready && ready->id == id) ready.reset();12611 | ^12612../src/daemon/reverse-request.hh:114:23: note: +112613 114 | if (ready && ready->id == id) ready.reset();12614 | ^12615../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]12616 48 | std::scoped_lock lock(mutex);12617 | ^12618 | const 12619../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]12620 53 | auto const id = event->streamId;12621 | ^12622../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12623 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12624 | ^12625 | -> bool12626../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]12627 77 | if (auto it = uploads.find(id); it != uploads.end())12628 | ^12629../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12630 77 | if (auto it = uploads.find(id); it != uploads.end())12631 | ^12632 | {12633 78 | return it->second->feed(frame.data().data());12634 | 12635../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12636 86 | for (unsigned i = 0; i != 4; ++i)12637 | ^12638 | {12639 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12640 | 12641../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]12642 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12643 | ^~~12644../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]12645 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12646 | ^12647../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]12648 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12649 | ^12650../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12651 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12652 | ^ 12653 | {12654../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]12655 95 | auto it = requests.find(id);12656 | ^12657../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]12658 108 | if (auto it = uploads.find(id); it != uploads.end()) {12659 | ^12660../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12661 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12662 | ^ 12663 | {12664../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12665 114 | if (ready && ready->id == id) ready.reset();12666 | ^ 12667 | {12668../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]12669 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }12670 | ^12671 | const 12672../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]12673 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }12674 | ^12675 | const 12676../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]12677 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }12678 | ^12679 | const 12680../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]12681 130 | std::scoped_lock lock(mutex);12682 | ^12683 | const 12684../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]12685 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12686 | ^12687../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12688 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12689 | ^ 12690 | {12691../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]12692 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {12693 | ^12694../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]12695 142 | std::scoped_lock lock(mutex);12696 | ^12697 | const 12698../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]12699 148 | std::scoped_lock lock(mutex);12700 | ^12701 | const 12702../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]12703 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12704 | ^12705../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12706 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12707 | ^ 12708 | {12709../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]12710 32 | [[nodiscard]] auto open(uint64_t id) -> bool12711 | ^12712../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]12713 51 | auto it = streams.find(frame.stream_id());12714 | ^12715../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12716 56 | if (!cancelled.contains(frame.stream_id())) return false;12717 | ^ 12718 | {12719../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12720 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;12721 | ^ 12722 | {12723../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]12724 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12725 | ^12726../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]12727 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12728 | ^12729 | const &12730../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12731 104 | auto pending = [&] {12732 | ^12733 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>12734../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]12735 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12736 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~12737 | std::ranges::find_if queue12738../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12739 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12740 | ^12741 | -> auto12742../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12743 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });12744 | ^12745 | -> bool12746../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]12747 111 | auto it = pending();12748 | ^12749../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]12750 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool12751 | ^12752../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12753 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);12754 | ^ 12755 | {12756../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]12757 168 | [[nodiscard]] auto finished(uint64_t id) -> bool12758 | ^12759../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]12760 171 | auto it = streams.find(id);12761 | ^12762../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12763 42 | if (context) {12764 | ^ 12765 | != nullptr12766../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]12767 54 | WorkerIdentity & identity;12768 | ^12769../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]12770 55 | ReverseRegistry & registry;12771 | ^12772../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]12773 56 | Auth & workerAuth;12774 | ^12775../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12776 66 | auto Register(12777 | ^12778../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112779 75 | if (!auth) {12780 | ^12781../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112782 79 | if (transports.size() != 1 ||12783 | ^12784../src/daemon/reverse-session.hh:79:36: note: +112785 79 | if (transports.size() != 1 ||12786 | ^12787../src/daemon/reverse-session.hh:80:94: note: +112788 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" &&12789 | ^12790../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 112791 90 | if (caller.kind != Caller::Kind::named) {12792 | ^12793../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112794 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) {12795 | ^12796../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 112797 100 | if (first == last || std::next(first) != last) {12798 | ^12799../src/daemon/reverse-session.hh:100:27: note: +112800 100 | if (first == last || std::next(first) != last) {12801 | ^12802../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112803 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12804 | ^12805../src/daemon/reverse-session.hh:105:40: note: +112806 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12807 | ^12808../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 112809 111 | if (!stream->Read(&msg)) {12810 | ^12811../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 112812 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET12813 | ^12814../src/daemon/reverse-session.hh:115:13: note: +112815 115 | || !msg.credential().empty()) {12816 | ^12817../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 112818 118 | if (msg.protocol() != reverseProtocolVersion) {12819 | ^12820../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 112821 122 | if (!bound) {12822 | ^12823../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 112824 128 | if (!sessionKey) {12825 | ^12826../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 112827 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12828 | ^12829../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 112830 136 | if (!handle) {12831 | ^12832../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 112833 144 | ~Cleanup()12834 | ^12835../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112836 139 | struct Cleanup12837 | ^12838../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112839../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 112840 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12841 | ^12842../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 212843 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12844 | ^12845../src/daemon/reverse-session.hh:160:43: note: +112846 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12847 | ^12848../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 312849 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12850 | ^12851../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 212852 163 | if (!stop.stop_requested()) {12853 | ^12854../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 112855 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12856 | ^12857../src/daemon/reverse-session.hh:171:40: note: +112858 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12859 | ^12860../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 112861 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12862 | ^12863../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 212864 179 | while (transport->outgoing.waitTake(frame, stop)) {12865 | ^12866../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 312867 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12868 | ^12869../src/daemon/reverse-session.hh:180:48: note: +112870 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12871 | ^12872../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 312873 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12874 | ^12875../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 112876 187 | while (stream->Read(&msg)) {12877 | ^12878../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 212879 188 | if (!msg.credential().empty()) {12880 | ^12881../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 312882 191 | ? identity.renew(msg.credential(), bound->workerId)12883 | ^12884../src/daemon/reverse-session.hh:190:52: note: +112885 190 | && msg.worker_id().empty() && registry.current(*handle)12886 | ^12887../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 312888 193 | if (!renewed) {12889 | ^12890../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 212891 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12892 | ^12893../src/daemon/reverse-session.hh:205:44: note: +112894 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12895 | ^12896../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]12897 104 | std::string_view value(first->second.data(), first->second.size());12898 | ^12899 | const 12900../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12901 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12902 | ^12903 | -> void12904../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12905 139 | struct Cleanup12906 | ^12907../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]12908 139 | struct Cleanup12909 | ^12910../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]12911 141 | ReverseRegistry & registry;12912 | ^12913../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]12914 149 | } cleanup{registry, *handle, cancellation};12915 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12916 | .registry=.handle= .cancellation=12917../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here12918 139 | struct Cleanup12919 | ^12920../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]12921 156 | std::condition_variable_any cv;12922 | ^12923../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12924 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12925 | ^12926 | const 12927../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12928 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12929 | ^12930 | -> void12931../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]12932 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12933 | ^12934 | const &12935../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12936 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12937 | ^12938 | -> bool12939../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12940 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12941 | ^12942 | const 12943../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12944 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12945 | ^12946 | -> void12947../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]12948 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12949 | ^12950 | const &12951../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12952 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12953 | ^ 12954 | {12955../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]12956 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12957 | ^12958../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]12959 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12960 | ^12961 | -> bool12962../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]12963 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12964 | ^12965../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12966 33 | if (assigned && !assigned()) return false;12967 | ^ 12968 | {12969../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]12970 35 | std::scoped_lock lock(mutex);12971 | ^12972 | const 12973../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12974 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;12975 | ^ 12976 | {12977../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12978 42 | if (!ok) cancel();12979 | ^ 12980 | {12981../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]12982 49 | std::scoped_lock lock(mutex);12983 | ^12984 | const 12985../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12986 68 | if (closed) return false;12987 | ^ 12988 | {12989../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12990 79 | if (ended || !chunks.empty()) break;12991 | ^ 12992 | {12993../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]12994 80 | cv.wait_for(lock, std::chrono::milliseconds(25));12995 | ^12996../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12997 82 | if (chunks.empty()) return false;12998 | ^ 12999 | {13000../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]13001 92 | std::scoped_lock lock(mutex);13002 | ^13003 | const 13004../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]13005 103 | cv.wait_for(lock, std::chrono::milliseconds(25));13006 | ^13007../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13008 113 | if (!ended || closed || !chunks.empty()) return false;13009 | ^ 13010 | {13011../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]13012 120 | std::scoped_lock lock(mutex);13013 | ^13014 | const 13015../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]13016 129 | std::scoped_lock lock(mutex);13017 | ^13018 | const 13019../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]13020 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned,13021 | ^13022../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 113023 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes13024 | ^13025../src/daemon/reverse-upload-relay.hh:37:63: note: +113026 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13027 | ^13028../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 113029 40 | if (!selection.status.ok()) return selection.status;13030 | ^13031../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 113032 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13033 | ^13034../src/daemon/reverse-upload-relay.hh:41:65: note: +113035 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13036 | ^13037../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 113038 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13039 | ^13040../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 113041 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13042 | ^13043../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 113044 48 | if (!selection.status.ok()) return selection.status;13045 | ^13046../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 113047 49 | if (!selection.prepared || selection.prepared->session != session)13048 | ^13049../src/daemon/reverse-upload-relay.hh:49:33: note: +113050 49 | if (!selection.prepared || selection.prepared->session != session)13051 | ^13052../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 113053 53 | if (!delegated || !ReverseUpload::first(*delegated, first)13054 | ^13055../src/daemon/reverse-upload-relay.hh:55:13: note: +113056 55 | || selection.prepared->assignId != first.assign_id())13057 | ^13058../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 113059 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13060 | ^13061../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 113062 60 | if (!status.ok()) return status;13063 | ^13064../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 113065 65 | ~Release() {13066 | ^13067../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 213068 66 | if (!completed) (void) transport.outgoing.cancel(id);13069 | ^13070../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 113071 76 | std::jthread monitor([&](std::stop_token stop) {13072 | ^13073../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 213074 78 | while (!stop.stop_requested()) {13075 | ^13076../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 313077 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)13078 | ^13079../src/daemon/reverse-upload-relay.hh:80:21: note: +113080 80 | || !assigned()) {13081 | ^13082../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 313083 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13084 | ^13085../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 113086 90 | auto const live = [&] {13087 | ^13088../src/daemon/reverse-upload-relay.hh:91:98: note: +113089 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned();13090 | ^13091../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 113092 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool {13093 | ^13094../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 213095 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13096 | ^13097../src/daemon/reverse-upload-relay.hh:95:27: note: +113098 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13099 | ^13100../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 213101 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13102 | ^13103../src/daemon/reverse-upload-relay.hh:97:30: note: +113104 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13105 | ^13106../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 213107 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13108 | ^13109../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 213110 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13111 | ^13112../src/daemon/reverse-upload-relay.hh:100:25: note: +113113 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13114 | ^13115../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 213116 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13117 | ^13118../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 313119 102 | if (!live() || !transport.outgoing.waitData(id,13120 | ^13121../src/daemon/reverse-upload-relay.hh:102:29: note: +113122 102 | if (!live() || !transport.outgoing.waitData(id,13123 | ^13124../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 113125 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13126 | ^13127../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 113128 108 | while (read(next)) {13129 | ^13130../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 213131 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13132 | ^13133../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 213134 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13135 | ^13136../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 113137 113 | if (!live() || !transport.outgoing.halfClose(id))13138 | ^13139../src/daemon/reverse-upload-relay.hh:113:21: note: +113140 113 | if (!live() || !transport.outgoing.halfClose(id))13141 | ^13142../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 113143 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13144 | ^13145../src/daemon/reverse-upload-relay.hh:116:75: note: +113146 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13147 | ^13148../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113149 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13150 | ^13151../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 113152 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13153 | ^13154../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 113155 120 | if (!transport.responses.finished(id))13156 | ^13157../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]13158 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status13159 | ^13160 | const &13161../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13162 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13163 | ^13164 | {13165 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};13166 | 13167../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13168 40 | if (!selection.status.ok()) return selection.status;13169 | ^ 13170 | {13171../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13172 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13173 | ^13174 | {13175 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};13176 | 13177../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13178 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13179 | ^ 13180 | {13181../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]13182 45 | auto const id = session->transport->nextStreamId.fetch_add(1);13183 | ^13184../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13185 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13186 | ^ 13187 | {13188../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13189 48 | if (!selection.status.ok()) return selection.status;13190 | ^ 13191 | {13192../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13193 49 | if (!selection.prepared || selection.prepared->session != session)13194 | ^13195 | {13196 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};13197 | 13198../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13199 55 | || selection.prepared->assignId != first.assign_id())13200 | ^13201 | {13202 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};13203 | 13204../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13205 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13206 | ^ 13207 | {13208../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13209 60 | if (!status.ok()) return status;13210 | ^ 13211 | {13212../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]13213 61 | struct Release {13214 | ^13215../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]13216 61 | struct Release {13217 | ^13218 62 | ReverseTransport & transport;13219 63 | uint64_t id;13220 | 13221 | {}13222../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]13223 62 | ReverseTransport & transport;13224 | ^13225../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13226 66 | if (!completed) (void) transport.outgoing.cancel(id);13227 | ^ 13228 | {13229../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]13230 70 | } release{transport, id};13231 | ^~~~~~~~~~~~~~~13232 | .transport=.id=13233../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here13234 61 | struct Release {13235 | ^13236../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]13237 75 | std::condition_variable_any cv;13238 | ^13239../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]13240 76 | std::jthread monitor([&](std::stop_token stop) {13241 | ^13242 | const 13243../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]13244 76 | std::jthread monitor([&](std::stop_token stop) {13245 | ^13246 | -> void13247../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]13248 76 | std::jthread monitor([&](std::stop_token stop) {13249 | ^13250 | const &13251../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]13252 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13253 | ^13254../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]13255 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13256 | ^13257 | -> bool13258../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]13259 90 | auto const live = [&] {13260 | ^13261 | -> bool13262../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13263 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13264 | ^ 13265 | {13266../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13267 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13268 | ^ 13269 | {13270../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13271 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13272 | ^ 13273 | {13274../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]13275 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13276 | ^~~13277../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]13278 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13279 | ^13280../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]13281 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13282 | ^13283../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13284 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13285 | ^ 13286 | {13287../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13288 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13289 | ^13290 | {13291 102 | if (!live() || !transport.outgoing.waitData(id,13292 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13293 | 13294../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13295 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13296 | ^ 13297 | {13298../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13299 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13300 | ^ 13301 | {13302../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13303 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13304 | ^ 13305 | {13306../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13307 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13308 | ^ 13309 | {13310../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13311 113 | if (!live() || !transport.outgoing.halfClose(id))13312 | ^13313 | {13314 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};13315 | 13316../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13317 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13318 | ^13319 | {13320 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};13321 | 13322../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13323 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13324 | ^ 13325 | {13326../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13327 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13328 | ^ 13329 | {13330../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13331 120 | if (!transport.responses.finished(id))13332 | ^13333 | {13334 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};13335 | 13336../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]13337 127 | ReverseGateway & gateway;13338 | ^13339../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]13340 128 | ReverseRegistry & registry;13341 | ^13342../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]13343 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13344 | ^13345../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning13346 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13347 | ^~~~~~~~~~~13348 | static_cast<const size_t>( )13349../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type13350 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13351 | ^~~~13352 | static_cast<long>( )13353../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13354 49 | if (failed || bytes.empty() || !consume) return fail();13355 | ^ 13356 | {13357../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]13358 53 | buffer.append(bytes.data(), count);13359 | ~~~~~~^~~~13360../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13361 57 | for (unsigned i = 0; i < 4; ++i)13362 | ^13363 | {13364 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13365 | 13366../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]13367 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13368 | ^~~13369../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]13370 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13371 | ^13372../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13373 59 | if (length == 0 || length > maxChunkBytes) return fail();13374 | ^ 13375 | {13376../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]13377 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))13378 | ^13379../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13380 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))13381 | ^13382 | {13383 66 | return fail();13384 | 13385../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]13386 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();13387 | ^13388../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13389 371 | auto const it = workerIds.find(std::string(addr));13390 | ^13391../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]13392 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience13393 | ^13394../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13395 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13396 | ^13397 | -> bool13398../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]13399 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13400 | ^13401../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]13402 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13403 | ^13404../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]13405 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13406 | ^13407../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]13408 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13409 | ^13410../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]13411 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13412 | ^13413../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]13414 44 | if (uid[i] != '-') {13415 | ^~~13416../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]13417 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13418 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~13419 | < || > && < || >13420../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]13421 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13422 | ^~~13423../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]13424 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13425 | ^~~13426../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]13427 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13428 | ^~~13429../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]13430 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13431 | ^~~13432../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]13433 96 | auto const & id = *result.identity;13434 | ^13435../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13436 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime13437 | ^~~~~~~~~~~~13438../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13439 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {13440 | ^~~~~~~~~~~~13441../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13442 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;13443 | ^~~~~~~~~13444../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13445 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};13446 | ^~~~~~~~~~~~13447../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]13448 327 | char extra;13449 | ^ 13450 | = 013451../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13452 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");13453 | ^ 13454 | {13455../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13456 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");13457 | ^ 13458 | {13459../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13460 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");13461 | ^ 13462 | {13463Errors encountered while running clang-tidy13464FAILED: [code=1] meson-internal__clang-tidy 13465/nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always13466ninja: build stopped: subcommand failed.