nixbot

builds

failed nix-grpc-store-clang-tidy-0.2.2 checks.aarch64-linux.clang-tidy · build #789 · raw

1tribuchet: building on eliza
unpackPhase
2unpacking source archive /nix/store/kakc7wqns1hjbjrx32prm66f2kc8lsj2-source3source root is source
configurePhase
4mesonConfigurePhase flags: --prefix=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-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/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/bin53 buildtype : plain54 includedir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/include55 infodir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/share/info56 libdir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/lib57 libexecdir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/libexec58 localedir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/share/locale59 mandir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.2/share/man60 prefix : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-nix-grpc-store-clang-tidy-0.2.261 sbindir : /nix/store/59bdilxq4b3mc7aqfj6ji97c3v9qs6rv-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\ building
buildPhase
66[1/2] Generating eds_proto with a custom command67[2/2] Generating nix_remote_proto with a custom command68[0/1] /nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always69>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-responses-test.cc70../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]71 23 | static constexpr size_t maxFrameBytes = 64 * 1024;72 | ^73../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning74 23 | static constexpr size_t maxFrameBytes = 64 * 1024;75 | ^~~~~~~~~76 | static_cast<const size_t>( )77../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type78 23 | static constexpr size_t maxFrameBytes = 64 * 1024;79 | ^~80 | static_cast<long>( )81../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]82 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;83 | ^84../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning85 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;86 | ^~~~~~~~~~~~~~~87 | static_cast<const size_t>( )88../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type89 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;90 | ^~~~~~~~91 | static_cast<long>( )92../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]93 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool94 | ^95../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]96 53 | auto data(uint64_t id, std::string_view bytes) -> bool97 | ^98../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]99 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);100 | ^101../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]102 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool103 | ^104../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]105 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool106 | ^107 | const &108../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]109 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;110 | ^ 111 | {112../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]113 81 | if (size > limit) return false;114 | ^ 115 | {116../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]117 83 | cv.wait(lock, stop, [&] {118 | ^119 | -> bool120../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]121 84 | auto it = streams.find(id);122 | ^123../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]124 87 | auto const it = streams.find(id);125 | ^126../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]127 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;128 | ^ 129 | {130../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]131 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }132 | ^133../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]134 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }135 | ^136../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]137 96 | auto acknowledge(uint64_t id) -> bool138 | ^139../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]140 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;141 | ^ 142 | {143../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]144 105 | if (!enqueue(std::move(msg))) return false;145 | ^ 146 | {147../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]148 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool149 | ^150 | const &151../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]152 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });153 | ^154 | -> bool155../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]156 145 | auto finished(uint64_t id) -> bool157 | ^158../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]159 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;160 | ^ 161 | {162../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]163 150 | if (removed) cv.notify_all();164 | ^ 165 | {166../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]167 156 | void acknowledgementSent(uint64_t id)168 | ^169../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]170 159 | if (acknowledged.erase(id)) streams.erase(id);171 | ^ 172 | != 0u173../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]174 159 | if (acknowledged.erase(id)) streams.erase(id);175 | ^ 176 | {177../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]178 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {179 | ^180../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]181 208 | auto terminal(uint64_t id, bool abort) -> bool182 | ^183../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]184 32 | [[nodiscard]] auto open(uint64_t id) -> bool185 | ^186../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]187 51 | auto it = streams.find(frame.stream_id());188 | ^189../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]190 56 | if (!cancelled.contains(frame.stream_id())) return false;191 | ^ 192 | {193../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]194 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;195 | ^ 196 | {197../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]198 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool199 | ^200../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]201 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool202 | ^203 | const &204../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]205 104 | auto pending = [&] {206 | ^207 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>208../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]209 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });210 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~211 | std::ranges::find_if queue212../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]213 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });214 | ^215 | -> auto216../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]217 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });218 | ^219 | -> bool220../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]221 111 | auto it = pending();222 | ^223../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]224 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool225 | ^226../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]227 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);228 | ^ 229 | {230../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]231 168 | [[nodiscard]] auto finished(uint64_t id) -> bool232 | ^233../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]234 171 | auto it = streams.find(id);235 | ^236../tests/reverse-responses-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]237 8 | int main()238 | ~~~ ^ 239 | auto -> int240../tests/reverse-responses-test.cc:13:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]241 6 | #include "reverse-responses.hh"242 7 | 243 8 | int main()244 9 | {245 10 | nixgrpc::ReverseResponses replies;246 11 | assert(!replies.open(0));247 12 | assert(replies.open(1) && !replies.open(1));248 13 | nix::remote::ReverseWorkerMsg response;249 | ^250../tests/reverse-responses-test.cc:23:60: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]251 6 | response.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x'));252 | ^253../tests/reverse-responses-test.cc:27:53: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]254 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));255 | ^256../tests/reverse-responses-test.cc:27:69: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]257 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));258 | ^259../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]260 40 | response.mutable_finish()->set_code(123);261 | ^262../tests/reverse-responses-test.cc:63:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]263 2 | size_t queued = 0;264 | ^265../tests/reverse-responses-test.cc:77:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]266 77 | std::jthread waiter([&] {267 | ^268 | -> void269../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]270 79 | received = replies.waitTake(6, isolated, stop.get_token())271 | ^272../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]273 80 | && isolated.stream_id() == 6 && isolated.data().data() == "only six";274 | ^275../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]276 82 | response.set_stream_id(5);277 | ^278../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]279 85 | response.set_stream_id(6);280 | ^281>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-registry-test.cc282../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]283 23 | static constexpr size_t maxFrameBytes = 64 * 1024;284 | ^285../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning286 23 | static constexpr size_t maxFrameBytes = 64 * 1024;287 | ^~~~~~~~~288 | static_cast<const size_t>( )289../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type290 23 | static constexpr size_t maxFrameBytes = 64 * 1024;291 | ^~292 | static_cast<long>( )293../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]294 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;295 | ^296../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning297 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;298 | ^~~~~~~~~~~~~~~299 | static_cast<const size_t>( )300../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type301 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;302 | ^~~~~~~~303 | static_cast<long>( )304../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]305 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool306 | ^307../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]308 53 | auto data(uint64_t id, std::string_view bytes) -> bool309 | ^310../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]311 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);312 | ^313../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]314 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool315 | ^316../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]317 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool318 | ^319 | const &320../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]321 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;322 | ^ 323 | {324../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]325 81 | if (size > limit) return false;326 | ^ 327 | {328../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]329 83 | cv.wait(lock, stop, [&] {330 | ^331 | -> bool332../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]333 84 | auto it = streams.find(id);334 | ^335../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]336 87 | auto const it = streams.find(id);337 | ^338../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]339 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;340 | ^ 341 | {342../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]343 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }344 | ^345../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]346 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }347 | ^348../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]349 96 | auto acknowledge(uint64_t id) -> bool350 | ^351../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]352 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;353 | ^ 354 | {355../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]356 105 | if (!enqueue(std::move(msg))) return false;357 | ^ 358 | {359../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]360 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool361 | ^362 | const &363../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]364 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });365 | ^366 | -> bool367../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]368 145 | auto finished(uint64_t id) -> bool369 | ^370../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]371 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;372 | ^ 373 | {374../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]375 150 | if (removed) cv.notify_all();376 | ^ 377 | {378../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]379 156 | void acknowledgementSent(uint64_t id)380 | ^381../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]382 159 | if (acknowledged.erase(id)) streams.erase(id);383 | ^ 384 | != 0u385../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]386 159 | if (acknowledged.erase(id)) streams.erase(id);387 | ^ 388 | {389../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]390 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {391 | ^392../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]393 208 | auto terminal(uint64_t id, bool abort) -> bool394 | ^395../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]396 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {397 | ^398../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]399 82 | auto it = sessions.find(std::string(workerId));400 | ^401../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]402 92 | auto it = sessions.find(handle->workerId);403 | ^404../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]405 107 | auto it = sessions.find(handle->workerId);406 | ^407../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]408 130 | for (auto & [id, session] : sessions) {409 | ^410../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]411 32 | [[nodiscard]] auto open(uint64_t id) -> bool412 | ^413../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]414 51 | auto it = streams.find(frame.stream_id());415 | ^416../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]417 56 | if (!cancelled.contains(frame.stream_id())) return false;418 | ^ 419 | {420../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]421 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;422 | ^ 423 | {424../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]425 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool426 | ^427../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]428 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool429 | ^430 | const &431../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]432 104 | auto pending = [&] {433 | ^434 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>435../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]436 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });437 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~438 | std::ranges::find_if queue439../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]440 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });441 | ^442 | -> auto443../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]444 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });445 | ^446 | -> bool447../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]448 111 | auto it = pending();449 | ^450../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]451 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool452 | ^453../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]454 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);455 | ^ 456 | {457../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]458 168 | [[nodiscard]] auto finished(uint64_t id) -> bool459 | ^460../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]461 171 | auto it = streams.find(id);462 | ^463../tests/reverse-registry-test.cc:9:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]464 9 | int main()465 | ~~~ ^ 466 | auto -> int467../tests/reverse-registry-test.cc:14:57: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]468 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby469 | ^470 | -> void471/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'472 138 | ((__VA_ARGS__) \473 | ^474../tests/reverse-registry-test.cc:16:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]475 16 | assert(!registry.registerWorker("", "worker", [] {}));476 | ^477 | -> void478/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'479 138 | ((__VA_ARGS__) \480 | ^481../tests/reverse-registry-test.cc:17:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]482 17 | assert(!registry.registerWorker("other", "worker", [] {}));483 | ^484 | -> void485/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'486 138 | ((__VA_ARGS__) \487 | ^488../tests/reverse-registry-test.cc:18:115: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]489 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));490 | ^491 | -> void492/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'493 138 | ((__VA_ARGS__) \494 | ^495../tests/reverse-registry-test.cc:22:53: error: no header providing "nixgrpc::ReverseTransport" is directly included [misc-include-cleaner,-warnings-as-errors]496 8 | 497 9 | int main()498 10 | {499 11 | nixgrpc::ReverseRegistry registry;500 12 | int firstCancelled = 0;501 13 | int secondCancelled = 0;502 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby503 15 | registry.setActive(true);504 16 | assert(!registry.registerWorker("", "worker", [] {}));505 17 | assert(!registry.registerWorker("other", "worker", [] {}));506 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));507 19 | assert(!registry.registerWorker("worker", "worker", {}));508 20 | assert(!registry.find("worker"));509 21 | 510 22 | auto firstTransport = std::make_shared<nixgrpc::ReverseTransport>();511 | ^512../tests/reverse-registry-test.cc:23:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]513 23 | auto first = *registry.registerWorker("worker", "worker", [&] {514 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~515 24 | ++firstCancelled;516 | ~~~~~~~~~~~~~~~~~517 25 | // A session teardown can synchronously inspect the replacement.518 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~519 26 | assert(registry.find("worker"));520 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~521 27 | }, {}, firstTransport);522 | ~~~~~~~~~~~~~~~~~~~~~~523../tests/reverse-registry-test.cc:23:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]524 23 | auto first = *registry.registerWorker("worker", "worker", [&] {525 | ^526 | -> void527../tests/reverse-registry-test.cc:31:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]528 31 | auto other = *registry.registerWorker("other", "other", [] {});529 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~530../tests/reverse-registry-test.cc:31:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]531 31 | auto other = *registry.registerWorker("other", "other", [] {});532 | ^533 | -> void534../tests/reverse-registry-test.cc:32:20: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]535 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });536 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~537../tests/reverse-registry-test.cc:32:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]538 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });539 | ^540 | -> void541../tests/reverse-registry-test.cc:35:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]542 7 | nix::remote::ReverseWorkerMsg stale;543 | ^544../tests/reverse-registry-test.cc:50:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]545 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });546 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~547../tests/reverse-registry-test.cc:50:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]548 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });549 | ^550 | -> void551../tests/reverse-registry-test.cc:58:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]552 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });553 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~554../tests/reverse-registry-test.cc:58:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]555 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });556 | ^557 | -> void558../tests/reverse-registry-test.cc:64:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]559 64 | auto old = *registry.registerWorker("worker", "worker", [] {});560 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~561../tests/reverse-registry-test.cc:64:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]562 64 | auto old = *registry.registerWorker("worker", "worker", [] {});563 | ^564 | -> void565../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]566 65 | std::atomic<bool> go{false};567 | ^568../tests/reverse-registry-test.cc:66:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]569 66 | std::thread closeOld([&] {570 | ^571 | -> void572../tests/reverse-registry-test.cc:73:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]573 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});574 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~575../tests/reverse-registry-test.cc:73:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]576 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});577 | ^578 | -> void579>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/dispatcher-session-test.cc580../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]581 12 | #include <chrono>582 | 583 13 | #include <chrono>584 | ^~~~~~~~~~~~~~~~~585../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]586 90 | std::chrono::system_clock::time_point credentialExpiresAt{};587 | ^~588../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]589 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();590 | ^591../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]592 371 | auto const it = workerIds.find(std::string(addr));593 | ^594../tests/dispatcher-session-test.cc:14:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]595 14 | int main()596 | ~~~ ^ 597 | auto -> int598../tests/dispatcher-session-test.cc:70:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]599 70 | if (msg.has_assigned()) directAssigned = !msg.assigned().reverse();600 | ^ 601 | {602../tests/dispatcher-session-test.cc:72:8: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]603 72 | }, [] {});604 | ^605 | -> void606../tests/dispatcher-session-test.cc:87:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]607 87 | .send = [](const nix::remote::SchedCmd &) { return true; },608 | ^609 | -> bool610../tests/dispatcher-session-test.cc:129:106: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]611 129 | auto follower = dispatcher.connectClient([](const nix::remote::SchedMsg &) -> bool { return true; }, [] {});612 | ^613 | -> void614../tests/dispatcher-session-test.cc:150:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]615 150 | .send = [&](const nix::remote::SchedCmd & cmd) {616 | ^617 | -> bool618../tests/dispatcher-session-test.cc:168:10: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]619 5 | for (uint32_t const version : {0U, nixgrpc::reverseProtocolVersion + 1}) {620 | ^621../tests/dispatcher-session-test.cc:182:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]622 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});623 | ^624 | -> bool625../tests/dispatcher-session-test.cc:182:103: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]626 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});627 | ^628 | -> void629../tests/dispatcher-session-test.cc:190:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]630 190 | .send = [](const nix::remote::SchedCmd &) { return true; },631 | ^632 | -> bool633>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-frames-test.cc634../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]635 23 | static constexpr size_t maxFrameBytes = 64 * 1024;636 | ^637../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning638 23 | static constexpr size_t maxFrameBytes = 64 * 1024;639 | ^~~~~~~~~640 | static_cast<const size_t>( )641../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type642 23 | static constexpr size_t maxFrameBytes = 64 * 1024;643 | ^~644 | static_cast<long>( )645../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]646 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;647 | ^648../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning649 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;650 | ^~~~~~~~~~~~~~~651 | static_cast<const size_t>( )652../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type653 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;654 | ^~~~~~~~655 | static_cast<long>( )656../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]657 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool658 | ^659../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]660 53 | auto data(uint64_t id, std::string_view bytes) -> bool661 | ^662../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]663 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);664 | ^665../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]666 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool667 | ^668../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]669 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool670 | ^671 | const &672../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]673 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;674 | ^ 675 | {676../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]677 81 | if (size > limit) return false;678 | ^ 679 | {680../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]681 83 | cv.wait(lock, stop, [&] {682 | ^683 | -> bool684../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]685 84 | auto it = streams.find(id);686 | ^687../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]688 87 | auto const it = streams.find(id);689 | ^690../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]691 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;692 | ^ 693 | {694../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]695 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }696 | ^697../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]698 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }699 | ^700../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]701 96 | auto acknowledge(uint64_t id) -> bool702 | ^703../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]704 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;705 | ^ 706 | {707../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]708 105 | if (!enqueue(std::move(msg))) return false;709 | ^ 710 | {711../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]712 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool713 | ^714 | const &715../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]716 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });717 | ^718 | -> bool719../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]720 145 | auto finished(uint64_t id) -> bool721 | ^722../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]723 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;724 | ^ 725 | {726../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]727 150 | if (removed) cv.notify_all();728 | ^ 729 | {730../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]731 156 | void acknowledgementSent(uint64_t id)732 | ^733../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]734 159 | if (acknowledged.erase(id)) streams.erase(id);735 | ^ 736 | != 0u737../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]738 159 | if (acknowledged.erase(id)) streams.erase(id);739 | ^ 740 | {741../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]742 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {743 | ^744../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]745 208 | auto terminal(uint64_t id, bool abort) -> bool746 | ^747../tests/reverse-frames-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]748 8 | int main()749 | ~~~ ^ 750 | auto -> int751../tests/reverse-frames-test.cc:11:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]752 6 | #include "reverse-frames.hh"753 7 | 754 8 | int main()755 9 | {756 10 | nixgrpc::ReverseFrames frames;757 11 | nix::remote::ReverseOpen start;758 | ^759../tests/reverse-frames-test.cc:26:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]760 26 | nix::remote::ReverseFarmMsg msg;761 | ^762../tests/reverse-frames-test.cc:52:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]763 2 | for (uint64_t id = 3; id < 3 + nixgrpc::ReverseFrames::maxStreams; ++id) {764 | ^765../tests/reverse-frames-test.cc:56:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]766 2 | size_t queued = 0;767 | ^768../tests/reverse-frames-test.cc:70:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]769 70 | std::jthread waiter([&] {770 | ^771 | -> void772../tests/reverse-frames-test.cc:87:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]773 87 | std::jthread producer([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });774 | ^775 | -> void776../tests/reverse-frames-test.cc:93:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]777 93 | std::jthread interrupted([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });778 | ^779 | -> void780../tests/reverse-frames-test.cc:103:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]781 103 | std::jthread discarded([&] { enqueued = cancelled.waitData(1, payload, stillRunning.get_token()); });782 | ^783 | -> void784>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-capability-test.cc785../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]786 553 | namespaceClaim && namespaceClaim->is_string()) {787 | ^788 | ( != nullptr)789../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]790 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {791 | ^792 | ( != nullptr)793../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]794 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {795 | ^796../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]797 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {798 | ^799../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]800 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {801 | ^802../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]803 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {804 | ^805 | ( != nullptr)806../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]807 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {808 | ^809../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]810 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)811 | ^812../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]813 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||814 | ^815../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]816 96 | result.push_back(static_cast<char>(size >> (i * 8)));817 | ^818../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]819 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,820 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~821../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'822 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,823 | ^~~~~824../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'825 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,826 | ^~~~~~~~827../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]828 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);829 | ^~~830../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]831 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);832 | ^833../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]834 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)835 | ^836../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]837 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)838 | ^839../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]840 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||841 | ^842../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]843 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;844 | ^ 845 | {846../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]847 250 | unsigned char mac[EVP_MAX_MD_SIZE];848 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~849../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]850 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),851 | ~^852 | (853 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||854 | == nullptr)855../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]856 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||857 | ^858../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]859 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||860 | ^861../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]862 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);863 | ^864../tests/reverse-capability-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]865 7 | int main()866 | ~~~ ^ 867 | auto -> int868../tests/reverse-capability-test.cc:9:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]869 5 | #include "reverse-capability.hh"870 6 | 871 7 | int main()872 8 | {873 9 | using nixgrpc::Caller;874 | ^875../tests/reverse-capability-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]876 5 | #include "reverse-capability.hh"877 6 | 878 7 | int main()879 8 | {880 9 | using nixgrpc::Caller;881 10 | using nixgrpc::ReverseCapability;882 11 | using nixgrpc::Role;883 | ^884../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]885 19 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";886 | ^~~~~~~~~~887 | const auto *const 888../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]889 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);890 | ^891../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]892 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);893 | ^894../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]895 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);896 | ^897../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]898 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);899 | ^900../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]901 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);902 | ^903../tests/reverse-capability-test.cc:25:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]904 5 | nix::remote::ReverseOpen open;905 | ^906../tests/reverse-capability-test.cc:31:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]907 31 | nix::remote::BuildDerivationRequest request;908 | ^909../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]910 33 | request.set_assign_id(93);911 | ^912../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]913 35 | request.set_assign_id(94);914 | ^915../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]916 37 | request.set_assign_id(93);917 | ^918../tests/reverse-capability-test.cc:38:40: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]919 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));920 | ^921../tests/reverse-capability-test.cc:38:55: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors]922 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));923 | ^924../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]925 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);926 | ^927../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]928 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);929 | ^930../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]931 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);932 | ^933../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]934 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);935 | ^936../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]937 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);938 | ^939../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]940 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);941 | ^942../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]943 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);944 | ^945../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]946 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);947 | ^948../tests/reverse-capability-test.cc:75:18: error: no header providing "nix::remote::AddMultipleChunk" is directly included [misc-include-cleaner,-warnings-as-errors]949 75 | nix::remote::AddMultipleChunk first;950 | ^951../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]952 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,953 | ^954../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]955 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,956 | ^957../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]958 81 | "abc.drv", 93, 0, now);959 | ^960../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]961 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);962 | ^963../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]964 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);965 | ^966../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]967 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,968 | ^969../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]970 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,971 | ^972../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]973 98 | "abc.drv", 93, 0, now);974 | ^975../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]976 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);977 | ^978../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]979 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);980 | ^981../tests/reverse-capability-test.cc:105:24: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors]982 3 | noRole.role = std::nullopt;983 | ^984../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]985 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);986 | ^987../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]988 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);989 | ^990>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-roundtrip-test.cc991../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]992 553 | namespaceClaim && namespaceClaim->is_string()) {993 | ^994 | ( != nullptr)995../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]996 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {997 | ^998 | ( != nullptr)999../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1000 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1001 | ^1002../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1003 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1004 | ^1005../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1006 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1007 | ^1008../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1009 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1010 | ^1011 | ( != nullptr)1012../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1013 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1014 | ^1015../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1016 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1017 | ^1018../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]1019 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1020 | ^1021../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]1022 96 | result.push_back(static_cast<char>(size >> (i * 8)));1023 | ^1024../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]1025 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1026 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1027../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1028 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1029 | ^~~~~1030../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1031 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1032 | ^~~~~~~~1033../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]1034 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1035 | ^~~1036../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]1037 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1038 | ^1039../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1040 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1041 | ^1042../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1043 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1044 | ^1045../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]1046 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1047 | ^1048../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1049 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1050 | ^ 1051 | {1052../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]1053 250 | unsigned char mac[EVP_MAX_MD_SIZE];1054 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1055../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1056 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1057 | ~^1058 | (1059 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1060 | == nullptr)1061../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1062 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1063 | ^1064../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]1065 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1066 | ^1067../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1068 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1069 | ^1070../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]1071 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1072 | ^1073../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1074 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1075 | ^~~~~~~~~1076 | static_cast<const size_t>( )1077../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1078 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1079 | ^~1080 | static_cast<long>( )1081../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]1082 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1083 | ^1084../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1085 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1086 | ^~~~~~~~~~~~~~~1087 | static_cast<const size_t>( )1088../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1089 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1090 | ^~~~~~~~1091 | static_cast<long>( )1092../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]1093 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1094 | ^1095../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]1096 53 | auto data(uint64_t id, std::string_view bytes) -> bool1097 | ^1098../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]1099 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1100 | ^1101../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]1102 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1103 | ^1104../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]1105 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1106 | ^1107 | const &1108../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1109 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1110 | ^ 1111 | {1112../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1113 81 | if (size > limit) return false;1114 | ^ 1115 | {1116../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1117 83 | cv.wait(lock, stop, [&] {1118 | ^1119 | -> bool1120../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]1121 84 | auto it = streams.find(id);1122 | ^1123../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]1124 87 | auto const it = streams.find(id);1125 | ^1126../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1127 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1128 | ^ 1129 | {1130../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]1131 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1132 | ^1133../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]1134 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1135 | ^1136../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]1137 96 | auto acknowledge(uint64_t id) -> bool1138 | ^1139../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1140 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1141 | ^ 1142 | {1143../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1144 105 | if (!enqueue(std::move(msg))) return false;1145 | ^ 1146 | {1147../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]1148 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1149 | ^1150 | const &1151../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1152 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1153 | ^1154 | -> bool1155../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]1156 145 | auto finished(uint64_t id) -> bool1157 | ^1158../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1159 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1160 | ^ 1161 | {1162../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1163 150 | if (removed) cv.notify_all();1164 | ^ 1165 | {1166../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]1167 156 | void acknowledgementSent(uint64_t id)1168 | ^1169../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1170 159 | if (acknowledged.erase(id)) streams.erase(id);1171 | ^ 1172 | != 0u1173../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1174 159 | if (acknowledged.erase(id)) streams.erase(id);1175 | ^ 1176 | {1177../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]1178 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1179 | ^1180../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]1181 208 | auto terminal(uint64_t id, bool abort) -> bool1182 | ^1183../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]1184 50 | auto const id = frame.stream_id();1185 | ^1186../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]1187 68 | auto it = streams.find(id);1188 | ^1189../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1190 74 | && finishedIds.erase(id))1191 | ^ 1192 | ( != 0u)1193../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1194 74 | && finishedIds.erase(id))1195 | ^1196 | {1197 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};1198 | 1199../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]1200 109 | auto finished(uint64_t id) -> bool1201 | ^1202../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1203 111 | if (cancelledIds.erase(id)) return true;1204 | ^ 1205 | != 0u1206../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1207 111 | if (cancelledIds.erase(id)) return true;1208 | ^ 1209 | {1210../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1211 112 | if (!streams.erase(id)) return false;1212 | ~^ 1213 | == 0u1214../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1215 112 | if (!streams.erase(id)) return false;1216 | ^ 1217 | {1218../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]1219 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {1220 | ^1221../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]1222 82 | auto it = sessions.find(std::string(workerId));1223 | ^1224../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]1225 92 | auto it = sessions.find(handle->workerId);1226 | ^1227../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]1228 107 | auto it = sessions.find(handle->workerId);1229 | ^1230../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]1231 130 | for (auto & [id, session] : sessions) {1232 | ^1233../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]1234 32 | [[nodiscard]] auto open(uint64_t id) -> bool1235 | ^1236../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]1237 51 | auto it = streams.find(frame.stream_id());1238 | ^1239../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1240 56 | if (!cancelled.contains(frame.stream_id())) return false;1241 | ^ 1242 | {1243../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1244 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;1245 | ^ 1246 | {1247../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]1248 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1249 | ^1250../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]1251 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1252 | ^1253 | const &1254../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1255 104 | auto pending = [&] {1256 | ^1257 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>1258../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]1259 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1260 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~1261 | std::ranges::find_if queue1262../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1263 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1264 | ^1265 | -> auto1266../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1267 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });1268 | ^1269 | -> bool1270../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]1271 111 | auto it = pending();1272 | ^1273../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]1274 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool1275 | ^1276../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1277 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);1278 | ^ 1279 | {1280../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]1281 168 | [[nodiscard]] auto finished(uint64_t id) -> bool1282 | ^1283../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]1284 171 | auto it = streams.find(id);1285 | ^1286../tests/reverse-roundtrip-test.cc:10:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1287 10 | int main()1288 | ~~~ ^ 1289 | auto -> int1290../tests/reverse-roundtrip-test.cc:12:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1291 4 | #include "reverse-capability.hh"1292 5 | #include "reverse-frames.hh"1293 6 | #include "reverse-inbound.hh"1294 7 | #include "reverse-registry.hh"1295 8 | #include "reverse-responses.hh"1296 9 | 1297 10 | int main()1298 11 | {1299 12 | using nixgrpc::Caller;1300 | ^1301../tests/reverse-roundtrip-test.cc:18:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1302 4 | #include "reverse-capability.hh"1303 5 | #include "reverse-frames.hh"1304 6 | #include "reverse-inbound.hh"1305 7 | #include "reverse-registry.hh"1306 8 | #include "reverse-responses.hh"1307 9 | 1308 10 | int main()1309 11 | {1310 12 | using nixgrpc::Caller;1311 13 | using nixgrpc::ReverseCapability;1312 14 | using nixgrpc::ReverseFrames;1313 15 | using nixgrpc::ReverseInbound;1314 16 | using nixgrpc::ReverseRegistry;1315 17 | using nixgrpc::ReverseResponses;1316 18 | using nixgrpc::Role;1317 | ^1318../tests/reverse-roundtrip-test.cc:25:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1319 25 | auto handle = registry.registerWorker(worker, worker, [] {}, *key);1320 | ^1321 | -> void1322../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]1323 33 | "BuildDerivation", writer, "assigned.drv", 42, 0);1324 | ^1325../tests/reverse-roundtrip-test.cc:35:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1326 4 | nix::remote::ReverseOpen start;1327 | ^1328../tests/reverse-roundtrip-test.cc:38:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1329 3 | assert(outgoing.open(1, std::move(start)) && outgoing.data(1, "request bytes") && outgoing.halfClose(1));1330 | ^1331../tests/reverse-roundtrip-test.cc:40:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1332 40 | nix::remote::ReverseFarmMsg toWorker;1333 | ^1334../tests/reverse-roundtrip-test.cc:44:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]1335 44 | nix::remote::BuildDerivationRequest request;1336 | ^1337../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]1338 46 | request.set_assign_id(42);1339 | ^1340../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]1341 48 | request.set_assign_id(43);1342 | ^1343../tests/reverse-roundtrip-test.cc:50:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]1344 50 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::data);1345 | ^1346/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1347 138 | ((__VA_ARGS__) \1348 | ^~~~~~~~~~~1349../tests/reverse-roundtrip-test.cc:51:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]1350 51 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::halfClose);1351 | ^1352/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1353 138 | ((__VA_ARGS__) \1354 | ^~~~~~~~~~~1355../tests/reverse-roundtrip-test.cc:54:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1356 54 | nix::remote::ReverseWorkerMsg fromWorker;1357 | ^1358../tests/reverse-roundtrip-test.cc:58:55: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1359 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1360 | ^1361../tests/reverse-roundtrip-test.cc:58:71: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]1362 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1363 | ^1364../tests/reverse-roundtrip-test.cc:68:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1365 68 | auto replacement = registry.registerWorker(worker, worker, [] {}, *nextKey);1366 | ^1367 | -> void1368>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-upload-test.cc1369../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1370 553 | namespaceClaim && namespaceClaim->is_string()) {1371 | ^1372 | ( != nullptr)1373../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1374 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1375 | ^1376 | ( != nullptr)1377../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1378 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1379 | ^1380../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1381 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1382 | ^1383../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1384 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1385 | ^1386../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1387 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1388 | ^1389 | ( != nullptr)1390../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1391 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1392 | ^1393../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1394 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1395 | ^1396../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]1397 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1398 | ^1399../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]1400 96 | result.push_back(static_cast<char>(size >> (i * 8)));1401 | ^1402../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]1403 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1404 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1405../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1406 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1407 | ^~~~~1408../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1409 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1410 | ^~~~~~~~1411../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]1412 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1413 | ^~~1414../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]1415 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1416 | ^1417../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1418 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1419 | ^1420../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1421 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1422 | ^1423../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]1424 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1425 | ^1426../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1427 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1428 | ^ 1429 | {1430../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]1431 250 | unsigned char mac[EVP_MAX_MD_SIZE];1432 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1433../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1434 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1435 | ~^1436 | (1437 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1438 | == nullptr)1439../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1440 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1441 | ^1442../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]1443 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1444 | ^1445../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1446 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1447 | ^1448../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]1449 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1450 | ^1451../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1452 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1453 | ^~~~~~~~~1454 | static_cast<const size_t>( )1455../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1456 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1457 | ^~1458 | static_cast<long>( )1459../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]1460 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1461 | ^1462../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1463 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1464 | ^~~~~~~~~~~~~~~1465 | static_cast<const size_t>( )1466../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1467 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1468 | ^~~~~~~~1469 | static_cast<long>( )1470../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]1471 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1472 | ^1473../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]1474 53 | auto data(uint64_t id, std::string_view bytes) -> bool1475 | ^1476../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]1477 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1478 | ^1479../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]1480 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1481 | ^1482../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]1483 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1484 | ^1485 | const &1486../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1487 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1488 | ^ 1489 | {1490../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1491 81 | if (size > limit) return false;1492 | ^ 1493 | {1494../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1495 83 | cv.wait(lock, stop, [&] {1496 | ^1497 | -> bool1498../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]1499 84 | auto it = streams.find(id);1500 | ^1501../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]1502 87 | auto const it = streams.find(id);1503 | ^1504../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1505 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1506 | ^ 1507 | {1508../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]1509 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1510 | ^1511../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]1512 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1513 | ^1514../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]1515 96 | auto acknowledge(uint64_t id) -> bool1516 | ^1517../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1518 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1519 | ^ 1520 | {1521../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1522 105 | if (!enqueue(std::move(msg))) return false;1523 | ^ 1524 | {1525../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]1526 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1527 | ^1528 | const &1529../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1530 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1531 | ^1532 | -> bool1533../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]1534 145 | auto finished(uint64_t id) -> bool1535 | ^1536../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1537 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1538 | ^ 1539 | {1540../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1541 150 | if (removed) cv.notify_all();1542 | ^ 1543 | {1544../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]1545 156 | void acknowledgementSent(uint64_t id)1546 | ^1547../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1548 159 | if (acknowledged.erase(id)) streams.erase(id);1549 | ^ 1550 | != 0u1551../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1552 159 | if (acknowledged.erase(id)) streams.erase(id);1553 | ^ 1554 | {1555../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]1556 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1557 | ^1558../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]1559 208 | auto terminal(uint64_t id, bool abort) -> bool1560 | ^1561../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]1562 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1563 | ^1564../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]1565 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1566 | ^1567 | -> bool1568../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]1569 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1570 | ^1571../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1572 33 | if (assigned && !assigned()) return false;1573 | ^ 1574 | {1575../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]1576 35 | std::scoped_lock lock(mutex);1577 | ^1578 | const 1579../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1580 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;1581 | ^ 1582 | {1583../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1584 42 | if (!ok) cancel();1585 | ^ 1586 | {1587../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]1588 49 | std::scoped_lock lock(mutex);1589 | ^1590 | const 1591../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1592 68 | if (closed) return false;1593 | ^ 1594 | {1595../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1596 79 | if (ended || !chunks.empty()) break;1597 | ^ 1598 | {1599../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]1600 80 | cv.wait_for(lock, std::chrono::milliseconds(25));1601 | ^1602../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1603 82 | if (chunks.empty()) return false;1604 | ^ 1605 | {1606../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]1607 92 | std::scoped_lock lock(mutex);1608 | ^1609 | const 1610../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]1611 103 | cv.wait_for(lock, std::chrono::milliseconds(25));1612 | ^1613../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1614 113 | if (!ended || closed || !chunks.empty()) return false;1615 | ^ 1616 | {1617../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]1618 120 | std::scoped_lock lock(mutex);1619 | ^1620 | const 1621../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]1622 129 | std::scoped_lock lock(mutex);1623 | ^1624 | const 1625../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]1626 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1627 | ^1628../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning1629 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1630 | ^~~~~~~~~~~1631 | static_cast<const size_t>( )1632../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type1633 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1634 | ^~~~1635 | static_cast<long>( )1636../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1637 49 | if (failed || bytes.empty() || !consume) return fail();1638 | ^ 1639 | {1640../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]1641 53 | buffer.append(bytes.data(), count);1642 | ~~~~~~^~~~1643../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1644 57 | for (unsigned i = 0; i < 4; ++i)1645 | ^1646 | {1647 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1648 | 1649../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]1650 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1651 | ^~~1652../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]1653 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1654 | ^1655../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1656 59 | if (length == 0 || length > maxChunkBytes) return fail();1657 | ^ 1658 | {1659../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1660 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))1661 | ^1662../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1663 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))1664 | ^1665 | {1666 66 | return fail();1667 | 1668../tests/reverse-upload-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1669 7 | int main()1670 | ~~~ ^ 1671 | auto -> int1672../tests/reverse-upload-test.cc:9:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]1673 4 | #include "reverse-upload.hh"1674 5 | #include "reverse-upload-pipe.hh"1675 6 | 1676 7 | int main()1677 8 | {1678 9 | auto key = nixgrpc::ReverseCapability::newKey();1679 | ^1680../tests/reverse-upload-test.cc:12:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1681 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1682 | ^1683 | const 1684../tests/reverse-upload-test.cc:12:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1685 4 | #include "reverse-upload.hh"1686 5 | #include "reverse-upload-pipe.hh"1687 6 | 1688 7 | int main()1689 8 | {1690 9 | auto key = nixgrpc::ReverseCapability::newKey();1691 10 | assert(key);1692 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1693 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1694 | ^1695../tests/reverse-upload-test.cc:12:63: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1696 4 | #include "reverse-upload.hh"1697 5 | #include "reverse-upload-pipe.hh"1698 6 | 1699 7 | int main()1700 8 | {1701 9 | auto key = nixgrpc::ReverseCapability::newKey();1702 10 | assert(key);1703 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1704 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1705 | ^1706../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]1707 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);1708 | ^1709../tests/reverse-upload-test.cc:19:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1710 4 | #include "reverse-upload.hh"1711 5 | #include "reverse-upload-pipe.hh"1712 6 | 1713 7 | int main()1714 8 | {1715 9 | auto key = nixgrpc::ReverseCapability::newKey();1716 10 | assert(key);1717 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1718 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,1719 13 | .kind = nixgrpc::Caller::Kind::named};1720 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);1721 15 | assert(token);1722 16 | auto delegated = nixgrpc::ReverseCapability::verify(*key, *token, worker, 1, 1, "UploadBuildInputs");1723 17 | assert(delegated);1724 18 | 1725 19 | nix::remote::UploadBuildInputsChunk first;1726 | ^1727../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]1728 21 | first.set_assign_id(42);1729 | ^1730../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]1731 24 | first.set_assign_id(43);1732 | ^1733../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]1734 26 | first.set_assign_id(42);1735 | ^1736../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]1737 39 | next.set_assign_id(42);1738 | ^1739../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]1740 52 | auto buildToken = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42);1741 | ^1742../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]1743 62 | follow.mutable_chunk()->set_data(std::string(70000, 'z'));1744 | ^1745../tests/reverse-upload-test.cc:65:41: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1746 2 | auto const length = static_cast<uint32_t>(part.size());1747 | ^1748../tests/reverse-upload-test.cc:66:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1749 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1750 | ^ 1751 | {1752../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]1753 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1754 | ^1755../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]1756 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1757 | ^1758../tests/reverse-upload-test.cc:70:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]1759 2 | size_t count = 0;1760 | ^1761../tests/reverse-upload-test.cc:71:20: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1762 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {1763 | ^1764 | -> bool1765../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]1766 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {1767 | ^1768../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]1769 73 | return count == 1 ? part.chunk().data() == "header" : part.chunk().data().size() == 70000;1770 | ^1771../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]1772 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)1773 | ^1774../tests/reverse-upload-test.cc:75:67: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1775 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)1776 | ^1777 | {1778 76 | assert(decoder.feed(std::string_view(wire).substr(offset, 16381), consume));1779 | 1780../tests/reverse-upload-test.cc:86:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1781 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));1782 | ^1783 | -> bool1784/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1785 138 | ((__VA_ARGS__) \1786 | ^1787../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]1788 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));1789 | ^1790../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]1791 89 | follow.set_assign_id(42);1792 | ^1793../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]1794 91 | std::string wireNext = follow.SerializeAsString();1795 | ^1796 | const 1797../tests/reverse-upload-test.cc:95:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1798 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1799 | ^ 1800 | {1801../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]1802 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1803 | ^1804../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]1805 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1806 | ^1807../tests/reverse-upload-test.cc:98:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1808 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));1809 | ^1810 | -> bool1811/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1812 138 | ((__VA_ARGS__) \1813 | ^1814../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]1815 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));1816 | ^1817../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]1818 106 | largePart.mutable_chunk()->set_data(std::string(70000, 'z'));1819 | ^1820../tests/reverse-upload-test.cc:108:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1821 108 | auto push = [&](std::string_view data) {1822 | ^1823 | -> void1824../tests/reverse-upload-test.cc:111:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1825 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1826 | ^ 1827 | {1828../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]1829 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1830 | ^1831../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]1832 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1833 | ^1834../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]1835 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)1836 | ^1837../tests/reverse-upload-test.cc:113:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1838 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)1839 | ^1840 | {1841 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1842 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1843 | 1844../tests/reverse-upload-test.cc:114:13: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors]1845 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1846 | ^1847../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]1848 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),1849 | ^1850/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:137:13: note: macro 'assert' defined here1851 137 | # define assert(...) \1852 | ^1853../tests/reverse-upload-test.cc:115:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1854 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1855 | ^1856 | -> bool1857/nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'1858 138 | ((__VA_ARGS__) \1859 | ^1860../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]1861 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));1862 | ^1863../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]1864 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);1865 | ^1866../tests/reverse-upload-test.cc:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1867 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);1868 | ^ 1869 | {1870../tests/reverse-upload-test.cc:125:18: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1871 125 | auto frame = [](const nix::remote::UploadBuildInputsChunk & chunk) {1872 | ^1873 | -> std::string1874../tests/reverse-upload-test.cc:129:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1875 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1876 | ^ 1877 | {1878../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]1879 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1880 | ^1881../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]1882 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1883 | ^1884../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]1885 136 | for (size_t i = 0; i < 80; ++i) {1886 | ^1887>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-worker-test.cc1888../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1889 553 | namespaceClaim && namespaceClaim->is_string()) {1890 | ^1891 | ( != nullptr)1892../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1893 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1894 | ^1895 | ( != nullptr)1896../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1897 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1898 | ^1899../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1900 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1901 | ^1902../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1903 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1904 | ^1905../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1906 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1907 | ^1908 | ( != nullptr)1909../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1910 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1911 | ^1912../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1913 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1914 | ^1915../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]1916 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1917 | ^1918../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]1919 96 | result.push_back(static_cast<char>(size >> (i * 8)));1920 | ^1921../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]1922 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1923 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1924../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1925 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1926 | ^~~~~1927../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1928 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1929 | ^~~~~~~~1930../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]1931 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1932 | ^~~1933../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]1934 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1935 | ^1936../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1937 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1938 | ^1939../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1940 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1941 | ^1942../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]1943 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1944 | ^1945../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1946 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1947 | ^ 1948 | {1949../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]1950 250 | unsigned char mac[EVP_MAX_MD_SIZE];1951 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1952../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1953 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1954 | ~^1955 | (1956 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1957 | == nullptr)1958../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1959 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1960 | ^1961../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]1962 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1963 | ^1964../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1965 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1966 | ^1967../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]1968 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1969 | ^1970../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1971 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1972 | ^~~~~~~~~1973 | static_cast<const size_t>( )1974../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1975 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1976 | ^~1977 | static_cast<long>( )1978../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]1979 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1980 | ^1981../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1982 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1983 | ^~~~~~~~~~~~~~~1984 | static_cast<const size_t>( )1985../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1986 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1987 | ^~~~~~~~1988 | static_cast<long>( )1989../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]1990 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1991 | ^1992../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]1993 53 | auto data(uint64_t id, std::string_view bytes) -> bool1994 | ^1995../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]1996 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1997 | ^1998../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]1999 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool2000 | ^10469 54 | WorkerIdentity & identity;10470 | ^10471../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]10472 55 | ReverseRegistry & registry;10473 | ^10474../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]10475 56 | Auth & workerAuth;10476 | ^10477../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]10478 104 | std::string_view value(first->second.data(), first->second.size());10479 | ^10480 | const 10481../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10482 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },10483 | ^10484 | -> void10485../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10486 139 | struct Cleanup10487 | ^10488../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]10489 139 | struct Cleanup10490 | ^10491../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]10492 141 | ReverseRegistry & registry;10493 | ^10494../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]10495 149 | } cleanup{registry, *handle, cancellation};10496 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10497 | .registry=.handle= .cancellation=10498../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here10499 139 | struct Cleanup10500 | ^10501../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]10502 156 | std::condition_variable_any cv;10503 | ^10504../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10505 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10506 | ^10507 | const 10508../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10509 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10510 | ^10511 | -> void10512../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]10513 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10514 | ^10515 | const &10516../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10517 161 | cv.wait_until(lock, stop, deadline, [] { return false; });10518 | ^10519 | -> bool10520../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10521 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10522 | ^10523 | const 10524../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10525 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10526 | ^10527 | -> void10528../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]10529 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10530 | ^10531 | const &10532../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10533 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());10534 | ^ 10535 | {10536../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]10537 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10538 | ^10539../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]10540 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10541 | ^10542 | -> bool10543../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]10544 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10545 | ^10546../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10547 33 | if (assigned && !assigned()) return false;10548 | ^ 10549 | {10550../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]10551 35 | std::scoped_lock lock(mutex);10552 | ^10553 | const 10554../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10555 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;10556 | ^ 10557 | {10558../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10559 42 | if (!ok) cancel();10560 | ^ 10561 | {10562../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]10563 49 | std::scoped_lock lock(mutex);10564 | ^10565 | const 10566../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10567 68 | if (closed) return false;10568 | ^ 10569 | {10570../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10571 79 | if (ended || !chunks.empty()) break;10572 | ^ 10573 | {10574../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]10575 80 | cv.wait_for(lock, std::chrono::milliseconds(25));10576 | ^10577../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10578 82 | if (chunks.empty()) return false;10579 | ^ 10580 | {10581../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]10582 92 | std::scoped_lock lock(mutex);10583 | ^10584 | const 10585../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]10586 103 | cv.wait_for(lock, std::chrono::milliseconds(25));10587 | ^10588../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10589 113 | if (!ended || closed || !chunks.empty()) return false;10590 | ^ 10591 | {10592../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]10593 120 | std::scoped_lock lock(mutex);10594 | ^10595 | const 10596../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]10597 129 | std::scoped_lock lock(mutex);10598 | ^10599 | const 10600../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]10601 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10602 | ^10603../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning10604 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10605 | ^~~~~~~~~~~10606 | static_cast<const size_t>( )10607../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type10608 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10609 | ^~~~10610 | static_cast<long>( )10611../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10612 49 | if (failed || bytes.empty() || !consume) return fail();10613 | ^ 10614 | {10615../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]10616 53 | buffer.append(bytes.data(), count);10617 | ~~~~~~^~~~10618../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10619 57 | for (unsigned i = 0; i < 4; ++i)10620 | ^10621 | {10622 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10623 | 10624../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]10625 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10626 | ^~~10627../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]10628 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10629 | ^10630../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10631 59 | if (length == 0 || length > maxChunkBytes) return fail();10632 | ^ 10633 | {10634../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]10635 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))10636 | ^10637../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10638 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))10639 | ^10640 | {10641 66 | return fail();10642 | 10643../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]10644 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();10645 | ^10646../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10647 371 | auto const it = workerIds.find(std::string(addr));10648 | ^10649../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]10650 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience10651 | ^10652../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10653 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {10654 | ^10655 | -> bool10656../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]10657 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {10658 | ^10659../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]10660 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10661 | ^10662../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]10663 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10664 | ^10665../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]10666 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10667 | ^10668../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]10669 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10670 | ^10671../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]10672 44 | if (uid[i] != '-') {10673 | ^~~10674../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]10675 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10676 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10677 | < || > && < || >10678../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]10679 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10680 | ^~~10681../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]10682 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10683 | ^~~10684../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]10685 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10686 | ^~~10687../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]10688 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10689 | ^~~10690../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]10691 96 | auto const & id = *result.identity;10692 | ^10693../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10694 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime10695 | ^~~~~~~~~~~~10696../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10697 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {10698 | ^~~~~~~~~~~~10699../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10700 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;10701 | ^~~~~~~~~10702../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10703 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};10704 | ^~~~~~~~~~~~10705../tests/oidc-test.cc:4:1: error: included header atomic is not used directly [misc-include-cleaner,-warnings-as-errors]10706 4 | #include <atomic>10707 | ^~~~~~~~~~~~~~~~~10708 5 | #include <chrono>10709../tests/oidc-test.cc:243:53: error: no header providing "nix::remote::NixRemote" is directly included [misc-include-cleaner,-warnings-as-errors]10710 41 | class BuildRouteService final : public nix::remote::NixRemote::Service10711 | ^10712../tests/oidc-test.cc:245:31: error: member 'gateway' of type 'nixgrpc::ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]10713 245 | nixgrpc::ReverseGateway & gateway;10714 | ^10715../tests/oidc-test.cc:246:27: error: member 'dispatcher' of type 'nixgrpc::Dispatcher &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]10716 246 | nixgrpc::Dispatcher & dispatcher;10717 | ^10718../tests/oidc-test.cc:250:17: error: member variable 'drvPath' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors]10719 250 | std::string drvPath;10720 | ^10721../tests/oidc-test.cc:251:14: error: member variable 'assignId' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors]10722 251 | uint64_t assignId = 0;10723 | ^10724../tests/oidc-test.cc:252:17: error: member variable 'selectedPod' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors]10725 252 | std::string selectedPod;10726 | ^10727../tests/oidc-test.cc:253:10: error: member variable 'relayEnabled' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors]10728 253 | bool relayEnabled = false;10729 | ^10730../tests/oidc-test.cc:254:10: error: member variable 'buildRelayEnabled' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors]10731 254 | bool buildRelayEnabled = false;10732 | ^10733../tests/oidc-test.cc:256:67: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors]10734 42 | BuildRouteService(nixgrpc::ReverseGateway & gateway, nixgrpc::ReverseRegistry & registry,10735 | ^10736../tests/oidc-test.cc:260:70: error: no header providing "nix::remote::StoreInfoRequest" is directly included [misc-include-cleaner,-warnings-as-errors]10737 41 | auto StoreInfo(grpc::ServerContext * context, const nix::remote::StoreInfoRequest * request,10738 | ^10739../tests/oidc-test.cc:261:33: error: no header providing "nix::remote::StoreInfoReply" is directly included [misc-include-cleaner,-warnings-as-errors]10740 261 | nix::remote::StoreInfoReply * reply) -> grpc::Status override10741 | ^10742../tests/oidc-test.cc:261:66: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors]10743 10 | nix::remote::StoreInfoReply * reply) -> grpc::Status override10744 | ^10745../tests/oidc-test.cc:264:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10746 264 | return relay.call(*context, [&](uint64_t id) {10747 | ^10748 | -> Result10749../tests/oidc-test.cc:264:54: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10750 264 | return relay.call(*context, [&](uint64_t id) {10751 | ^10752../tests/oidc-test.cc:266:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10753 266 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },10754 | ^10755 | -> std::optional<std::string>10756../tests/oidc-test.cc:268:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10757 268 | }, *request, [&](std::string_view data) { return reply->ParseFromArray(data.data(), static_cast<int>(data.size())); });10758 | ^10759 | -> bool10760../tests/oidc-test.cc:271:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10761 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },10762 | ^10763 | -> std::optional<std::string>10764../tests/oidc-test.cc:271:61: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10765 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },10766 | ^10767../tests/oidc-test.cc:277:76: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]10768 277 | auto BuildDerivation(grpc::ServerContext * context, const nix::remote::BuildDerivationRequest * request,10769 | ^10770../tests/oidc-test.cc:278:58: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors]10771 278 | grpc::ServerWriter<nix::remote::BuildDerivationChunk> * writer) -> grpc::Status override10772 | ^10773../tests/oidc-test.cc:280:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10774 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};10775 | ^ 10776 | {10777../tests/oidc-test.cc:280:47: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]10778 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};10779 | ^10780../tests/oidc-test.cc:282:44: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10781 282 | auto status = relay.call(*context, [&](uint64_t id) {10782 | ^10783 | -> Result10784../tests/oidc-test.cc:282:57: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10785 282 | auto status = relay.call(*context, [&](uint64_t id) {10786 | ^10787../tests/oidc-test.cc:284:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10788 284 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },10789 | ^10790 | -> std::optional<std::string>10791../tests/oidc-test.cc:286:22: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10792 286 | }, *request, [&](std::string_view data) {10793 | ^10794 | -> bool10795../tests/oidc-test.cc:289:88: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10796 289 | chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET) return false;10797 | ^ 10798 | {10799../tests/oidc-test.cc:292:12: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10800 292 | }, [this, drv = request->drv_path(), assign = request->assign_id()] {10801 | ^10802 | -> bool10803../tests/oidc-test.cc:457:59: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10804 457 | check(!verifier.verify(ecKey.sign(claims({{"sub", 42}}))).identity,10805 | ^10806../tests/oidc-test.cc:507:26: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10807 507 | projectedAudience["aud"] = {"grpc://worker-tunnel"};10808 | ^~~~~~~10809../tests/oidc-test.cc:513:20: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10810 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";10811 | ^~~~~~~~~~~~~~~~~10812../tests/oidc-test.cc:513:37: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10813 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";10814 | ^~~~~~~10815../tests/oidc-test.cc:513:44: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10816 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";10817 | ^~~~~~~~10818../tests/oidc-test.cc:514:9: error: 'const auto replacementId' can be declared as 'const auto *const replacementId' [readability-qualified-auto,-warnings-as-errors]10819 514 | auto const replacementId = "pod:staging:12345678-1234-1234-1234-123456789abd";10820 | ^~~~~~~~~~10821 | const auto *const 10822../tests/oidc-test.cc:519:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10823 519 | otherAudience["aud"] = "grpc://cache";10824 | ^~~~~~~10825../tests/oidc-test.cc:522:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10826 522 | mixedAudience["aud"] = {"grpc://worker-tunnel", "grpc://cache"};10827 | ^~~~~~~10828../tests/oidc-test.cc:526:23: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10829 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production";10830 | ^~~~~~~~~~~~~~~~~10831../tests/oidc-test.cc:526:40: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10832 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production";10833 | ^~~~~~~~~~~~~10834../tests/oidc-test.cc:529:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10835 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";10836 | ^~~~~~~~~~~~~~~~~10837../tests/oidc-test.cc:529:33: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10838 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";10839 | ^~~~~~~~~~~~~~~~~~10840../tests/oidc-test.cc:529:51: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10841 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";10842 | ^~~~~~~~10843../tests/oidc-test.cc:532:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10844 532 | noUid["kubernetes.io"]["pod"].erase("uid");10845 | ^~~~~~~~~~~~~~~~~10846../tests/oidc-test.cc:532:31: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10847 532 | noUid["kubernetes.io"]["pod"].erase("uid");10848 | ^~~~~~~10849../tests/oidc-test.cc:536:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10850 536 | noPod["kubernetes.io"].erase("pod");10851 | ^~~~~~~~~~~~~~~~~10852../tests/oidc-test.cc:539:13: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10853 539 | noSa["kubernetes.io"].erase("serviceaccount");10854 | ^~~~~~~~~~~~~~~~~10855../tests/oidc-test.cc:542:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10856 542 | expired["exp"] = now() - longAgo;10857 | ^~~~~~~10858../tests/oidc-test.cc:548:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10859 548 | longLived["exp"] = now() + 3600;10860 | ^~~~~~~10861../tests/oidc-test.cc:548:36: error: 3600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10862 548 | longLived["exp"] = now() + 3600;10863 | ^10864../tests/oidc-test.cc:551:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10865 551 | backdated["iat"] = now() - 3000;10866 | ^~~~~~~10867../tests/oidc-test.cc:551:36: error: 3000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10868 551 | backdated["iat"] = now() - 3000;10869 | ^10870../tests/oidc-test.cc:552:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10871 552 | backdated["exp"] = now() + 3000;10872 | ^~~~~~~10873../tests/oidc-test.cc:552:36: error: 3000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10874 552 | backdated["exp"] = now() + 3000;10875 | ^10876../tests/oidc-test.cc:555:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10877 555 | futureIat["iat"] = now() + 1200;10878 | ^~~~~~~10879../tests/oidc-test.cc:555:36: error: 1200 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10880 555 | futureIat["iat"] = now() + 1200;10881 | ^10882../tests/oidc-test.cc:556:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10883 556 | futureIat["exp"] = now() + 1500;10884 | ^~~~~~~10885../tests/oidc-test.cc:556:36: error: 1500 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10886 556 | futureIat["exp"] = now() + 1500;10887 | ^10888../tests/oidc-test.cc:564:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10889 564 | later["exp"] = now() + validFor + 60;10890 | ^~~~~~~10891../tests/oidc-test.cc:564:43: error: 60 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10892 564 | later["exp"] = now() + validFor + 60;10893 | ^10894../tests/oidc-test.cc:576:18: error: no header providing "nixgrpc::Auth" is directly included [misc-include-cleaner,-warnings-as-errors]10895 38 | nixgrpc::Auth registrationAuth;10896 | ^10897../tests/oidc-test.cc:579:15: error: no header providing "grpc::SslServerCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]10898 10 | grpc::SslServerCredentialsOptions tls;10899 | ^10900../tests/oidc-test.cc:581:42: error: no header providing "GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY" is directly included [misc-include-cleaner,-warnings-as-errors]10901 10 | tls.client_certificate_request = GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY;10902 | ^10903../tests/oidc-test.cc:582:42: error: use designated initializer list to initialize 'value_type' (aka 'grpc::SslServerCredentialsOptions::PemKeyCertPair') [modernize-use-designated-initializers,-warnings-as-errors]10904 582 | tls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"), nix::readFile(dir + "/server.crt")});10905 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10906 | .private_key= .cert_chain=10907/nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here10908 48 | struct PemKeyCertPair {10909 | ^10910../tests/oidc-test.cc:586:55: error: no header providing "grpc::SslServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10911 586 | builder.AddListeningPort("127.0.0.1:0", grpc::SslServerCredentials(tls), &port);10912 | ^10913../tests/oidc-test.cc:587:55: error: no header providing "grpc::InsecureServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10914 587 | builder.AddListeningPort("127.0.0.1:0", grpc::InsecureServerCredentials(), &insecurePort);10915 | ^10916../tests/oidc-test.cc:595:15: error: no header providing "grpc::SslCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]10917 10 | grpc::SslCredentialsOptions roots;10918 | ^10919../tests/oidc-test.cc:600:87: error: no header providing "grpc::SslCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10920 600 | auto channel = grpc::CreateChannel("localhost:" + std::to_string(port), grpc::SslCredentials(workerTls));10921 | ^10922../tests/oidc-test.cc:601:34: error: no header providing "nix::remote::ReverseSession" is directly included [misc-include-cleaner,-warnings-as-errors]10923 601 | auto stub = nix::remote::ReverseSession::NewStub(channel);10924 | ^10925../tests/oidc-test.cc:609:26: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]10926 609 | nix::remote::ReverseWorkerMsg registration;10927 | ^10928../tests/oidc-test.cc:613:26: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]10929 613 | nix::remote::ReverseFarmMsg ack;10930 | ^10931../tests/oidc-test.cc:618:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10932 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10933 | ^10934 619 | {10935 | -> std::pair<std::unique_ptr<grpc::ClientReaderWriter<nix::remote::ReverseWorkerMsg, nix::remote::ReverseFarmMsg>>, unsigned long>10936../tests/oidc-test.cc:618:51: error: 2 adjacent parameters of 'operator()' of similar type ('const std::string &') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]10937 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10938 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10939../tests/oidc-test.cc:618:70: note: the first parameter in the range is 'credential'10940 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10941 | ^~~~~~~~~~10942../tests/oidc-test.cc:618:101: note: the last parameter in the range is 'claim'10943 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10944 | ^~~~~10945../tests/oidc-test.cc:630:13: error: variable 'accepted' of type 'bool' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10946 630 | bool accepted = stream->Read(&ack);10947 | ^10948 | const 10949../tests/oidc-test.cc:632:25: error: no header providing "std::pair" is directly included [misc-include-cleaner,-warnings-as-errors]10950 16 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};10951 | ^10952../tests/oidc-test.cc:632:35: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]10953 632 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};10954 | ^10955../tests/oidc-test.cc:659:88: error: no header providing "grpc::InsecureChannelCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10956 659 | grpc::CreateChannel("127.0.0.1:" + std::to_string(insecurePort), grpc::InsecureChannelCredentials()));10957 | ^10958../tests/oidc-test.cc:749:33: error: 99 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10959 749 | extra.set_stream_id(99);10960 | ^10961../tests/oidc-test.cc:760:86: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10962 760 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));10963 | ^10964../tests/oidc-test.cc:766:44: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]10965 41 | auto capability = nixgrpc::ReverseCapability::mint(10966 | ^10967../tests/oidc-test.cc:768:30: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]10968 768 | nixgrpc::Caller{.name = "read-client", .role = Role::readOnly,10969 | ^10970../tests/oidc-test.cc:770:30: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]10971 770 | nix::remote::ReverseOpen start;10972 | ^10973../tests/oidc-test.cc:772:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10974 772 | if (capability) start.set_capability(*capability);10975 | ^ 10976 | {10977../tests/oidc-test.cc:773:100: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]10978 773 | check(capability && transport.responses.open(1) && transport.outgoing.open(1, std::move(start)) &&10979 | ^10980../tests/oidc-test.cc:788:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10981 788 | if (secondCapability) secondStart.set_capability(*secondCapability);10982 | ^ 10983 | {10984../tests/oidc-test.cc:828:91: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10985 828 | firstCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10986 | ^10987../tests/oidc-test.cc:840:92: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10988 840 | secondCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10989 | ^10990../tests/oidc-test.cc:853:91: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10991 853 | otherCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10992 | ^10993../tests/oidc-test.cc:868:90: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]10994 868 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));10995 | ^10996../tests/oidc-test.cc:870:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10997 870 | soon["exp"] = now() + 2;10998 | ^~~~~~~10999../tests/oidc-test.cc:880:90: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11000 880 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11001 | ^11002../tests/oidc-test.cc:882:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11003 882 | soon["exp"] = now() + 2;11004 | ^~~~~~~11005../tests/oidc-test.cc:900:90: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11006 900 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11007 | ^11008../tests/oidc-test.cc:924:14: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors]11009 12 | std::optional<Verifier> noClientOidc;11010 | ^11011../tests/oidc-test.cc:931:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11012 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11013 | ^11014 | -> bool11015../tests/oidc-test.cc:931:80: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11016 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11017 | ^11018../tests/oidc-test.cc:934:18: error: no header providing "nixgrpc::IdleTracker" is directly included [misc-include-cleaner,-warnings-as-errors]11019 40 | nixgrpc::IdleTracker idle;11020 | ^11021../tests/oidc-test.cc:941:49: error: no header providing "GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY" is directly included [misc-include-cleaner,-warnings-as-errors]11022 941 | controlTls.client_certificate_request = GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;11023 | ^11024../tests/oidc-test.cc:942:49: error: use designated initializer list to initialize 'value_type' (aka 'grpc::SslServerCredentialsOptions::PemKeyCertPair') [modernize-use-designated-initializers,-warnings-as-errors]11025 942 | controlTls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"),11026 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11027 | .private_key=11028 943 | nix::readFile(dir + "/server.crt")});11029 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11030 | .cert_chain=11031/nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here11032 48 | struct PemKeyCertPair {11033 | ^11034../tests/oidc-test.cc:952:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11035 952 | if (!controlServer) return check.result();11036 | ^ 11037 | {11038../tests/oidc-test.cc:958:41: error: no header providing "nix::remote::Scheduler" is directly included [misc-include-cleaner,-warnings-as-errors]11039 958 | auto controlStub = nix::remote::Scheduler::NewStub(controlChannel);11040 | ^11041../tests/oidc-test.cc:963:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11042 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11043 | ^11044 | -> std::unique_ptr< ::grpc::ClientReaderWriter< ::nix::remote::WorkerMsgs, ::nix::remote::SchedCmds>>11045../tests/oidc-test.cc:963:56: error: 2 adjacent parameters of 'operator()' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]11046 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11047 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11048../tests/oidc-test.cc:963:73: note: the first parameter in the range is 'claim'11049 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11050 | ^~~~~11051../tests/oidc-test.cc:963:97: note: the last parameter in the range is 'addr'11052 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11053 | ^~~~11054../tests/oidc-test.cc:965:26: error: no header providing "nix::remote::WorkerMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11055 965 | nix::remote::WorkerMsgs messages;11056 | ^11057../tests/oidc-test.cc:988:26: error: no header providing "nix::remote::SchedCmds" is directly included [misc-include-cleaner,-warnings-as-errors]11058 988 | nix::remote::SchedCmds commands;11059 | ^11060../tests/oidc-test.cc:1033:86: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11061 1033 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11062 | ^11063../tests/oidc-test.cc:1036:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11064 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11065 | ^11066 | -> bool11067../tests/oidc-test.cc:1036:74: error: no header providing "nix::remote::SchedMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11068 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11069 | ^11070../tests/oidc-test.cc:1036:104: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11071 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11072 | ^11073 | -> void11074../tests/oidc-test.cc:1037:26: error: no header providing "nix::remote::ClientMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11075 1037 | nix::remote::ClientMsgs want;11076 | ^11077../tests/oidc-test.cc:1046:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11078 1046 | auto const id = commands.msgs(0).expect().assign_id();11079 | ^11080../tests/oidc-test.cc:1074:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11081 1074 | auto reauth = [](std::string tokenValue) {11082 | ^11083 | -> nix::remote::WorkerMsgs11084../tests/oidc-test.cc:1076:67: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11085 1076 | messages.add_msgs()->mutable_reauth()->set_token(std::move(tokenValue));11086 | ^11087../tests/oidc-test.cc:1080:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11088 1080 | auto memberCount = [&] { return dispatcher.podConnected(workerId) ? size_t{1} : size_t{0}; };11089 | ^11090 | -> size_t11091../tests/oidc-test.cc:1092:86: error: 15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11092 1092 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11093 | ^11094../tests/oidc-test.cc:1094:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11095 1094 | soon["exp"] = now() + 2;11096 | ^~~~~~~11097../tests/oidc-test.cc:1109:86: error: 15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11098 1109 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11099 | ^11100../tests/oidc-test.cc:1111:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11101 1111 | soon["exp"] = now() + 2;11102 | ^~~~~~~11103../tests/oidc-test.cc:1116:71: error: 20 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11104 1116 | std::this_thread::sleep_for(std::chrono::milliseconds(20));11105 | ^11106../tests/oidc-test.cc:1128:86: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11107 1128 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11108 | ^11109../tests/oidc-test.cc:1132:90: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11110 1132 | dataCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11111 | ^11112../tests/oidc-test.cc:1147:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11113 1147 | auto client = dispatcher.connectClient([&](const nix::remote::SchedMsg &msg) {11114 | ^11115 | -> bool11116../tests/oidc-test.cc:1153:16: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11117 1153 | }, [] {});11118 | ^11119 | -> void11120../tests/oidc-test.cc:1165:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11121 1165 | auto const id = commands.msgs(0).expect().assign_id();11122 | ^11123../tests/oidc-test.cc:1177:17: error: variable 'routeReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11124 1177 | nix::remote::StoreInfoRequest routeReq;11125 | ^11126 | const 11127../tests/oidc-test.cc:1182:40: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11128 1182 | std::jthread responder([&] {11129 | ^11130 | -> void11131../tests/oidc-test.cc:1189:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11132 1189 | if (!selected) return;11133 | ^ 11134 | {11135../tests/oidc-test.cc:1194:55: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11136 1194 | if (requestFrame.half_close()) break;11137 | ^ 11138 | {11139../tests/oidc-test.cc:1208:55: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11140 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11141 | ^11142../tests/oidc-test.cc:1208:68: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11143 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11144 | ^11145../tests/oidc-test.cc:1208:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11146 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11147 | ^ 11148 | {11149../tests/oidc-test.cc:1208:135: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11150 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11151 | ^11152../tests/oidc-test.cc:1217:95: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11153 1217 | relayCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11154 | ^11155../tests/oidc-test.cc:1224:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11156 1224 | std::jthread buildResponder([&] {11157 | ^11158 | -> void11159../tests/oidc-test.cc:1226:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11160 1226 | if (!dataStream->Read(&frame)) return;11161 | ^ 11162 | {11163../tests/oidc-test.cc:1228:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11164 1228 | if (!selected) return;11165 | ^ 11166 | {11167../tests/oidc-test.cc:1234:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11168 1234 | if (frame.half_close()) break;11169 | ^ 11170 | {11171../tests/oidc-test.cc:1246:55: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11172 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11173 | ^11174../tests/oidc-test.cc:1246:68: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11175 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11176 | ^11177../tests/oidc-test.cc:1246:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11178 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11179 | ^ 11180 | {11181../tests/oidc-test.cc:1246:135: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11182 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11183 | ^11184../tests/oidc-test.cc:1257:95: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11185 1257 | buildCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11186 | ^11187../tests/oidc-test.cc:1275:101: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]11188 1275 | replacementCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11189 | ^11190../tests/oidc-test.cc:1297:13: error: variable 'cancelledReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11191 1297 | nix::remote::StoreInfoRequest cancelledReq;11192 | ^11193 | const 11194../tests/oidc-test.cc:1311:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11195 1311 | if (!status.ok()) std::cerr << "control Finish: " << status.error_message() << "\n";11196 | ^ 11197 | {11198>>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/main.cc11199../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]11200 12 | #include <chrono>11201 | 11202 13 | #include <chrono>11203 | ^~~~~~~~~~~~~~~~~11204../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]11205 90 | std::chrono::system_clock::time_point credentialExpiresAt{};11206 | ^~11207../src/daemon/main.cc:358:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11208 358 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) {11209 | ^11210 | -> bool11211../src/daemon/main.cc:371:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]11212 15 | const std::function<bool()> & cancelled,11213 | ^11214../src/daemon/main.cc:382:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11215 382 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status;11216 | ^ 11217 | {11218../src/daemon/main.cc:386:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11219 386 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"};11220 | ^ 11221 | {11222../src/daemon/main.cc:387:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11223 387 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"};11224 | ^ 11225 | {11226../src/daemon/main.cc:388:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11227 388 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"};11228 | ^ 11229 | {11230../src/daemon/main.cc:391:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11231 391 | nix::StorePath drvPath(request.drv_path());11232 | ^11233 | const 11234../src/daemon/main.cc:395:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11235 395 | auto const sendLog = [&](nixgrpc::BuildEvent event) {11236 | ^11237 | -> void11238../src/daemon/main.cc:396:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11239 396 | if (!emit(nixgrpc::toChunk<nix::remote::BuildDerivationChunk>(std::move(event))))11240 | ^11241 | {11242 397 | throw nixgrpc::CancelledWait("reverse build response closed");11243 | 11244../src/daemon/main.cc:405:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11245 405 | auto const retireUnacknowledged = [&] {11246 | ^11247 | -> void11248../src/daemon/main.cc:406:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11249 406 | if (afterFinish) std::exchange(afterFinish, nullptr)();11250 | ^ 11251 | {11252../src/daemon/main.cc:418:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11253 418 | if (status.ok() && !emit(chunk))11254 | ^11255 | {11256 419 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"};11257 | 11258../src/daemon/main.cc:420:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11259 420 | if (!status.ok()) retireUnacknowledged();11260 | ^ 11261 | {11262../src/daemon/main.cc:425:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11263 425 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call,11264 | ^11265../src/daemon/main.cc:428:24: note: nesting level increased to 111266 428 | return guarded([&] -> grpc::Status {11267 | ^11268../src/daemon/main.cc:429:13: note: +2, including nesting penalty of 1, nesting level increased to 211269 429 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11270 | ^11271../src/daemon/main.cc:429:32: note: +111272 429 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11273 | ^11274../src/daemon/main.cc:432:13: note: +2, including nesting penalty of 1, nesting level increased to 211275 432 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs",11276 | ^11277../src/daemon/main.cc:434:31: note: nesting level increased to 211278 434 | auto const live = [&] {11279 | ^11280../src/daemon/main.cc:436:21: note: +111281 436 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId);11282 | ^11283../src/daemon/main.cc:438:13: note: +2, including nesting penalty of 1, nesting level increased to 211284 438 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11285 | ^11286../src/daemon/main.cc:440:13: note: +2, including nesting penalty of 1, nesting level increased to 211287 440 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first)11288 | ^11289../src/daemon/main.cc:441:17: note: +111290 441 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11291 | ^11292../src/daemon/main.cc:442:48: note: +2, including nesting penalty of 1, nesting level increased to 211293 442 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair;11294 | ^11295../src/daemon/main.cc:443:55: note: +2, including nesting penalty of 1, nesting level increased to 211296 443 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs;11297 | ^11298../src/daemon/main.cc:462:17: note: nesting level increased to 211299 462 | CheckedSource(nix::Source & inner, std::function<bool()> valid)11300 | ^11301../src/daemon/main.cc:468:17: note: nesting level increased to 211302 468 | auto read(char * data, size_t length) -> size_t override {11303 | ^11304../src/daemon/main.cc:469:21: note: +3, including nesting penalty of 2, nesting level increased to 311305 469 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11306 | ^11307../src/daemon/main.cc:475:21: note: +3, including nesting penalty of 2, nesting level increased to 311308 475 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11309 | ^11310../src/daemon/main.cc:453:19: note: nesting level increased to 211311 453 | class CheckedSource : public nix::Source {11312 | ^11313../src/daemon/main.cc:453:19: note: nesting level increased to 211314../src/daemon/main.cc:453:19: note: nesting level increased to 211315../src/daemon/main.cc:453:19: note: nesting level increased to 211316../src/daemon/main.cc:453:19: note: nesting level increased to 211317../src/daemon/main.cc:487:68: note: +2, including nesting penalty of 1, nesting level increased to 211318 487 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair,11319 | ^11320../src/daemon/main.cc:488:68: note: +2, including nesting penalty of 1, nesting level increased to 211321 488 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs,11322 | ^11323../src/daemon/main.cc:489:17: note: nesting level increased to 211324 489 | [&] { return !live(); }, imported,11325 | ^11326../src/daemon/main.cc:490:17: note: nesting level increased to 211327 490 | [&] {11328 | ^11329../src/daemon/main.cc:497:21: note: +3, including nesting penalty of 2, nesting level increased to 311330 497 | if (!call.pipe->endWithoutTrailingData() || !live())11331 | ^11332../src/daemon/main.cc:497:62: note: +111333 497 | if (!call.pipe->endWithoutTrailingData() || !live())11334 | ^11335../src/daemon/main.cc:501:56: note: nesting level increased to 211336 501 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11337 | ^11338../src/daemon/main.cc:502:13: note: +2, including nesting penalty of 1, nesting level increased to 211339 502 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11340 | ^11341../src/daemon/main.cc:429:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11342 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11343 | ^11344../src/daemon/main.cc:430:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11345 430 | call.delegated.drvPath, call.delegated.assignId))11346 | ^11347 | {11348 431 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};11349 | 11350../src/daemon/main.cc:433:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11351 433 | nixgrpc::Role::write); !status.ok()) return status;11352 | ^ 11353 | {11354../src/daemon/main.cc:434:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11355 434 | auto const live = [&] {11356 | ^11357 | -> bool11358../src/daemon/main.cc:438:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11359 438 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11360 | ^ 11361 | {11362../src/daemon/main.cc:441:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11363 441 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11364 | ^ 11365 | {11366../src/daemon/main.cc:445:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11367 89 | nixgrpc::ZstdReaderSource<nixgrpc::ReverseUploadPipe, nix::remote::AddMultipleChunk> source(11368 | ^11369../src/daemon/main.cc:454:31: error: member 'inner' of type 'nix::Source &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11370 454 | nix::Source & inner;11371 | ^11372../src/daemon/main.cc:469:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11373 469 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11374 | ^ 11375 | {11376../src/daemon/main.cc:475:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11377 475 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11378 | ^ 11379 | {11380../src/daemon/main.cc:489:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11381 489 | [&] { return !live(); }, imported,11382 | ^11383 | -> bool11384../src/daemon/main.cc:490:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11385 490 | [&] {11386 | ^11387 | -> void11388../src/daemon/main.cc:497:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11389 497 | if (!call.pipe->endWithoutTrailingData() || !live())11390 | ^11391 | {11392 498 | throw nix::Error("reverse upload incomplete or assignment changed");11393 | 11394../src/daemon/main.cc:501:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11395 501 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11396 | ^11397 | -> bool11398../src/daemon/main.cc:502:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11399 502 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11400 | ^ 11401 | {11402../src/daemon/main.cc:645:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11403 645 | if (beforeApply) beforeApply();11404 | ^ 11405 | {11406../src/daemon/main.cc:654:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11407 654 | if (beforeApply) beforeApply();11408 | ^ 11409 | {11410../src/daemon/main.cc:656:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11411 656 | if (beforeApply) beforeApply();11412 | ^ 11413 | {11414../src/daemon/main.cc:720:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11415 720 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder)11416 | ^11417 | {11418 721 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"};11419 | 11420../src/daemon/main.cc:723:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11421 723 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"};11422 | ^ 11423 | {11424../src/daemon/main.cc:726:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors]11425 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk()11426 | ^11427../src/daemon/main.cc:727:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11428 727 | || drv.empty() || assignment == 0)11429 | ^11430 | {11431 728 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"};11432 | 11433../src/daemon/main.cc:730:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11434 730 | if (caller.kind != nixgrpc::Caller::Kind::named)11435 | ^11436 | {11437 731 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"};11438 | 11439../src/daemon/main.cc:733:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11440 733 | !status.ok()) return status;11441 | ^ 11442 | {11443../src/daemon/main.cc:735:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11444 735 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"};11445 | ^ 11446 | {11447../src/daemon/main.cc:736:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11448 736 | auto const assigned = [this, pod = *pod, drv, assignment] {11449 | ^11450 | -> bool11451../src/daemon/main.cc:740:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11452 740 | [&](uint64_t id) {11453 | ^11454 | -> Result11455../src/daemon/main.cc:740:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11456 740 | [&](uint64_t id) {11457 | ^11458../src/daemon/main.cc:742:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11459 742 | [this](std::string_view path, uint64_t assignId) {11460 | ^11461 | -> std::optional<std::string>11462../src/daemon/main.cc:745:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11463 745 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); },11464 | ^11465 | -> bool11466../src/daemon/main.cc:1016:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11467 1016 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"};11468 | ^ 11469 | {11470../src/daemon/main.cc:1114:37: error: implicit conversion 'std::string *' (aka 'basic_string<char> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11471 1114 | if (!missing.empty() && missingInput) {11472 | ^ 11473 | ( != nullptr)11474../src/daemon/main.cc:1174:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11475 1174 | auto BuildDerivation(11476 | ^11477../src/daemon/main.cc:1179:24: note: nesting level increased to 111478 1179 | return guarded([&] -> grpc::Status {11479 | ^11480../src/daemon/main.cc:1183:13: note: +2, including nesting penalty of 1, nesting level increased to 211481 1183 | if (request->protocol() != nixcompat::kBuildProtocolWire11482 | ^11483../src/daemon/main.cc:1184:17: note: +111484 1184 | || request->build_mode() > static_cast<uint32_t>(nix::bmCheck)) {11485 | ^11486../src/daemon/main.cc:1191:17: note: +2, including nesting penalty of 1, nesting level increased to 211487 1191 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt;11488 | ^11489../src/daemon/main.cc:1190:51: note: +111490 1190 | auto const selectedPod = reverseRelay && coord.dispatcher11491 | ^11492../src/daemon/main.cc:1192:13: note: +2, including nesting penalty of 1, nesting level increased to 211493 1192 | if (selectedPod) {11494 | ^11495../src/daemon/main.cc:1195:21: note: nesting level increased to 311496 1195 | [&](uint64_t id) {11497 | ^11498../src/daemon/main.cc:1197:29: note: nesting level increased to 411499 1197 | [this](std::string_view drv, uint64_t assignment) {11500 | ^11501../src/daemon/main.cc:1200:34: note: nesting level increased to 311502 1200 | }, *request, [&](std::string_view wire) {11503 | ^11504../src/daemon/main.cc:1202:25: note: +4, including nesting penalty of 3, nesting level increased to 411505 1202 | if (!chunk.ParseFromArray(wire.data(), static_cast<int>(wire.size()))11506 | ^11507../src/daemon/main.cc:1203:103: note: +111508 1203 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11509 | ^11510../src/daemon/main.cc:1205:25: note: +4, including nesting penalty of 3, nesting level increased to 411511 1205 | if (!writer->Write(chunk)) return false;11512 | ^11513../src/daemon/main.cc:1206:25: note: +4, including nesting penalty of 3, nesting level increased to 411514 1206 | if (chunk.has_done()) receivedDone = true;11515 | ^11516../src/daemon/main.cc:1208:24: note: nesting level increased to 311517 1208 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11518 | ^11519../src/daemon/main.cc:1211:24: note: nesting level increased to 311520 1211 | }, [&] { return receivedDone.load(); });11521 | ^11522../src/daemon/main.cc:1213:21: note: +3, including nesting penalty of 2, nesting level increased to 311523 1213 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status;11524 | ^11525../src/daemon/main.cc:1212:36: note: +111526 1212 | return status.ok() && !receivedDone.load()11527 | ^11528../src/daemon/main.cc:1219:13: note: +2, including nesting penalty of 1, nesting level increased to 211529 1219 | if (!coord.builder) {11530 | ^11531../src/daemon/main.cc:1224:38: note: nesting level increased to 211532 1224 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void {11533 | ^11534../src/daemon/main.cc:1238:13: note: +2, including nesting penalty of 1, nesting level increased to 211535 1238 | for (auto & [name, path] : staticOutputs(*localStore, drv)) {11536 | ^11537../src/daemon/main.cc:1246:13: note: +2, including nesting penalty of 1, nesting level increased to 211538 1246 | if (auto const status =11539 | ^11540../src/daemon/main.cc:1247:27: note: nesting level increased to 211541 1247 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11542 | ^11543../src/daemon/main.cc:1252:17: note: +3, including nesting penalty of 2, nesting level increased to 311544 1252 | if (!missingInput.empty()) {11545 | ^11546../src/daemon/main.cc:1195:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11547 1195 | [&](uint64_t id) {11548 | ^11549 | -> Result11550../src/daemon/main.cc:1195:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11551 1195 | [&](uint64_t id) {11552 | ^11553../src/daemon/main.cc:1197:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11554 1197 | [this](std::string_view drv, uint64_t assignment) {11555 | ^11556 | -> std::optional<std::string>11557../src/daemon/main.cc:1200:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11558 1200 | }, *request, [&](std::string_view wire) {11559 | ^11560 | -> bool11561../src/daemon/main.cc:1203:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11562 1203 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11563 | ^11564 | {11565 1204 | return false;11566 | 11567../src/daemon/main.cc:1205:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11568 1205 | if (!writer->Write(chunk)) return false;11569 | ^ 11570 | {11571../src/daemon/main.cc:1206:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11572 1206 | if (chunk.has_done()) receivedDone = true;11573 | ^ 11574 | {11575../src/daemon/main.cc:1208:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11576 1208 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11577 | ^11578 1209 | pod = *selectedPod] {11579 | -> bool11580../src/daemon/main.cc:1211:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11581 1211 | }, [&] { return receivedDone.load(); });11582 | ^11583 | -> bool11584../src/daemon/main.cc:1247:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11585 1247 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11586 | ^11587 | -> bool11588../src/daemon/main.cc:1507:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11589 1507 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) {11590 | ^11591 | -> auto11592../src/daemon/main.cc:1510:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11593 1510 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) {11594 | ^11595 | -> auto11596../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11597 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result11598 | ^11599../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 111600 522 | if (!parsed) {11601 | ^11602../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 111603 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : "";11604 | ^11605../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 111606 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) {11607 | ^11608../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 211609 528 | if (provider.issuer != iss) {11610 | ^11611../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 211612 531 | if (!parsed->has_expires_at()) {11613 | ^11614../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 211615 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) {11616 | ^11617../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 311618 538 | if (!err) {11619 | ^11620../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 211621 542 | if (err) {11622 | ^11623../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 211624 547 | if (sub.empty() || sub.contains('\0')) {11625 | ^11626../src/daemon/oidc.hh:547:29: note: +111627 547 | if (sub.empty() || sub.contains('\0')) {11628 | ^11629../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 211630 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace");11631 | ^11632../src/daemon/oidc.hh:553:32: note: +111633 553 | namespaceClaim && namespaceClaim->is_string()) {11634 | ^11635../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 211636 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11637 | ^11638../src/daemon/oidc.hh:556:82: note: +111639 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11640 | ^11641../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 311642 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11643 | ^11644../src/daemon/oidc.hh:557:67: note: +111645 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11646 | ^11647../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 311648 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11649 | ^11650../src/daemon/oidc.hh:560:66: note: +111651 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11652 | ^11653../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 211654 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11655 | ^11656../src/daemon/oidc.hh:564:91: note: +111657 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11658 | ^11659../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 311660 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11661 | ^11662../src/daemon/oidc.hh:565:65: note: +111663 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11664 | ^11665../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 211666 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) {11667 | ^11668../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 311669 570 | if (aud->is_string()) {11670 | ^11671../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 311672 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11673 | ^11674../src/daemon/oidc.hh:572:64: note: +111675 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11676 | ^11677../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 211678 577 | if (parsed->has_issued_at()) {11679 | ^11680../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 211681 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"};11682 | ^11683../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11684 553 | namespaceClaim && namespaceClaim->is_string()) {11685 | ^11686 | ( != nullptr)11687../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11688 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11689 | ^11690 | ( != nullptr)11691../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11692 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11693 | ^11694../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11695 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11696 | ^11697../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11698 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11699 | ^11700../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11701 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11702 | ^11703 | ( != nullptr)11704../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11705 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11706 | ^11707../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]11708 45 | std::chrono::seconds reverseMaxTokenLifetime{600};11709 | ^11710../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11711 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)11712 | ^11713../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]11714 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||11715 | ^11716../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]11717 96 | result.push_back(static_cast<char>(size >> (i * 8)));11718 | ^11719../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]11720 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11721 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11722../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'11723 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11724 | ^~~~~11725../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'11726 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11727 | ^~~~~~~~11728../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]11729 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11730 | ^~~11731../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]11732 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11733 | ^11734../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11735 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)11736 | ^11737../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11738 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)11739 | ^11740../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]11741 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||11742 | ^11743../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11744 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;11745 | ^ 11746 | {11747../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]11748 250 | unsigned char mac[EVP_MAX_MD_SIZE];11749 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11750../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11751 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),11752 | ~^11753 | (11754 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11755 | == nullptr)11756../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11757 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11758 | ^11759../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]11760 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11761 | ^11762../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11763 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);11764 | ^11765../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]11766 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11767 | ^11768../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning11769 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11770 | ^~~~~~~~~11771 | static_cast<const size_t>( )11772../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type11773 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11774 | ^~11775 | static_cast<long>( )11776../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]11777 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11778 | ^11779../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning11780 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11781 | ^~~~~~~~~~~~~~~11782 | static_cast<const size_t>( )11783../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type11784 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11785 | ^~~~~~~~11786 | static_cast<long>( )11787../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]11788 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool11789 | ^11790../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]11791 53 | auto data(uint64_t id, std::string_view bytes) -> bool11792 | ^11793../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]11794 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);11795 | ^11796../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]11797 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11798 | ^11799../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]11800 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11801 | ^11802 | const &11803../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11804 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;11805 | ^ 11806 | {11807../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11808 81 | if (size > limit) return false;11809 | ^ 11810 | {11811../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11812 83 | cv.wait(lock, stop, [&] {11813 | ^11814 | -> bool11815../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]11816 84 | auto it = streams.find(id);11817 | ^11818../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]11819 87 | auto const it = streams.find(id);11820 | ^11821../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11822 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;11823 | ^ 11824 | {11825../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]11826 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }11827 | ^11828../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]11829 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }11830 | ^11831../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]11832 96 | auto acknowledge(uint64_t id) -> bool11833 | ^11834../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11835 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;11836 | ^ 11837 | {11838../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11839 105 | if (!enqueue(std::move(msg))) return false;11840 | ^ 11841 | {11842../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]11843 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool11844 | ^11845 | const &11846../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11847 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });11848 | ^11849 | -> bool11850../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]11851 145 | auto finished(uint64_t id) -> bool11852 | ^11853../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11854 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;11855 | ^ 11856 | {11857../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11858 150 | if (removed) cv.notify_all();11859 | ^ 11860 | {11861../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]11862 156 | void acknowledgementSent(uint64_t id)11863 | ^11864../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11865 159 | if (acknowledged.erase(id)) streams.erase(id);11866 | ^ 11867 | != 0u11868../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11869 159 | if (acknowledged.erase(id)) streams.erase(id);11870 | ^ 11871 | {11872../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]11873 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {11874 | ^11875../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]11876 208 | auto terminal(uint64_t id, bool abort) -> bool11877 | ^11878../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11879 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11880 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11881 | .status= .prepared=11882../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11883 41 | struct Result11884 | ^11885../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]11886 65 | Role minRole;11887 | ^11888../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11889 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};11890 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11891 | .status= .prepared=11892../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11893 41 | struct Result11894 | ^11895../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11896 85 | return {status, {}};11897 | ^~~~~~~~~~~~11898 | .status=.prepared=11899../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11900 41 | struct Result11901 | ^11902../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11903 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};11904 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11905 | .status= .prepared=11906../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11907 41 | struct Result11908 | ^11909../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11910 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11911 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11912 | .status= .prepared=11913../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11914 41 | struct Result11915 | ^11916../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11917 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};11918 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11919 | .status= .prepared=11920../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11921 41 | struct Result11922 | ^11923../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11924 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};11925 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11926 | .status= .prepared=11927../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11928 41 | struct Result11929 | ^11930../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11931 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};11932 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11933 | .status= .prepared=11934../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11935 41 | struct Result11936 | ^11937../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11938 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};11939 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11940 | .status= .prepared=11941../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11942 41 | struct Result11943 | ^11944../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11945 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11946 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11947 | .status= .prepared=11948 123 | std::string(drvPath), assignId}};11949 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11950../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11951 41 | struct Result11952 | ^11953../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]11954 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11955 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11956 | .session= .open=11957 123 | std::string(drvPath), assignId}};11958 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11959 | .drvPath= .assignId=11960../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here11961 33 | struct Prepared11962 | ^11963../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11964 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11965 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11966 | .status= .prepared=11967../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11968 41 | struct Result11969 | ^11970../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11971 189 | return {status, {}};11972 | ^~~~~~~~~~~~11973 | .status=.prepared=11974../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11975 41 | struct Result11976 | ^11977../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11978 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11979 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11980 | .status= .prepared=11981../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11982 41 | struct Result11983 | ^11984../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11985 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};11986 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11987 | .status= .prepared=11988../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11989 41 | struct Result11990 | ^11991../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11992 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};11993 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11994 | .status= .prepared=11995../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11996 41 | struct Result11997 | ^11998../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11999 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12000 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12001 | .status= .prepared=12002../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12003 41 | struct Result12004 | ^12005../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12006 218 | return {status, {}};12007 | ^~~~~~~~~~~~12008 | .status=.prepared=12009../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12010 41 | struct Result12011 | ^12012../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12013 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};12014 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12015 | .status= .prepared=12016../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12017 41 | struct Result12018 | ^12019../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12020 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};12021 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12022 | .status= .prepared=12023../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12024 41 | struct Result12025 | ^12026../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]12027 233 | Auth &auth;12028 | ^12029../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]12030 234 | ReverseRegistry &registry;12031 | ^12032../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12033 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional<Event>12034 | ^12035../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 112036 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12037 | ^12038../src/daemon/reverse-inbound.hh:45:79: note: +112039 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12040 | ^12041../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 212042 47 | rejection = closed ? "session closed" : "bad frame header";12043 | ^12044../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 112045 51 | if (frame.has_open())12046 | ^12047../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 212048 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12049 | ^12050../src/daemon/reverse-inbound.hh:53:30: note: +112051 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12052 | ^12053../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 312054 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams";12055 | ^12056../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212057 59 | if (!caller)12058 | ^12059../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 112060 69 | if (it == streams.end())12061 | ^12062../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212063 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()12064 | ^12065../src/daemon/reverse-inbound.hh:74:17: note: +112066 74 | && finishedIds.erase(id))12067 | ^12068../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112069 79 | if (frame.has_data())12070 | ^12071../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212072 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12073 | ^12074../src/daemon/reverse-inbound.hh:81:59: note: +112075 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12076 | ^12077../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 112078 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12079 | ^12080../src/daemon/reverse-inbound.hh:88:97: note: +112081 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12082 | ^12083../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112084 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12085 | ^12086../src/daemon/reverse-inbound.hh:93:72: note: +112087 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12088 | ^12089../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 212090 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; }12091 | ^12092../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]12093 50 | auto const id = frame.stream_id();12094 | ^12095../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]12096 68 | auto it = streams.find(id);12097 | ^12098../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12099 74 | && finishedIds.erase(id))12100 | ^ 12101 | ( != 0u)12102../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12103 74 | && finishedIds.erase(id))12104 | ^12105 | {12106 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};12107 | 12108../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]12109 109 | auto finished(uint64_t id) -> bool12110 | ^12111../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12112 111 | if (cancelledIds.erase(id)) return true;12113 | ^ 12114 | != 0u12115../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12116 111 | if (cancelledIds.erase(id)) return true;12117 | ^ 12118 | {12119../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12120 112 | if (!streams.erase(id)) return false;12121 | ~^ 12122 | == 0u12123../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12124 112 | if (!streams.erase(id)) return false;12125 | ^ 12126 | {12127../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]12128 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {12129 | ^12130../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]12131 82 | auto it = sessions.find(std::string(workerId));12132 | ^12133../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]12134 92 | auto it = sessions.find(handle->workerId);12135 | ^12136../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]12137 107 | auto it = sessions.find(handle->workerId);12138 | ^12139../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]12140 130 | for (auto & [id, session] : sessions) {12141 | ^12142../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12143 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select,12144 | ^12145../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 112146 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12147 | ^12148../src/daemon/reverse-relay.hh:49:21: note: +112149 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12150 | ^12151../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 112152 56 | if (!selection.status.ok()) return selection.status;12153 | ^12154../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 112155 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12156 | ^12157../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 112158 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12159 | ^12160../src/daemon/reverse-relay.hh:59:22: note: +112161 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12162 | ^12163../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 112164 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12165 | ^12166../src/daemon/reverse-relay.hh:60:27: note: +112167 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12168 | ^12169../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 112170 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12171 | ^12172../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 112173 64 | if (!selection.status.ok()) return selection.status;12174 | ^12175../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 112176 65 | if (!selection.prepared || selection.prepared->session != session)12177 | ^12178../src/daemon/reverse-relay.hh:65:33: note: +112179 65 | if (!selection.prepared || selection.prepared->session != session)12180 | ^12181../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 112182 67 | if (request.ByteSizeLong() > maxRequestBytes)12183 | ^12184../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 112185 70 | if (bytes.size() > maxRequestBytes)12186 | ^12187../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 112188 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12189 | ^12190../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112191 75 | if (!status.ok()) return status;12192 | ^12193../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 112194 81 | ~Release() {12195 | ^12196../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 212197 84 | if (!completed) (void) transport.outgoing.cancel(id);12198 | ^12199../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 112200 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12201 | ^12202../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 112203 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) {12204 | ^12205../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 212206 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12207 | ^12208../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 212209 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12210 | ^12211../src/daemon/reverse-relay.hh:100:44: note: +112212 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12213 | ^12214../src/daemon/reverse-relay.hh:100:62: note: +112215 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12216 | ^12217../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 212218 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12219 | ^12220../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112221 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12222 | ^12223../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 112224 111 | std::jthread monitor([&](std::stop_token stop) {12225 | ^12226../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 212227 113 | while (!stop.stop_requested()) {12228 | ^12229../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 312230 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)12231 | ^12232../src/daemon/reverse-relay.hh:115:22: note: +112233 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12234 | ^12235../src/daemon/reverse-relay.hh:115:60: note: +112236 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12237 | ^12238../src/daemon/reverse-relay.hh:115:80: note: +112239 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12240 | ^12241../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 312242 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12243 | ^12244../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 112245 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) {12246 | ^12247../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 212248 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12249 | ^12250../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 212251 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12252 | ^12253../src/daemon/reverse-relay.hh:127:44: note: +112254 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12255 | ^12256../src/daemon/reverse-relay.hh:127:82: note: +112257 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12258 | ^12259../src/daemon/reverse-relay.hh:127:102: note: +112260 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12261 | ^12262../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 312263 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12264 | ^12265../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 212266 130 | if (frame.has_finish()) {12267 | ^12268../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 312269 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12270 | ^12271../src/daemon/reverse-relay.hh:131:55: note: +112272 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12273 | ^12274../src/daemon/reverse-relay.hh:131:75: note: +112275 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12276 | ^12277../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 312278 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12279 | ^12280../src/daemon/reverse-relay.hh:133:38: note: +112281 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12282 | ^12283../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 312284 134 | if (resultReceived && resultReceived()) {12285 | ^12286../src/daemon/reverse-relay.hh:134:36: note: +112287 134 | if (resultReceived && resultReceived()) {12288 | ^12289../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 412290 135 | if (beforeAck) beforeAck();12291 | ^12292../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 412293 136 | if (!transport.outgoing.acknowledge(id))12294 | ^12295../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 212296 143 | while (true) {12297 | ^12298../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 312299 144 | if (!expected) {12300 | ^12301../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 412302 145 | if (pending.size() < 4) break;12303 | ^12304../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 412305 147 | for (unsigned i = 0; i != 4; ++i)12306 | ^12307../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 412308 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12309 | ^12310../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 312311 153 | if (pending.size() < *expected) break;12312 | ^12313../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 312314 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12315 | ^12316../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 212317 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12318 | ^12319../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 112320 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12321 | ^12322../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 112323 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12324 | ^12325../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 112326 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12327 | ^12328../src/daemon/reverse-relay.hh:163:47: note: +112329 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12330 | ^12331../src/daemon/reverse-relay.hh:163:67: note: +112332 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12333 | ^12334../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12335 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12336 | ^ 12337 | {12338../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12339 56 | if (!selection.status.ok()) return selection.status;12340 | ^ 12341 | {12342../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12343 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12344 | ^ 12345 | {12346../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12347 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12348 | ^ 12349 | {12350../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12351 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12352 | ^ 12353 | {12354../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]12355 61 | auto const id = session->transport->nextStreamId.fetch_add(1);12356 | ^12357../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12358 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12359 | ^ 12360 | {12361../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12362 64 | if (!selection.status.ok()) return selection.status;12363 | ^ 12364 | {12365../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12366 65 | if (!selection.prepared || selection.prepared->session != session)12367 | ^12368 | {12369 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};12370 | 12371../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12372 67 | if (request.ByteSizeLong() > maxRequestBytes)12373 | ^12374 | {12375 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12376 | 12377../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12378 70 | if (bytes.size() > maxRequestBytes)12379 | ^12380 | {12381 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12382 | 12383../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12384 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12385 | ^ 12386 | {12387../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12388 75 | if (!status.ok()) return status;12389 | ^ 12390 | {12391../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]12392 77 | struct Release {12393 | ^12394../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]12395 77 | struct Release {12396 | ^12397 78 | ReverseTransport & transport;12398 79 | uint64_t id;12399 | 12400 | {}12401../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]12402 78 | ReverseTransport & transport;12403 | ^12404../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12405 84 | if (!completed) (void) transport.outgoing.cancel(id);12406 | ^ 12407 | {12408../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12409 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12410 | ^ 12411 | {12412../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]12413 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12414 | ^12415../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]12416 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12417 | ^12418../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12419 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12420 | ^ 12421 | {12422../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12423 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12424 | ^12425 | {12426 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};12427 | 12428../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12429 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12430 | ^12431 | {12432 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};12433 | 12434../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12435 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12436 | ^ 12437 | {12438../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12439 111 | std::jthread monitor([&](std::stop_token stop) {12440 | ^12441 | const 12442../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12443 111 | std::jthread monitor([&](std::stop_token stop) {12444 | ^12445 | -> auto12446../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]12447 111 | std::jthread monitor([&](std::stop_token stop) {12448 | ^12449 | const &12450../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]12451 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12452 | ^12453../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12454 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12455 | ^12456 | -> auto12457../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12458 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12459 | ^ 12460 | {12461../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12462 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12463 | ^12464 | {12465 128 | return {grpc::StatusCode::UNAVAILABLE,12466 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12467 | 12468../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12469 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12470 | ^12471 | {12472 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12473 | 12474../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12475 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12476 | ^ 12477 | {12478../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12479 135 | if (beforeAck) beforeAck();12480 | ^ 12481 | {12482../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12483 136 | if (!transport.outgoing.acknowledge(id))12484 | ^12485 | {12486 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};12487 | 12488../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12489 145 | if (pending.size() < 4) break;12490 | ^ 12491 | {12492../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12493 147 | for (unsigned i = 0; i != 4; ++i)12494 | ^12495 | {12496 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12497 | 12498../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]12499 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12500 | ^~~12501../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]12502 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12503 | ^12504../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12505 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12506 | ^ 12507 | {12508../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12509 153 | if (pending.size() < *expected) break;12510 | ^ 12511 | {12512../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12513 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12514 | ^12515 | {12516 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};12517 | 12518../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12519 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12520 | ^ 12521 | {12522../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12523 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12524 | ^ 12525 | {12526../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12527 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12528 | ^ 12529 | {12530../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12531 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12532 | ^12533 | {12534 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12535 | 12536../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]12537 169 | ReverseGateway & gateway;12538 | ^12539../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]12540 170 | ReverseRegistry & registry;12541 | ^12542../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12543 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool12544 | ^12545../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 112546 52 | if (!event) { rejection = inbound.lastRejection(); return false; }12547 | ^12548../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 112549 54 | switch (event->kind) {12550 | ^12551../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 212552 56 | if (!event->caller) { rejection = "open without caller"; return false; }12553 | ^12554../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212555 59 | if (frame.open().method() == "UploadBuildInputs") {12556 | ^12557../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 312558 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12559 | ^12560../src/daemon/reverse-request.hh:61:30: note: +112561 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12562 | ^12563../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 312564 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12565 | ^12566../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212567 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }12568 | ^12569../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 212570 77 | if (auto it = uploads.find(id); it != uploads.end())12571 | ^12572../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212573 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 412574 | ^12575../src/daemon/reverse-request.hh:82:17: note: +112576 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }12577 | ^12578../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 212579 84 | if (!pending.length && pending.wire.size() >= 4) {12580 | ^12581../src/daemon/reverse-request.hh:84:33: note: +112582 84 | if (!pending.length && pending.wire.size() >= 4) {12583 | ^12584../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 312585 86 | for (unsigned i = 0; i != 4; ++i)12586 | ^12587../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 312588 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }12589 | ^12590../src/daemon/reverse-request.hh:91:36: note: +112591 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;12592 | ^12593../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 212594 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12595 | ^12596../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 212597 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12598 | ^12599../src/daemon/reverse-request.hh:96:60: note: +112600 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12601 | ^12602../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 212603 108 | if (auto it = uploads.find(id); it != uploads.end()) {12604 | ^12605../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 212606 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12607 | ^12608../src/daemon/reverse-request.hh:112:29: note: +112609 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12610 | ^12611../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 212612 114 | if (ready && ready->id == id) ready.reset();12613 | ^12614../src/daemon/reverse-request.hh:114:23: note: +112615 114 | if (ready && ready->id == id) ready.reset();12616 | ^12617../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]12618 48 | std::scoped_lock lock(mutex);12619 | ^12620 | const 12621../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]12622 53 | auto const id = event->streamId;12623 | ^12624../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12625 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12626 | ^12627 | -> bool12628../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]12629 77 | if (auto it = uploads.find(id); it != uploads.end())12630 | ^12631../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12632 77 | if (auto it = uploads.find(id); it != uploads.end())12633 | ^12634 | {12635 78 | return it->second->feed(frame.data().data());12636 | 12637../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12638 86 | for (unsigned i = 0; i != 4; ++i)12639 | ^12640 | {12641 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12642 | 12643../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]12644 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12645 | ^~~12646../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]12647 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12648 | ^12649../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]12650 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12651 | ^12652../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12653 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12654 | ^ 12655 | {12656../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]12657 95 | auto it = requests.find(id);12658 | ^12659../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]12660 108 | if (auto it = uploads.find(id); it != uploads.end()) {12661 | ^12662../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12663 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12664 | ^ 12665 | {12666../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12667 114 | if (ready && ready->id == id) ready.reset();12668 | ^ 12669 | {12670../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]12671 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }12672 | ^12673 | const 12674../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]12675 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }12676 | ^12677 | const 12678../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]12679 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }12680 | ^12681 | const 12682../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]12683 130 | std::scoped_lock lock(mutex);12684 | ^12685 | const 12686../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]12687 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12688 | ^12689../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12690 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12691 | ^ 12692 | {12693../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]12694 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {12695 | ^12696../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]12697 142 | std::scoped_lock lock(mutex);12698 | ^12699 | const 12700../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]12701 148 | std::scoped_lock lock(mutex);12702 | ^12703 | const 12704../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]12705 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12706 | ^12707../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12708 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12709 | ^ 12710 | {12711../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]12712 32 | [[nodiscard]] auto open(uint64_t id) -> bool12713 | ^12714../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]12715 51 | auto it = streams.find(frame.stream_id());12716 | ^12717../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12718 56 | if (!cancelled.contains(frame.stream_id())) return false;12719 | ^ 12720 | {12721../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12722 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;12723 | ^ 12724 | {12725../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]12726 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12727 | ^12728../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]12729 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12730 | ^12731 | const &12732../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12733 104 | auto pending = [&] {12734 | ^12735 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>12736../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]12737 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12738 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~12739 | std::ranges::find_if queue12740../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12741 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12742 | ^12743 | -> auto12744../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12745 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });12746 | ^12747 | -> bool12748../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]12749 111 | auto it = pending();12750 | ^12751../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]12752 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool12753 | ^12754../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12755 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);12756 | ^ 12757 | {12758../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]12759 168 | [[nodiscard]] auto finished(uint64_t id) -> bool12760 | ^12761../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]12762 171 | auto it = streams.find(id);12763 | ^12764../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12765 42 | if (context) {12766 | ^ 12767 | != nullptr12768../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]12769 54 | WorkerIdentity & identity;12770 | ^12771../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]12772 55 | ReverseRegistry & registry;12773 | ^12774../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]12775 56 | Auth & workerAuth;12776 | ^12777../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12778 66 | auto Register(12779 | ^12780../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112781 75 | if (!auth) {12782 | ^12783../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112784 79 | if (transports.size() != 1 ||12785 | ^12786../src/daemon/reverse-session.hh:79:36: note: +112787 79 | if (transports.size() != 1 ||12788 | ^12789../src/daemon/reverse-session.hh:80:94: note: +112790 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" &&12791 | ^12792../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 112793 90 | if (caller.kind != Caller::Kind::named) {12794 | ^12795../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112796 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) {12797 | ^12798../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 112799 100 | if (first == last || std::next(first) != last) {12800 | ^12801../src/daemon/reverse-session.hh:100:27: note: +112802 100 | if (first == last || std::next(first) != last) {12803 | ^12804../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112805 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12806 | ^12807../src/daemon/reverse-session.hh:105:40: note: +112808 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12809 | ^12810../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 112811 111 | if (!stream->Read(&msg)) {12812 | ^12813../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 112814 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET12815 | ^12816../src/daemon/reverse-session.hh:115:13: note: +112817 115 | || !msg.credential().empty()) {12818 | ^12819../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 112820 118 | if (msg.protocol() != reverseProtocolVersion) {12821 | ^12822../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 112823 122 | if (!bound) {12824 | ^12825../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 112826 128 | if (!sessionKey) {12827 | ^12828../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 112829 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12830 | ^12831../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 112832 136 | if (!handle) {12833 | ^12834../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 112835 144 | ~Cleanup()12836 | ^12837../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112838 139 | struct Cleanup12839 | ^12840../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112841../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 112842 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12843 | ^12844../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 212845 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12846 | ^12847../src/daemon/reverse-session.hh:160:43: note: +112848 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12849 | ^12850../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 312851 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12852 | ^12853../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 212854 163 | if (!stop.stop_requested()) {12855 | ^12856../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 112857 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12858 | ^12859../src/daemon/reverse-session.hh:171:40: note: +112860 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12861 | ^12862../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 112863 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12864 | ^12865../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 212866 179 | while (transport->outgoing.waitTake(frame, stop)) {12867 | ^12868../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 312869 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12870 | ^12871../src/daemon/reverse-session.hh:180:48: note: +112872 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12873 | ^12874../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 312875 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12876 | ^12877../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 112878 187 | while (stream->Read(&msg)) {12879 | ^12880../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 212881 188 | if (!msg.credential().empty()) {12882 | ^12883../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 312884 191 | ? identity.renew(msg.credential(), bound->workerId)12885 | ^12886../src/daemon/reverse-session.hh:190:52: note: +112887 190 | && msg.worker_id().empty() && registry.current(*handle)12888 | ^12889../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 312890 193 | if (!renewed) {12891 | ^12892../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 212893 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12894 | ^12895../src/daemon/reverse-session.hh:205:44: note: +112896 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12897 | ^12898../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]12899 104 | std::string_view value(first->second.data(), first->second.size());12900 | ^12901 | const 12902../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12903 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12904 | ^12905 | -> void12906../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12907 139 | struct Cleanup12908 | ^12909../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]12910 139 | struct Cleanup12911 | ^12912../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]12913 141 | ReverseRegistry & registry;12914 | ^12915../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]12916 149 | } cleanup{registry, *handle, cancellation};12917 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12918 | .registry=.handle= .cancellation=12919../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here12920 139 | struct Cleanup12921 | ^12922../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]12923 156 | std::condition_variable_any cv;12924 | ^12925../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12926 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12927 | ^12928 | const 12929../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12930 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12931 | ^12932 | -> void12933../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]12934 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12935 | ^12936 | const &12937../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12938 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12939 | ^12940 | -> bool12941../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12942 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12943 | ^12944 | const 12945../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12946 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12947 | ^12948 | -> void12949../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]12950 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12951 | ^12952 | const &12953../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12954 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12955 | ^ 12956 | {12957../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]12958 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12959 | ^12960../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]12961 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12962 | ^12963 | -> bool12964../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]12965 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12966 | ^12967../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12968 33 | if (assigned && !assigned()) return false;12969 | ^ 12970 | {12971../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]12972 35 | std::scoped_lock lock(mutex);12973 | ^12974 | const 12975../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12976 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;12977 | ^ 12978 | {12979../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12980 42 | if (!ok) cancel();12981 | ^ 12982 | {12983../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]12984 49 | std::scoped_lock lock(mutex);12985 | ^12986 | const 12987../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12988 68 | if (closed) return false;12989 | ^ 12990 | {12991../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12992 79 | if (ended || !chunks.empty()) break;12993 | ^ 12994 | {12995../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]12996 80 | cv.wait_for(lock, std::chrono::milliseconds(25));12997 | ^12998../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12999 82 | if (chunks.empty()) return false;13000 | ^ 13001 | {13002../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]13003 92 | std::scoped_lock lock(mutex);13004 | ^13005 | const 13006../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]13007 103 | cv.wait_for(lock, std::chrono::milliseconds(25));13008 | ^13009../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13010 113 | if (!ended || closed || !chunks.empty()) return false;13011 | ^ 13012 | {13013../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]13014 120 | std::scoped_lock lock(mutex);13015 | ^13016 | const 13017../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]13018 129 | std::scoped_lock lock(mutex);13019 | ^13020 | const 13021../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]13022 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned,13023 | ^13024../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 113025 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes13026 | ^13027../src/daemon/reverse-upload-relay.hh:37:63: note: +113028 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13029 | ^13030../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 113031 40 | if (!selection.status.ok()) return selection.status;13032 | ^13033../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 113034 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13035 | ^13036../src/daemon/reverse-upload-relay.hh:41:65: note: +113037 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13038 | ^13039../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 113040 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13041 | ^13042../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 113043 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13044 | ^13045../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 113046 48 | if (!selection.status.ok()) return selection.status;13047 | ^13048../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 113049 49 | if (!selection.prepared || selection.prepared->session != session)13050 | ^13051../src/daemon/reverse-upload-relay.hh:49:33: note: +113052 49 | if (!selection.prepared || selection.prepared->session != session)13053 | ^13054../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 113055 53 | if (!delegated || !ReverseUpload::first(*delegated, first)13056 | ^13057../src/daemon/reverse-upload-relay.hh:55:13: note: +113058 55 | || selection.prepared->assignId != first.assign_id())13059 | ^13060../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 113061 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13062 | ^13063../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 113064 60 | if (!status.ok()) return status;13065 | ^13066../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 113067 65 | ~Release() {13068 | ^13069../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 213070 66 | if (!completed) (void) transport.outgoing.cancel(id);13071 | ^13072../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 113073 76 | std::jthread monitor([&](std::stop_token stop) {13074 | ^13075../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 213076 78 | while (!stop.stop_requested()) {13077 | ^13078../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 313079 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)13080 | ^13081../src/daemon/reverse-upload-relay.hh:80:21: note: +113082 80 | || !assigned()) {13083 | ^13084../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 313085 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13086 | ^13087../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 113088 90 | auto const live = [&] {13089 | ^13090../src/daemon/reverse-upload-relay.hh:91:98: note: +113091 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned();13092 | ^13093../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 113094 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool {13095 | ^13096../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 213097 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13098 | ^13099../src/daemon/reverse-upload-relay.hh:95:27: note: +113100 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13101 | ^13102../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 213103 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13104 | ^13105../src/daemon/reverse-upload-relay.hh:97:30: note: +113106 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13107 | ^13108../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 213109 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13110 | ^13111../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 213112 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13113 | ^13114../src/daemon/reverse-upload-relay.hh:100:25: note: +113115 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13116 | ^13117../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 213118 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13119 | ^13120../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 313121 102 | if (!live() || !transport.outgoing.waitData(id,13122 | ^13123../src/daemon/reverse-upload-relay.hh:102:29: note: +113124 102 | if (!live() || !transport.outgoing.waitData(id,13125 | ^13126../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 113127 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13128 | ^13129../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 113130 108 | while (read(next)) {13131 | ^13132../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 213133 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13134 | ^13135../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 213136 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13137 | ^13138../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 113139 113 | if (!live() || !transport.outgoing.halfClose(id))13140 | ^13141../src/daemon/reverse-upload-relay.hh:113:21: note: +113142 113 | if (!live() || !transport.outgoing.halfClose(id))13143 | ^13144../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 113145 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13146 | ^13147../src/daemon/reverse-upload-relay.hh:116:75: note: +113148 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13149 | ^13150../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113151 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13152 | ^13153../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 113154 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13155 | ^13156../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 113157 120 | if (!transport.responses.finished(id))13158 | ^13159../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]13160 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status13161 | ^13162 | const &13163../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13164 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13165 | ^13166 | {13167 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};13168 | 13169../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13170 40 | if (!selection.status.ok()) return selection.status;13171 | ^ 13172 | {13173../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13174 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13175 | ^13176 | {13177 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};13178 | 13179../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13180 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13181 | ^ 13182 | {13183../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]13184 45 | auto const id = session->transport->nextStreamId.fetch_add(1);13185 | ^13186../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13187 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13188 | ^ 13189 | {13190../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13191 48 | if (!selection.status.ok()) return selection.status;13192 | ^ 13193 | {13194../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13195 49 | if (!selection.prepared || selection.prepared->session != session)13196 | ^13197 | {13198 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};13199 | 13200../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13201 55 | || selection.prepared->assignId != first.assign_id())13202 | ^13203 | {13204 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};13205 | 13206../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13207 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13208 | ^ 13209 | {13210../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13211 60 | if (!status.ok()) return status;13212 | ^ 13213 | {13214../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]13215 61 | struct Release {13216 | ^13217../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]13218 61 | struct Release {13219 | ^13220 62 | ReverseTransport & transport;13221 63 | uint64_t id;13222 | 13223 | {}13224../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]13225 62 | ReverseTransport & transport;13226 | ^13227../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13228 66 | if (!completed) (void) transport.outgoing.cancel(id);13229 | ^ 13230 | {13231../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]13232 70 | } release{transport, id};13233 | ^~~~~~~~~~~~~~~13234 | .transport=.id=13235../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here13236 61 | struct Release {13237 | ^13238../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]13239 75 | std::condition_variable_any cv;13240 | ^13241../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]13242 76 | std::jthread monitor([&](std::stop_token stop) {13243 | ^13244 | const 13245../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]13246 76 | std::jthread monitor([&](std::stop_token stop) {13247 | ^13248 | -> void13249../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]13250 76 | std::jthread monitor([&](std::stop_token stop) {13251 | ^13252 | const &13253../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]13254 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13255 | ^13256../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]13257 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13258 | ^13259 | -> bool13260../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]13261 90 | auto const live = [&] {13262 | ^13263 | -> bool13264../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13265 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13266 | ^ 13267 | {13268../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13269 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13270 | ^ 13271 | {13272../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13273 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13274 | ^ 13275 | {13276../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]13277 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13278 | ^~~13279../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]13280 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13281 | ^13282../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]13283 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13284 | ^13285../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13286 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13287 | ^ 13288 | {13289../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13290 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13291 | ^13292 | {13293 102 | if (!live() || !transport.outgoing.waitData(id,13294 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13295 | 13296../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13297 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13298 | ^ 13299 | {13300../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13301 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13302 | ^ 13303 | {13304../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13305 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13306 | ^ 13307 | {13308../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13309 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13310 | ^ 13311 | {13312../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13313 113 | if (!live() || !transport.outgoing.halfClose(id))13314 | ^13315 | {13316 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};13317 | 13318../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13319 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13320 | ^13321 | {13322 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};13323 | 13324../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13325 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13326 | ^ 13327 | {13328../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13329 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13330 | ^ 13331 | {13332../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13333 120 | if (!transport.responses.finished(id))13334 | ^13335 | {13336 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};13337 | 13338../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]13339 127 | ReverseGateway & gateway;13340 | ^13341../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]13342 128 | ReverseRegistry & registry;13343 | ^13344../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]13345 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13346 | ^13347../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning13348 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13349 | ^~~~~~~~~~~13350 | static_cast<const size_t>( )13351../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type13352 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13353 | ^~~~13354 | static_cast<long>( )13355../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13356 49 | if (failed || bytes.empty() || !consume) return fail();13357 | ^ 13358 | {13359../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]13360 53 | buffer.append(bytes.data(), count);13361 | ~~~~~~^~~~13362../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13363 57 | for (unsigned i = 0; i < 4; ++i)13364 | ^13365 | {13366 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13367 | 13368../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]13369 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13370 | ^~~13371../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]13372 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13373 | ^13374../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13375 59 | if (length == 0 || length > maxChunkBytes) return fail();13376 | ^ 13377 | {13378../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]13379 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))13380 | ^13381../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13382 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))13383 | ^13384 | {13385 66 | return fail();13386 | 13387../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]13388 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();13389 | ^13390../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13391 371 | auto const it = workerIds.find(std::string(addr));13392 | ^13393../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]13394 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience13395 | ^13396../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13397 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13398 | ^13399 | -> bool13400../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]13401 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13402 | ^13403../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]13404 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13405 | ^13406../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]13407 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13408 | ^13409../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]13410 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13411 | ^13412../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]13413 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13414 | ^13415../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]13416 44 | if (uid[i] != '-') {13417 | ^~~13418../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]13419 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13420 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~13421 | < || > && < || >13422../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]13423 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13424 | ^~~13425../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]13426 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13427 | ^~~13428../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]13429 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13430 | ^~~13431../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]13432 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13433 | ^~~13434../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]13435 96 | auto const & id = *result.identity;13436 | ^13437../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13438 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime13439 | ^~~~~~~~~~~~13440../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13441 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {13442 | ^~~~~~~~~~~~13443../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13444 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;13445 | ^~~~~~~~~13446../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13447 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};13448 | ^~~~~~~~~~~~13449../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]13450 327 | char extra;13451 | ^ 13452 | = 013453../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13454 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");13455 | ^ 13456 | {13457../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13458 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");13459 | ^ 13460 | {13461../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13462 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");13463 | ^ 13464 | {13465Errors encountered while running clang-tidy13466FAILED: [code=1] meson-internal__clang-tidy 13467/nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always13468ninja: build stopped: subcommand failed.