nix-grpc-store-clang-tidy-0.2.2
checks.x86_64-linux.clang-tidy
· build #770
· raw
1tribuchet: building on jamie
unpackPhase
2unpacking source archive /nix/store/cg0kqvfmmilqxhzjggy8hqwkfmib4xpd-source3source root is sourceconfigurePhase
4mesonConfigurePhase flags: --prefix=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-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: x86_6416Host machine cpu: x86_6417Found pkg-config: YES (/nix/store/s70gz6bvz74c36xigh5m2ab2cqli08cv-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/hjz0cvp9c6vi3mpsnhrnh2qjyhwb1db0-protobuf-36.2/bin/protoc)37Program grpc_cpp_plugin found: YES (/nix/store/g10pynzgwpqnf66hi8ynryisg6l616h8-grpc-1.84.0/bin/grpc_cpp_plugin)38Program mold found: YES (/nix/store/nlykwwxppzcffy0gzl3hmfxmhpwx26ms-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/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/bin53 buildtype : plain54 includedir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/include55 infodir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/share/info56 libdir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/lib57 libexecdir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/libexec58 localedir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/share/locale59 mandir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/share/man60 prefix : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.261 sbindir : /nix/store/fm9ccs6g6c4x7kh71myays0b7ji2hasd-nix-grpc-store-clang-tidy-0.2.2/sbin62 wrap_mode : nodownload6364Found ninja-1.13.2 at /nix/store/nyjr5b3ib747yls4n9jq5ijr6wqg6wdc-ninja-1.13.2/bin/ninja65mesonConfigurePhase: enabled\ parallel\ buildingbuildPhase
66[1/2] Generating eds_proto with a custom command67[2/2] Generating nix_remote_proto with a custom command68[0/1] /nix/store/aznm4kx8p4br84x9zdqb5spww7m4bknp-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always69>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-registry-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-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]184 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {185 | ^186../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]187 82 | auto it = sessions.find(std::string(workerId));188 | ^189../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]190 92 | auto it = sessions.find(handle->workerId);191 | ^192../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]193 107 | auto it = sessions.find(handle->workerId);194 | ^195../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]196 130 | for (auto & [id, session] : sessions) {197 | ^198../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]199 32 | [[nodiscard]] auto open(uint64_t id) -> bool200 | ^201../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]202 51 | auto it = streams.find(frame.stream_id());203 | ^204../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]205 56 | if (!cancelled.contains(frame.stream_id())) return false;206 | ^ 207 | {208../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]209 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;210 | ^ 211 | {212../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]213 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool214 | ^215../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]216 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool217 | ^218 | const &219../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]220 104 | auto pending = [&] {221 | ^222 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>223../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]224 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });225 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~226 | std::ranges::find_if queue227../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]228 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });229 | ^230 | -> auto231../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]232 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });233 | ^234 | -> bool235../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]236 111 | auto it = pending();237 | ^238../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]239 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool240 | ^241../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]242 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);243 | ^ 244 | {245../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]246 168 | [[nodiscard]] auto finished(uint64_t id) -> bool247 | ^248../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]249 171 | auto it = streams.find(id);250 | ^251../tests/reverse-registry-test.cc:9:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]252 9 | int main()253 | ~~~ ^ 254 | auto -> int255../tests/reverse-registry-test.cc:14:57: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]256 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby257 | ^258 | -> void259/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'260 138 | ((__VA_ARGS__) \261 | ^262../tests/reverse-registry-test.cc:16:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]263 16 | assert(!registry.registerWorker("", "worker", [] {}));264 | ^265 | -> void266/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'267 138 | ((__VA_ARGS__) \268 | ^269../tests/reverse-registry-test.cc:17:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]270 17 | assert(!registry.registerWorker("other", "worker", [] {}));271 | ^272 | -> void273/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'274 138 | ((__VA_ARGS__) \275 | ^276../tests/reverse-registry-test.cc:18:115: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]277 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));278 | ^279 | -> void280/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'281 138 | ((__VA_ARGS__) \282 | ^283../tests/reverse-registry-test.cc:22:53: error: no header providing "nixgrpc::ReverseTransport" is directly included [misc-include-cleaner,-warnings-as-errors]284 8 | 285 9 | int main()286 10 | {287 11 | nixgrpc::ReverseRegistry registry;288 12 | int firstCancelled = 0;289 13 | int secondCancelled = 0;290 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby291 15 | registry.setActive(true);292 16 | assert(!registry.registerWorker("", "worker", [] {}));293 17 | assert(!registry.registerWorker("other", "worker", [] {}));294 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {}));295 19 | assert(!registry.registerWorker("worker", "worker", {}));296 20 | assert(!registry.find("worker"));297 21 | 298 22 | auto firstTransport = std::make_shared<nixgrpc::ReverseTransport>();299 | ^300../tests/reverse-registry-test.cc:23:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]301 23 | auto first = *registry.registerWorker("worker", "worker", [&] {302 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~303 24 | ++firstCancelled;304 | ~~~~~~~~~~~~~~~~~305 25 | // A session teardown can synchronously inspect the replacement.306 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~307 26 | assert(registry.find("worker"));308 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~309 27 | }, {}, firstTransport);310 | ~~~~~~~~~~~~~~~~~~~~~~311../tests/reverse-registry-test.cc:23:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]312 23 | auto first = *registry.registerWorker("worker", "worker", [&] {313 | ^314 | -> void315../tests/reverse-registry-test.cc:31:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]316 31 | auto other = *registry.registerWorker("other", "other", [] {});317 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~318../tests/reverse-registry-test.cc:31:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]319 31 | auto other = *registry.registerWorker("other", "other", [] {});320 | ^321 | -> void322../tests/reverse-registry-test.cc:32:20: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]323 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });324 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~325../tests/reverse-registry-test.cc:32:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]326 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; });327 | ^328 | -> void329../tests/reverse-registry-test.cc:35:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]330 7 | nix::remote::ReverseWorkerMsg stale;331 | ^332../tests/reverse-registry-test.cc:50:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]333 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });334 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~335../tests/reverse-registry-test.cc:50:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]336 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; });337 | ^338 | -> void339../tests/reverse-registry-test.cc:58:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]340 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });341 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~342../tests/reverse-registry-test.cc:58:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]343 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; });344 | ^345 | -> void346../tests/reverse-registry-test.cc:64:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]347 64 | auto old = *registry.registerWorker("worker", "worker", [] {});348 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~349../tests/reverse-registry-test.cc:64:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]350 64 | auto old = *registry.registerWorker("worker", "worker", [] {});351 | ^352 | -> void353../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]354 65 | std::atomic<bool> go{false};355 | ^356../tests/reverse-registry-test.cc:66:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]357 66 | std::thread closeOld([&] {358 | ^359 | -> void360../tests/reverse-registry-test.cc:73:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]361 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});362 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~363../tests/reverse-registry-test.cc:73:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]364 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {});365 | ^366 | -> void367>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/dispatcher-session-test.cc368../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]369 12 | #include <chrono>370 | 371 13 | #include <chrono>372 | ^~~~~~~~~~~~~~~~~373../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]374 90 | std::chrono::system_clock::time_point credentialExpiresAt{};375 | ^~376../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]377 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();378 | ^379../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]380 371 | auto const it = workerIds.find(std::string(addr));381 | ^382../tests/dispatcher-session-test.cc:14:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]383 14 | int main()384 | ~~~ ^ 385 | auto -> int386../tests/dispatcher-session-test.cc:70:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]387 70 | if (msg.has_assigned()) directAssigned = !msg.assigned().reverse();388 | ^ 389 | {390../tests/dispatcher-session-test.cc:72:8: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]391 72 | }, [] {});392 | ^393 | -> void394../tests/dispatcher-session-test.cc:87:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]395 87 | .send = [](const nix::remote::SchedCmd &) { return true; },396 | ^397 | -> bool398../tests/dispatcher-session-test.cc:129:106: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]399 129 | auto follower = dispatcher.connectClient([](const nix::remote::SchedMsg &) -> bool { return true; }, [] {});400 | ^401 | -> void402../tests/dispatcher-session-test.cc:150:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]403 150 | .send = [&](const nix::remote::SchedCmd & cmd) {404 | ^405 | -> bool406../tests/dispatcher-session-test.cc:168:10: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]407 5 | for (uint32_t const version : {0U, nixgrpc::reverseProtocolVersion + 1}) {408 | ^409../tests/dispatcher-session-test.cc:182:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]410 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});411 | ^412 | -> bool413../tests/dispatcher-session-test.cc:182:103: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]414 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});415 | ^416 | -> void417../tests/dispatcher-session-test.cc:190:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]418 190 | .send = [](const nix::remote::SchedCmd &) { return true; },419 | ^420 | -> bool421>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-responses-test.cc422../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]423 23 | static constexpr size_t maxFrameBytes = 64 * 1024;424 | ^425../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning426 23 | static constexpr size_t maxFrameBytes = 64 * 1024;427 | ^~~~~~~~~428 | static_cast<const size_t>( )429../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type430 23 | static constexpr size_t maxFrameBytes = 64 * 1024;431 | ^~432 | static_cast<long>( )433../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]434 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;435 | ^436../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning437 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;438 | ^~~~~~~~~~~~~~~439 | static_cast<const size_t>( )440../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type441 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;442 | ^~~~~~~~443 | static_cast<long>( )444../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]445 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool446 | ^447../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]448 53 | auto data(uint64_t id, std::string_view bytes) -> bool449 | ^450../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]451 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);452 | ^453../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]454 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool455 | ^456../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]457 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool458 | ^459 | const &460../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]461 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;462 | ^ 463 | {464../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]465 81 | if (size > limit) return false;466 | ^ 467 | {468../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]469 83 | cv.wait(lock, stop, [&] {470 | ^471 | -> bool472../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]473 84 | auto it = streams.find(id);474 | ^475../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]476 87 | auto const it = streams.find(id);477 | ^478../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]479 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;480 | ^ 481 | {482../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]483 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }484 | ^485../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]486 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }487 | ^488../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]489 96 | auto acknowledge(uint64_t id) -> bool490 | ^491../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]492 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;493 | ^ 494 | {495../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]496 105 | if (!enqueue(std::move(msg))) return false;497 | ^ 498 | {499../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]500 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool501 | ^502 | const &503../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]504 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });505 | ^506 | -> bool507../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]508 145 | auto finished(uint64_t id) -> bool509 | ^510../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]511 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;512 | ^ 513 | {514../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]515 150 | if (removed) cv.notify_all();516 | ^ 517 | {518../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]519 156 | void acknowledgementSent(uint64_t id)520 | ^521../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]522 159 | if (acknowledged.erase(id)) streams.erase(id);523 | ^ 524 | != 0u525../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]526 159 | if (acknowledged.erase(id)) streams.erase(id);527 | ^ 528 | {529../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]530 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {531 | ^532../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]533 208 | auto terminal(uint64_t id, bool abort) -> bool534 | ^535../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]536 32 | [[nodiscard]] auto open(uint64_t id) -> bool537 | ^538../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]539 51 | auto it = streams.find(frame.stream_id());540 | ^541../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]542 56 | if (!cancelled.contains(frame.stream_id())) return false;543 | ^ 544 | {545../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]546 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;547 | ^ 548 | {549../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]550 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool551 | ^552../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]553 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool554 | ^555 | const &556../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]557 104 | auto pending = [&] {558 | ^559 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>560../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]561 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });562 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~563 | std::ranges::find_if queue564../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]565 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });566 | ^567 | -> auto568../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]569 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });570 | ^571 | -> bool572../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]573 111 | auto it = pending();574 | ^575../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]576 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool577 | ^578../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]579 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);580 | ^ 581 | {582../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]583 168 | [[nodiscard]] auto finished(uint64_t id) -> bool584 | ^585../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]586 171 | auto it = streams.find(id);587 | ^588../tests/reverse-responses-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]589 8 | int main()590 | ~~~ ^ 591 | auto -> int592../tests/reverse-responses-test.cc:13:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]593 6 | #include "reverse-responses.hh"594 7 | 595 8 | int main()596 9 | {597 10 | nixgrpc::ReverseResponses replies;598 11 | assert(!replies.open(0));599 12 | assert(replies.open(1) && !replies.open(1));600 13 | nix::remote::ReverseWorkerMsg response;601 | ^602../tests/reverse-responses-test.cc:23:60: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]603 6 | response.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x'));604 | ^605../tests/reverse-responses-test.cc:27:53: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]606 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));607 | ^608../tests/reverse-responses-test.cc:27:69: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]609 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));610 | ^611../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]612 40 | response.mutable_finish()->set_code(123);613 | ^614../tests/reverse-responses-test.cc:63:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]615 2 | size_t queued = 0;616 | ^617../tests/reverse-responses-test.cc:77:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]618 77 | std::jthread waiter([&] {619 | ^620 | -> void621../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]622 79 | received = replies.waitTake(6, isolated, stop.get_token())623 | ^624../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]625 80 | && isolated.stream_id() == 6 && isolated.data().data() == "only six";626 | ^627../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]628 82 | response.set_stream_id(5);629 | ^630../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]631 85 | response.set_stream_id(6);632 | ^633>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-roundtrip-test.cc634../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]635 553 | namespaceClaim && namespaceClaim->is_string()) {636 | ^637 | ( != nullptr)638../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]639 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {640 | ^641 | ( != nullptr)642../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]643 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {644 | ^645../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]646 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {647 | ^648../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]649 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {650 | ^651../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]652 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {653 | ^654 | ( != nullptr)655../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]656 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {657 | ^658../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]659 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)660 | ^661../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]662 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||663 | ^664../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]665 96 | result.push_back(static_cast<char>(size >> (i * 8)));666 | ^667../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]668 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,669 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~670../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'671 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,672 | ^~~~~673../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'674 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,675 | ^~~~~~~~676../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]677 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);678 | ^~~679../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]680 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);681 | ^682../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]683 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)684 | ^685../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]686 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)687 | ^688../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]689 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||690 | ^691../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]692 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;693 | ^ 694 | {695../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]696 250 | unsigned char mac[EVP_MAX_MD_SIZE];697 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~698../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]699 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),700 | ~^701 | (702 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||703 | == nullptr)704../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]705 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||706 | ^707../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]708 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||709 | ^710../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]711 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);712 | ^713../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]714 23 | static constexpr size_t maxFrameBytes = 64 * 1024;715 | ^716../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning717 23 | static constexpr size_t maxFrameBytes = 64 * 1024;718 | ^~~~~~~~~719 | static_cast<const size_t>( )720../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type721 23 | static constexpr size_t maxFrameBytes = 64 * 1024;722 | ^~723 | static_cast<long>( )724../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]725 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;726 | ^727../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning728 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;729 | ^~~~~~~~~~~~~~~730 | static_cast<const size_t>( )731../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type732 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;733 | ^~~~~~~~734 | static_cast<long>( )735../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]736 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool737 | ^738../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]739 53 | auto data(uint64_t id, std::string_view bytes) -> bool740 | ^741../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]742 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);743 | ^744../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]745 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool746 | ^747../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]748 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool749 | ^750 | const &751../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]752 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;753 | ^ 754 | {755../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]756 81 | if (size > limit) return false;757 | ^ 758 | {759../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]760 83 | cv.wait(lock, stop, [&] {761 | ^762 | -> bool763../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]764 84 | auto it = streams.find(id);765 | ^766../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]767 87 | auto const it = streams.find(id);768 | ^769../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]770 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;771 | ^ 772 | {773../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]774 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }775 | ^776../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]777 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }778 | ^779../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]780 96 | auto acknowledge(uint64_t id) -> bool781 | ^782../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]783 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;784 | ^ 785 | {786../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]787 105 | if (!enqueue(std::move(msg))) return false;788 | ^ 789 | {790../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]791 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool792 | ^793 | const &794../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]795 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });796 | ^797 | -> bool798../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]799 145 | auto finished(uint64_t id) -> bool800 | ^801../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]802 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;803 | ^ 804 | {805../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]806 150 | if (removed) cv.notify_all();807 | ^ 808 | {809../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]810 156 | void acknowledgementSent(uint64_t id)811 | ^812../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]813 159 | if (acknowledged.erase(id)) streams.erase(id);814 | ^ 815 | != 0u816../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]817 159 | if (acknowledged.erase(id)) streams.erase(id);818 | ^ 819 | {820../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]821 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {822 | ^823../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]824 208 | auto terminal(uint64_t id, bool abort) -> bool825 | ^826../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]827 50 | auto const id = frame.stream_id();828 | ^829../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]830 68 | auto it = streams.find(id);831 | ^832../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]833 74 | && finishedIds.erase(id))834 | ^ 835 | ( != 0u)836../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]837 74 | && finishedIds.erase(id))838 | ^839 | {840 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};841 | 842../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]843 109 | auto finished(uint64_t id) -> bool844 | ^845../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]846 111 | if (cancelledIds.erase(id)) return true;847 | ^ 848 | != 0u849../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]850 111 | if (cancelledIds.erase(id)) return true;851 | ^ 852 | {853../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]854 112 | if (!streams.erase(id)) return false;855 | ~^ 856 | == 0u857../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]858 112 | if (!streams.erase(id)) return false;859 | ^ 860 | {861../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]862 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {863 | ^864../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]865 82 | auto it = sessions.find(std::string(workerId));866 | ^867../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]868 92 | auto it = sessions.find(handle->workerId);869 | ^870../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]871 107 | auto it = sessions.find(handle->workerId);872 | ^873../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]874 130 | for (auto & [id, session] : sessions) {875 | ^876../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]877 32 | [[nodiscard]] auto open(uint64_t id) -> bool878 | ^879../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]880 51 | auto it = streams.find(frame.stream_id());881 | ^882../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]883 56 | if (!cancelled.contains(frame.stream_id())) return false;884 | ^ 885 | {886../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]887 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;888 | ^ 889 | {890../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]891 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool892 | ^893../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]894 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool895 | ^896 | const &897../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]898 104 | auto pending = [&] {899 | ^900 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>901../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]902 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });903 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~904 | std::ranges::find_if queue905../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]906 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });907 | ^908 | -> auto909../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]910 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });911 | ^912 | -> bool913../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]914 111 | auto it = pending();915 | ^916../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]917 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool918 | ^919../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]920 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);921 | ^ 922 | {923../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]924 168 | [[nodiscard]] auto finished(uint64_t id) -> bool925 | ^926../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]927 171 | auto it = streams.find(id);928 | ^929../tests/reverse-roundtrip-test.cc:10:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]930 10 | int main()931 | ~~~ ^ 932 | auto -> int933../tests/reverse-roundtrip-test.cc:12:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]934 4 | #include "reverse-capability.hh"935 5 | #include "reverse-frames.hh"936 6 | #include "reverse-inbound.hh"937 7 | #include "reverse-registry.hh"938 8 | #include "reverse-responses.hh"939 9 | 940 10 | int main()941 11 | {942 12 | using nixgrpc::Caller;943 | ^944../tests/reverse-roundtrip-test.cc:18:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]945 4 | #include "reverse-capability.hh"946 5 | #include "reverse-frames.hh"947 6 | #include "reverse-inbound.hh"948 7 | #include "reverse-registry.hh"949 8 | #include "reverse-responses.hh"950 9 | 951 10 | int main()952 11 | {953 12 | using nixgrpc::Caller;954 13 | using nixgrpc::ReverseCapability;955 14 | using nixgrpc::ReverseFrames;956 15 | using nixgrpc::ReverseInbound;957 16 | using nixgrpc::ReverseRegistry;958 17 | using nixgrpc::ReverseResponses;959 18 | using nixgrpc::Role;960 | ^961../tests/reverse-roundtrip-test.cc:25:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]962 25 | auto handle = registry.registerWorker(worker, worker, [] {}, *key);963 | ^964 | -> void965../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]966 33 | "BuildDerivation", writer, "assigned.drv", 42, 0);967 | ^968../tests/reverse-roundtrip-test.cc:35:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]969 4 | nix::remote::ReverseOpen start;970 | ^971../tests/reverse-roundtrip-test.cc:38:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]972 3 | assert(outgoing.open(1, std::move(start)) && outgoing.data(1, "request bytes") && outgoing.halfClose(1));973 | ^974../tests/reverse-roundtrip-test.cc:40:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]975 40 | nix::remote::ReverseFarmMsg toWorker;976 | ^977../tests/reverse-roundtrip-test.cc:44:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]978 44 | nix::remote::BuildDerivationRequest request;979 | ^980../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]981 46 | request.set_assign_id(42);982 | ^983../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]984 48 | request.set_assign_id(43);985 | ^986../tests/reverse-roundtrip-test.cc:50:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]987 50 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::data);988 | ^989/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'990 138 | ((__VA_ARGS__) \991 | ^~~~~~~~~~~992../tests/reverse-roundtrip-test.cc:51:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]993 51 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::halfClose);994 | ^995/nix/store/3zlgjcfm8j3nscrldjv8izxciybg0nh3-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert'996 138 | ((__VA_ARGS__) \997 | ^~~~~~~~~~~998../tests/reverse-roundtrip-test.cc:54:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]999 54 | nix::remote::ReverseWorkerMsg fromWorker;1000 | ^1001../tests/reverse-roundtrip-test.cc:58:55: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1002 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1003 | ^1004../tests/reverse-roundtrip-test.cc:58:71: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]1005 2 | fromWorker.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));1006 | ^1007../tests/reverse-roundtrip-test.cc:68:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1008 68 | auto replacement = registry.registerWorker(worker, worker, [] {}, *nextKey);1009 | ^1010 | -> void1011>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-capability-test.cc1012../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1013 553 | namespaceClaim && namespaceClaim->is_string()) {1014 | ^1015 | ( != nullptr)1016../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1017 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1018 | ^1019 | ( != nullptr)1020../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1021 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1022 | ^1023../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1024 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1025 | ^1026../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1027 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1028 | ^1029../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1030 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1031 | ^1032 | ( != nullptr)1033../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1034 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1035 | ^1036../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1037 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1038 | ^1039../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]1040 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1041 | ^1042../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]1043 96 | result.push_back(static_cast<char>(size >> (i * 8)));1044 | ^1045../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]1046 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1047 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1048../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1049 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1050 | ^~~~~1051../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1052 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1053 | ^~~~~~~~1054../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]1055 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1056 | ^~~1057../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]1058 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1059 | ^1060../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1061 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1062 | ^1063../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1064 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1065 | ^1066../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]1067 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1068 | ^1069../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1070 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1071 | ^ 1072 | {1073../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]1074 250 | unsigned char mac[EVP_MAX_MD_SIZE];1075 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1076../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1077 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1078 | ~^1079 | (1080 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1081 | == nullptr)1082../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1083 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1084 | ^1085../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]1086 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1087 | ^1088../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1089 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1090 | ^1091../tests/reverse-capability-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1092 7 | int main()1093 | ~~~ ^ 1094 | auto -> int1095../tests/reverse-capability-test.cc:9:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1096 5 | #include "reverse-capability.hh"1097 6 | 1098 7 | int main()1099 8 | {1100 9 | using nixgrpc::Caller;1101 | ^1102../tests/reverse-capability-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1103 5 | #include "reverse-capability.hh"1104 6 | 1105 7 | int main()1106 8 | {1107 9 | using nixgrpc::Caller;1108 10 | using nixgrpc::ReverseCapability;1109 11 | using nixgrpc::Role;1110 | ^1111../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]1112 19 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1113 | ^~~~~~~~~~1114 | const auto *const 1115../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]1116 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1117 | ^1118../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]1119 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1120 | ^1121../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]1122 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now);1123 | ^1124../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]1125 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1126 | ^1127../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]1128 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now);1129 | ^1130../tests/reverse-capability-test.cc:25:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1131 5 | nix::remote::ReverseOpen open;1132 | ^1133../tests/reverse-capability-test.cc:31:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]1134 31 | nix::remote::BuildDerivationRequest request;1135 | ^1136../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]1137 33 | request.set_assign_id(93);1138 | ^1139../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]1140 35 | request.set_assign_id(94);1141 | ^1142../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]1143 37 | request.set_assign_id(93);1144 | ^1145../tests/reverse-capability-test.cc:38:40: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]1146 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1147 | ^1148../tests/reverse-capability-test.cc:38:55: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors]1149 3 | request.set_build_mode(static_cast<uint32_t>(nix::bmRepair));1150 | ^1151../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]1152 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1153 | ^1154../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]1155 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now);1156 | ^1157../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]1158 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1159 | ^1160../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]1161 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now);1162 | ^1163../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]1164 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1165 | ^1166../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]1167 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now);1168 | ^1169../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]1170 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1171 | ^1172../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]1173 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now);1174 | ^1175../tests/reverse-capability-test.cc:75:18: error: no header providing "nix::remote::AddMultipleChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1176 75 | nix::remote::AddMultipleChunk first;1177 | ^1178../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]1179 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1180 | ^1181../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]1182 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer,1183 | ^1184../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]1185 81 | "abc.drv", 93, 0, now);1186 | ^1187../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]1188 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1189 | ^1190../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]1191 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now);1192 | ^1193../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]1194 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1195 | ^1196../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]1197 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted,1198 | ^1199../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]1200 98 | "abc.drv", 93, 0, now);1201 | ^1202../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]1203 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1204 | ^1205../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]1206 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now);1207 | ^1208../tests/reverse-capability-test.cc:105:24: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors]1209 3 | noRole.role = std::nullopt;1210 | ^1211../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]1212 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1213 | ^1214../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]1215 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now);1216 | ^1217>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-frames-test.cc1218../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]1219 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1220 | ^1221../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1222 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1223 | ^~~~~~~~~1224 | static_cast<const size_t>( )1225../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1226 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1227 | ^~1228 | static_cast<long>( )1229../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]1230 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1231 | ^1232../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1233 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1234 | ^~~~~~~~~~~~~~~1235 | static_cast<const size_t>( )1236../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1237 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1238 | ^~~~~~~~1239 | static_cast<long>( )1240../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]1241 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1242 | ^1243../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]1244 53 | auto data(uint64_t id, std::string_view bytes) -> bool1245 | ^1246../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]1247 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1248 | ^1249../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]1250 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1251 | ^1252../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]1253 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1254 | ^1255 | const &1256../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1257 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1258 | ^ 1259 | {1260../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1261 81 | if (size > limit) return false;1262 | ^ 1263 | {1264../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1265 83 | cv.wait(lock, stop, [&] {1266 | ^1267 | -> bool1268../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]1269 84 | auto it = streams.find(id);1270 | ^1271../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]1272 87 | auto const it = streams.find(id);1273 | ^1274../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1275 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1276 | ^ 1277 | {1278../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]1279 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1280 | ^1281../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]1282 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1283 | ^1284../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]1285 96 | auto acknowledge(uint64_t id) -> bool1286 | ^1287../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1288 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1289 | ^ 1290 | {1291../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1292 105 | if (!enqueue(std::move(msg))) return false;1293 | ^ 1294 | {1295../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]1296 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1297 | ^1298 | const &1299../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1300 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1301 | ^1302 | -> bool1303../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]1304 145 | auto finished(uint64_t id) -> bool1305 | ^1306../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1307 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1308 | ^ 1309 | {1310../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1311 150 | if (removed) cv.notify_all();1312 | ^ 1313 | {1314../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]1315 156 | void acknowledgementSent(uint64_t id)1316 | ^1317../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1318 159 | if (acknowledged.erase(id)) streams.erase(id);1319 | ^ 1320 | != 0u1321../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1322 159 | if (acknowledged.erase(id)) streams.erase(id);1323 | ^ 1324 | {1325../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]1326 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1327 | ^1328../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]1329 208 | auto terminal(uint64_t id, bool abort) -> bool1330 | ^1331../tests/reverse-frames-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1332 8 | int main()1333 | ~~~ ^ 1334 | auto -> int1335../tests/reverse-frames-test.cc:11:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]1336 6 | #include "reverse-frames.hh"1337 7 | 1338 8 | int main()1339 9 | {1340 10 | nixgrpc::ReverseFrames frames;1341 11 | nix::remote::ReverseOpen start;1342 | ^1343../tests/reverse-frames-test.cc:26:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1344 26 | nix::remote::ReverseFarmMsg msg;1345 | ^1346../tests/reverse-frames-test.cc:52:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors]1347 2 | for (uint64_t id = 3; id < 3 + nixgrpc::ReverseFrames::maxStreams; ++id) {1348 | ^1349../tests/reverse-frames-test.cc:56:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]1350 2 | size_t queued = 0;1351 | ^1352../tests/reverse-frames-test.cc:70:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1353 70 | std::jthread waiter([&] {1354 | ^1355 | -> void1356../tests/reverse-frames-test.cc:87:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1357 87 | std::jthread producer([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });1358 | ^1359 | -> void1360../tests/reverse-frames-test.cc:93:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1361 93 | std::jthread interrupted([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); });1362 | ^1363 | -> void1364../tests/reverse-frames-test.cc:103:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1365 103 | std::jthread discarded([&] { enqueued = cancelled.waitData(1, payload, stillRunning.get_token()); });1366 | ^1367 | -> void1368>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-worker-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-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1562 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1563 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1564 | .status= .prepared=1565../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1566 41 | struct Result1567 | ^1568../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]1569 65 | Role minRole;1570 | ^1571../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1572 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};1573 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1574 | .status= .prepared=1575../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1576 41 | struct Result1577 | ^1578../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1579 85 | return {status, {}};1580 | ^~~~~~~~~~~~1581 | .status=.prepared=1582../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1583 41 | struct Result1584 | ^1585../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1586 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};1587 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1588 | .status= .prepared=1589../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1590 41 | struct Result1591 | ^1592../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1593 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};1594 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1595 | .status= .prepared=1596../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1597 41 | struct Result1598 | ^1599../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1600 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};1601 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1602 | .status= .prepared=1603../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1604 41 | struct Result1605 | ^1606../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1607 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};1608 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1609 | .status= .prepared=1610../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1611 41 | struct Result1612 | ^1613../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1614 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};1615 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1616 | .status= .prepared=1617../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1618 41 | struct Result1619 | ^1620../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1621 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};1622 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1623 | .status= .prepared=1624../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1625 41 | struct Result1626 | ^1627../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1628 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),1629 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1630 | .status= .prepared=1631 123 | std::string(drvPath), assignId}};1632 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1633../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1634 41 | struct Result1635 | ^1636../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]1637 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),1638 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1639 | .session= .open=1640 123 | std::string(drvPath), assignId}};1641 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1642 | .drvPath= .assignId=1643../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here1644 33 | struct Prepared1645 | ^1646../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1647 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1648 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1649 | .status= .prepared=1650../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1651 41 | struct Result1652 | ^1653../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1654 189 | return {status, {}};1655 | ^~~~~~~~~~~~1656 | .status=.prepared=1657../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1658 41 | struct Result1659 | ^1660../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1661 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};1662 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1663 | .status= .prepared=1664../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1665 41 | struct Result1666 | ^1667../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1668 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};1669 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1670 | .status= .prepared=1671../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1672 41 | struct Result1673 | ^1674../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1675 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};1676 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1677 | .status= .prepared=1678../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1679 41 | struct Result1680 | ^1681../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1682 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};1683 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1684 | .status= .prepared=1685../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1686 41 | struct Result1687 | ^1688../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1689 218 | return {status, {}};1690 | ^~~~~~~~~~~~1691 | .status=.prepared=1692../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1693 41 | struct Result1694 | ^1695../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1696 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};1697 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1698 | .status= .prepared=1699../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1700 41 | struct Result1701 | ^1702../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]1703 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};1704 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1705 | .status= .prepared=1706../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here1707 41 | struct Result1708 | ^1709../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]1710 233 | Auth &auth;1711 | ^1712../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]1713 234 | ReverseRegistry ®istry;1714 | ^1715../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]1716 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {1717 | ^1718../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]1719 82 | auto it = sessions.find(std::string(workerId));1720 | ^1721../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]1722 92 | auto it = sessions.find(handle->workerId);1723 | ^1724../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]1725 107 | auto it = sessions.find(handle->workerId);1726 | ^1727../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]1728 130 | for (auto & [id, session] : sessions) {1729 | ^1730../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1731 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};1732 | ^ 1733 | {1734../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1735 56 | if (!selection.status.ok()) return selection.status;1736 | ^ 1737 | {1738../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1739 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};1740 | ^ 1741 | {1742../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1743 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};1744 | ^ 1745 | {1746../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1747 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};1748 | ^ 1749 | {1750../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]1751 61 | auto const id = session->transport->nextStreamId.fetch_add(1);1752 | ^1753../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1754 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};1755 | ^ 1756 | {1757../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1758 64 | if (!selection.status.ok()) return selection.status;1759 | ^ 1760 | {1761../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1762 65 | if (!selection.prepared || selection.prepared->session != session)1763 | ^1764 | {1765 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};1766 | 1767../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1768 67 | if (request.ByteSizeLong() > maxRequestBytes)1769 | ^1770 | {1771 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};1772 | 1773../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1774 70 | if (bytes.size() > maxRequestBytes)1775 | ^1776 | {1777 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};1778 | 1779../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1780 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};1781 | ^ 1782 | {1783../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1784 75 | if (!status.ok()) return status;1785 | ^ 1786 | {1787../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]1788 77 | struct Release {1789 | ^1790../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]1791 77 | struct Release {1792 | ^1793 78 | ReverseTransport & transport;1794 79 | uint64_t id;1795 | 1796 | {}1797../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]1798 78 | ReverseTransport & transport;1799 | ^1800../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1801 84 | if (!completed) (void) transport.outgoing.cancel(id);1802 | ^ 1803 | {1804../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1805 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));1806 | ^ 1807 | {1808../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]1809 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));1810 | ^1811../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]1812 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));1813 | ^1814../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1815 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};1816 | ^ 1817 | {1818../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1819 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))1820 | ^1821 | {1822 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};1823 | 1824../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1825 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))1826 | ^1827 | {1828 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};1829 | 1830../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1831 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};1832 | ^ 1833 | {1834../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1835 111 | std::jthread monitor([&](std::stop_token stop) {1836 | ^1837 | -> auto1838../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]1839 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });1840 | ^1841../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1842 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });1843 | ^1844 | -> auto1845../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1846 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};1847 | ^ 1848 | {1849../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1850 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))1851 | ^1852 | {1853 128 | return {grpc::StatusCode::UNAVAILABLE,1854 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};1855 | 1856../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1857 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))1858 | ^1859 | {1860 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};1861 | 1862../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1863 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};1864 | ^ 1865 | {1866../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1867 135 | if (beforeAck) beforeAck();1868 | ^ 1869 | {1870../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1871 136 | if (!transport.outgoing.acknowledge(id))1872 | ^1873 | {1874 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};1875 | 1876../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1877 145 | if (pending.size() < 4) break;1878 | ^ 1879 | {1880../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1881 147 | for (unsigned i = 0; i != 4; ++i)1882 | ^1883 | {1884 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);1885 | 1886../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]1887 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);1888 | ^~~1889../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]1890 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);1891 | ^1892../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1893 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};1894 | ^ 1895 | {1896../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1897 153 | if (pending.size() < *expected) break;1898 | ^ 1899 | {1900../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1901 154 | if (!receive(std::string_view(pending).substr(0, *expected)))1902 | ^1903 | {1904 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};1905 | 1906../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1907 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};1908 | ^ 1909 | {1910../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1911 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};1912 | ^ 1913 | {1914../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1915 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};1916 | ^ 1917 | {1918../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1919 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))1920 | ^1921 | {1922 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};1923 | 1924../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]1925 169 | ReverseGateway & gateway;1926 | ^1927../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]1928 170 | ReverseRegistry & registry;1929 | ^1930../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]1931 32 | [[nodiscard]] auto open(uint64_t id) -> bool1932 | ^1933../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]1934 51 | auto it = streams.find(frame.stream_id());1935 | ^1936../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1937 56 | if (!cancelled.contains(frame.stream_id())) return false;1938 | ^ 1939 | {1940../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1941 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;1942 | ^ 1943 | {1944../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]1945 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1946 | ^1947../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]1948 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1949 | ^1950 | const &1951../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1952 104 | auto pending = [&] {1953 | ^1954 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>1955../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]1956 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1957 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~1958 | std::ranges::find_if queue1959../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1960 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1961 | ^1962 | -> auto1963../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1964 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });1965 | ^1966 | -> bool1967../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]1968 111 | auto it = pending();1969 | ^1970../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]1971 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool1972 | ^1973../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1974 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);1975 | ^ 1976 | {1977../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]1978 168 | [[nodiscard]] auto finished(uint64_t id) -> bool1979 | ^1980../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]1981 171 | auto it = streams.find(id);1982 | ^1983../src/daemon/reverse-worker.hh:26:41: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1984 26 | [[nodiscard]] auto message(uint64_t id, const nix::remote::BuildDerivationChunk & chunk,1985 | ^1986../src/daemon/reverse-worker.hh:27:48: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]1987 27 | std::stop_token stop, const std::function<bool()> & cancelled = {}) -> bool1988 | ^1989 | const &1990../src/daemon/reverse-worker.hh:30:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1991 30 | if (size > ReverseRelay::maxMessageBytes) return false;1992 | ^ 1993 | {1994../src/daemon/reverse-worker.hh:32:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1995 32 | if (wire.size() > ReverseRelay::maxMessageBytes) return false;1996 | ^ 1997 | {1998../src/daemon/reverse-worker.hh:36:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1999 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast<char>((length >> (8 * i)) & 0xff));2000 | ^ loading 8,465 hidden lines…
10466 54 | WorkerIdentity & identity;10467 | ^10468../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]10469 55 | ReverseRegistry & registry;10470 | ^10471../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]10472 56 | Auth & workerAuth;10473 | ^10474../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]10475 104 | std::string_view value(first->second.data(), first->second.size());10476 | ^10477 | const 10478../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10479 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },10480 | ^10481 | -> void10482../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10483 139 | struct Cleanup10484 | ^10485../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]10486 139 | struct Cleanup10487 | ^10488../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]10489 141 | ReverseRegistry & registry;10490 | ^10491../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]10492 149 | } cleanup{registry, *handle, cancellation};10493 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10494 | .registry=.handle= .cancellation=10495../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here10496 139 | struct Cleanup10497 | ^10498../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]10499 156 | std::condition_variable_any cv;10500 | ^10501../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10502 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10503 | ^10504 | const 10505../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10506 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10507 | ^10508 | -> void10509../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]10510 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {10511 | ^10512 | const &10513../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10514 161 | cv.wait_until(lock, stop, deadline, [] { return false; });10515 | ^10516 | -> bool10517../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10518 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10519 | ^10520 | const 10521../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10522 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10523 | ^10524 | -> void10525../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]10526 177 | std::jthread writer([&, cancellation](std::stop_token stop) {10527 | ^10528 | const &10529../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10530 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());10531 | ^ 10532 | {10533../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]10534 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10535 | ^10536../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]10537 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10538 | ^10539 | -> bool10540../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]10541 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {10542 | ^10543../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10544 33 | if (assigned && !assigned()) return false;10545 | ^ 10546 | {10547../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]10548 35 | std::scoped_lock lock(mutex);10549 | ^10550 | const 10551../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10552 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;10553 | ^ 10554 | {10555../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10556 42 | if (!ok) cancel();10557 | ^ 10558 | {10559../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]10560 49 | std::scoped_lock lock(mutex);10561 | ^10562 | const 10563../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10564 68 | if (closed) return false;10565 | ^ 10566 | {10567../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10568 79 | if (ended || !chunks.empty()) break;10569 | ^ 10570 | {10571../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]10572 80 | cv.wait_for(lock, std::chrono::milliseconds(25));10573 | ^10574../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10575 82 | if (chunks.empty()) return false;10576 | ^ 10577 | {10578../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]10579 92 | std::scoped_lock lock(mutex);10580 | ^10581 | const 10582../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]10583 103 | cv.wait_for(lock, std::chrono::milliseconds(25));10584 | ^10585../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10586 113 | if (!ended || closed || !chunks.empty()) return false;10587 | ^ 10588 | {10589../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]10590 120 | std::scoped_lock lock(mutex);10591 | ^10592 | const 10593../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]10594 129 | std::scoped_lock lock(mutex);10595 | ^10596 | const 10597../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]10598 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10599 | ^10600../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning10601 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10602 | ^~~~~~~~~~~10603 | static_cast<const size_t>( )10604../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type10605 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;10606 | ^~~~10607 | static_cast<long>( )10608../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10609 49 | if (failed || bytes.empty() || !consume) return fail();10610 | ^ 10611 | {10612../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]10613 53 | buffer.append(bytes.data(), count);10614 | ~~~~~~^~~~10615../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10616 57 | for (unsigned i = 0; i < 4; ++i)10617 | ^10618 | {10619 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10620 | 10621../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]10622 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10623 | ^~~10624../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]10625 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);10626 | ^10627../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10628 59 | if (length == 0 || length > maxChunkBytes) return fail();10629 | ^ 10630 | {10631../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]10632 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))10633 | ^10634../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10635 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))10636 | ^10637 | {10638 66 | return fail();10639 | 10640../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]10641 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();10642 | ^10643../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10644 371 | auto const it = workerIds.find(std::string(addr));10645 | ^10646../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]10647 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience10648 | ^10649../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10650 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {10651 | ^10652 | -> bool10653../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]10654 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {10655 | ^10656../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]10657 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10658 | ^10659../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]10660 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10661 | ^10662../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]10663 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10664 | ^10665../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]10666 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {10667 | ^10668../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]10669 44 | if (uid[i] != '-') {10670 | ^~~10671../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]10672 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10673 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10674 | < || > && < || >10675../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]10676 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10677 | ^~~10678../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]10679 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10680 | ^~~10681../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]10682 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10683 | ^~~10684../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]10685 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {10686 | ^~~10687../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]10688 96 | auto const & id = *result.identity;10689 | ^10690../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10691 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime10692 | ^~~~~~~~~~~~10693../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10694 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {10695 | ^~~~~~~~~~~~10696../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10697 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;10698 | ^~~~~~~~~10699../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]10700 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};10701 | ^~~~~~~~~~~~10702../tests/oidc-test.cc:4:1: error: included header atomic is not used directly [misc-include-cleaner,-warnings-as-errors]10703 4 | #include <atomic>10704 | ^~~~~~~~~~~~~~~~~10705 5 | #include <chrono>10706../tests/oidc-test.cc:243:53: error: no header providing "nix::remote::NixRemote" is directly included [misc-include-cleaner,-warnings-as-errors]10707 41 | class BuildRouteService final : public nix::remote::NixRemote::Service10708 | ^10709../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]10710 245 | nixgrpc::ReverseGateway & gateway;10711 | ^10712../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]10713 246 | nixgrpc::Dispatcher & dispatcher;10714 | ^10715../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]10716 250 | std::string drvPath;10717 | ^10718../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]10719 251 | uint64_t assignId = 0;10720 | ^10721../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]10722 252 | std::string selectedPod;10723 | ^10724../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]10725 253 | bool relayEnabled = false;10726 | ^10727../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]10728 254 | bool buildRelayEnabled = false;10729 | ^10730../tests/oidc-test.cc:256:67: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors]10731 42 | BuildRouteService(nixgrpc::ReverseGateway & gateway, nixgrpc::ReverseRegistry & registry,10732 | ^10733../tests/oidc-test.cc:260:70: error: no header providing "nix::remote::StoreInfoRequest" is directly included [misc-include-cleaner,-warnings-as-errors]10734 41 | auto StoreInfo(grpc::ServerContext * context, const nix::remote::StoreInfoRequest * request,10735 | ^10736../tests/oidc-test.cc:261:33: error: no header providing "nix::remote::StoreInfoReply" is directly included [misc-include-cleaner,-warnings-as-errors]10737 261 | nix::remote::StoreInfoReply * reply) -> grpc::Status override10738 | ^10739../tests/oidc-test.cc:261:66: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors]10740 10 | nix::remote::StoreInfoReply * reply) -> grpc::Status override10741 | ^10742../tests/oidc-test.cc:264:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10743 264 | return relay.call(*context, [&](uint64_t id) {10744 | ^10745 | -> Result10746../tests/oidc-test.cc:264:54: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10747 264 | return relay.call(*context, [&](uint64_t id) {10748 | ^10749../tests/oidc-test.cc:266:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10750 266 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },10751 | ^10752 | -> std::optional<std::string>10753../tests/oidc-test.cc:268:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10754 268 | }, *request, [&](std::string_view data) { return reply->ParseFromArray(data.data(), static_cast<int>(data.size())); });10755 | ^10756 | -> bool10757../tests/oidc-test.cc:271:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10758 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },10759 | ^10760 | -> std::optional<std::string>10761../tests/oidc-test.cc:271:61: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10762 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },10763 | ^10764../tests/oidc-test.cc:277:76: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]10765 277 | auto BuildDerivation(grpc::ServerContext * context, const nix::remote::BuildDerivationRequest * request,10766 | ^10767../tests/oidc-test.cc:278:58: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors]10768 278 | grpc::ServerWriter<nix::remote::BuildDerivationChunk> * writer) -> grpc::Status override10769 | ^10770../tests/oidc-test.cc:280:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10771 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};10772 | ^ 10773 | {10774../tests/oidc-test.cc:280:47: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]10775 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};10776 | ^10777../tests/oidc-test.cc:282:44: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10778 282 | auto status = relay.call(*context, [&](uint64_t id) {10779 | ^10780 | -> Result10781../tests/oidc-test.cc:282:57: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]10782 282 | auto status = relay.call(*context, [&](uint64_t id) {10783 | ^10784../tests/oidc-test.cc:284:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10785 284 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },10786 | ^10787 | -> std::optional<std::string>10788../tests/oidc-test.cc:286:22: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10789 286 | }, *request, [&](std::string_view data) {10790 | ^10791 | -> bool10792../tests/oidc-test.cc:289:88: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10793 289 | chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET) return false;10794 | ^ 10795 | {10796../tests/oidc-test.cc:292:12: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10797 292 | }, [this, drv = request->drv_path(), assign = request->assign_id()] {10798 | ^10799 | -> bool10800../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]10801 457 | check(!verifier.verify(ecKey.sign(claims({{"sub", 42}}))).identity,10802 | ^10803../tests/oidc-test.cc:507:26: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10804 507 | projectedAudience["aud"] = {"grpc://worker-tunnel"};10805 | ^~~~~~~10806../tests/oidc-test.cc:513:20: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10807 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";10808 | ^~~~~~~~~~~~~~~~~10809../tests/oidc-test.cc:513:37: 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:44: 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:514:9: error: 'const auto replacementId' can be declared as 'const auto *const replacementId' [readability-qualified-auto,-warnings-as-errors]10816 514 | auto const replacementId = "pod:staging:12345678-1234-1234-1234-123456789abd";10817 | ^~~~~~~~~~10818 | const auto *const 10819../tests/oidc-test.cc:519:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10820 519 | otherAudience["aud"] = "grpc://cache";10821 | ^~~~~~~10822../tests/oidc-test.cc:522:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10823 522 | mixedAudience["aud"] = {"grpc://worker-tunnel", "grpc://cache"};10824 | ^~~~~~~10825../tests/oidc-test.cc:526:23: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10826 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production";10827 | ^~~~~~~~~~~~~~~~~10828../tests/oidc-test.cc:526:40: 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:529:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10832 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";10833 | ^~~~~~~~~~~~~~~~~10834../tests/oidc-test.cc:529:33: 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:51: 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:532:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10841 532 | noUid["kubernetes.io"]["pod"].erase("uid");10842 | ^~~~~~~~~~~~~~~~~10843../tests/oidc-test.cc:532:31: 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:536:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10847 536 | noPod["kubernetes.io"].erase("pod");10848 | ^~~~~~~~~~~~~~~~~10849../tests/oidc-test.cc:539:13: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10850 539 | noSa["kubernetes.io"].erase("serviceaccount");10851 | ^~~~~~~~~~~~~~~~~10852../tests/oidc-test.cc:542:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10853 542 | expired["exp"] = now() - longAgo;10854 | ^~~~~~~10855../tests/oidc-test.cc:548:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10856 548 | longLived["exp"] = now() + 3600;10857 | ^~~~~~~10858../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]10859 548 | longLived["exp"] = now() + 3600;10860 | ^10861../tests/oidc-test.cc:551:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10862 551 | backdated["iat"] = now() - 3000;10863 | ^~~~~~~10864../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]10865 551 | backdated["iat"] = now() - 3000;10866 | ^10867../tests/oidc-test.cc:552:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10868 552 | backdated["exp"] = now() + 3000;10869 | ^~~~~~~10870../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]10871 552 | backdated["exp"] = now() + 3000;10872 | ^10873../tests/oidc-test.cc:555:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10874 555 | futureIat["iat"] = now() + 1200;10875 | ^~~~~~~10876../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]10877 555 | futureIat["iat"] = now() + 1200;10878 | ^10879../tests/oidc-test.cc:556:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10880 556 | futureIat["exp"] = now() + 1500;10881 | ^~~~~~~10882../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]10883 556 | futureIat["exp"] = now() + 1500;10884 | ^10885../tests/oidc-test.cc:564:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10886 564 | later["exp"] = now() + validFor + 60;10887 | ^~~~~~~10888../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]10889 564 | later["exp"] = now() + validFor + 60;10890 | ^10891../tests/oidc-test.cc:576:18: error: no header providing "nixgrpc::Auth" is directly included [misc-include-cleaner,-warnings-as-errors]10892 38 | nixgrpc::Auth registrationAuth;10893 | ^10894../tests/oidc-test.cc:579:15: error: no header providing "grpc::SslServerCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]10895 10 | grpc::SslServerCredentialsOptions tls;10896 | ^10897../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]10898 10 | tls.client_certificate_request = GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY;10899 | ^10900../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]10901 582 | tls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"), nix::readFile(dir + "/server.crt")});10902 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10903 | .private_key= .cert_chain=10904/nix/store/g10pynzgwpqnf66hi8ynryisg6l616h8-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here10905 48 | struct PemKeyCertPair {10906 | ^10907../tests/oidc-test.cc:586:55: error: no header providing "grpc::SslServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10908 586 | builder.AddListeningPort("127.0.0.1:0", grpc::SslServerCredentials(tls), &port);10909 | ^10910../tests/oidc-test.cc:587:55: error: no header providing "grpc::InsecureServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10911 587 | builder.AddListeningPort("127.0.0.1:0", grpc::InsecureServerCredentials(), &insecurePort);10912 | ^10913../tests/oidc-test.cc:595:15: error: no header providing "grpc::SslCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]10914 10 | grpc::SslCredentialsOptions roots;10915 | ^10916../tests/oidc-test.cc:600:87: error: no header providing "grpc::SslCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10917 600 | auto channel = grpc::CreateChannel("localhost:" + std::to_string(port), grpc::SslCredentials(workerTls));10918 | ^10919../tests/oidc-test.cc:601:34: error: no header providing "nix::remote::ReverseSession" is directly included [misc-include-cleaner,-warnings-as-errors]10920 601 | auto stub = nix::remote::ReverseSession::NewStub(channel);10921 | ^10922../tests/oidc-test.cc:609:26: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]10923 609 | nix::remote::ReverseWorkerMsg registration;10924 | ^10925../tests/oidc-test.cc:613:26: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]10926 613 | nix::remote::ReverseFarmMsg ack;10927 | ^10928../tests/oidc-test.cc:618:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]10929 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10930 | ^10931 619 | {10932 | -> std::pair<std::unique_ptr<grpc::ClientReaderWriter<nix::remote::ReverseWorkerMsg, nix::remote::ReverseFarmMsg>>, unsigned long>10933../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]10934 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10935 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10936../tests/oidc-test.cc:618:70: note: the first parameter in the range is 'credential'10937 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10938 | ^~~~~~~~~~10939../tests/oidc-test.cc:618:101: note: the last parameter in the range is 'claim'10940 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)10941 | ^~~~~10942../tests/oidc-test.cc:630:13: error: variable 'accepted' of type 'bool' can be declared 'const' [misc-const-correctness,-warnings-as-errors]10943 630 | bool accepted = stream->Read(&ack);10944 | ^10945 | const 10946../tests/oidc-test.cc:632:25: error: no header providing "std::pair" is directly included [misc-include-cleaner,-warnings-as-errors]10947 16 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};10948 | ^10949../tests/oidc-test.cc:632:35: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]10950 632 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};10951 | ^10952../tests/oidc-test.cc:659:88: error: no header providing "grpc::InsecureChannelCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]10953 659 | grpc::CreateChannel("127.0.0.1:" + std::to_string(insecurePort), grpc::InsecureChannelCredentials()));10954 | ^10955../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]10956 749 | extra.set_stream_id(99);10957 | ^10958../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]10959 760 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));10960 | ^10961../tests/oidc-test.cc:766:44: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]10962 41 | auto capability = nixgrpc::ReverseCapability::mint(10963 | ^10964../tests/oidc-test.cc:768:30: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]10965 768 | nixgrpc::Caller{.name = "read-client", .role = Role::readOnly,10966 | ^10967../tests/oidc-test.cc:770:30: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]10968 770 | nix::remote::ReverseOpen start;10969 | ^10970../tests/oidc-test.cc:772:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10971 772 | if (capability) start.set_capability(*capability);10972 | ^ 10973 | {10974../tests/oidc-test.cc:773:100: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]10975 773 | check(capability && transport.responses.open(1) && transport.outgoing.open(1, std::move(start)) &&10976 | ^10977../tests/oidc-test.cc:788:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]10978 788 | if (secondCapability) secondStart.set_capability(*secondCapability);10979 | ^ 10980 | {10981../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]10982 828 | firstCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10983 | ^10984../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]10985 840 | secondCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10986 | ^10987../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]10988 853 | otherCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10989 | ^10990../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]10991 868 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));10992 | ^10993../tests/oidc-test.cc:870:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]10994 870 | soon["exp"] = now() + 2;10995 | ^~~~~~~10996../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]10997 880 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));10998 | ^10999../tests/oidc-test.cc:882:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11000 882 | soon["exp"] = now() + 2;11001 | ^~~~~~~11002../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]11003 900 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11004 | ^11005../tests/oidc-test.cc:924:14: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors]11006 12 | std::optional<Verifier> noClientOidc;11007 | ^11008../tests/oidc-test.cc:931:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11009 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11010 | ^11011 | -> bool11012../tests/oidc-test.cc:931:80: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11013 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11014 | ^11015../tests/oidc-test.cc:934:18: error: no header providing "nixgrpc::IdleTracker" is directly included [misc-include-cleaner,-warnings-as-errors]11016 40 | nixgrpc::IdleTracker idle;11017 | ^11018../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]11019 941 | controlTls.client_certificate_request = GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;11020 | ^11021../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]11022 942 | controlTls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"),11023 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11024 | .private_key=11025 943 | nix::readFile(dir + "/server.crt")});11026 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11027 | .cert_chain=11028/nix/store/g10pynzgwpqnf66hi8ynryisg6l616h8-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here11029 48 | struct PemKeyCertPair {11030 | ^11031../tests/oidc-test.cc:952:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11032 952 | if (!controlServer) return check.result();11033 | ^ 11034 | {11035../tests/oidc-test.cc:958:41: error: no header providing "nix::remote::Scheduler" is directly included [misc-include-cleaner,-warnings-as-errors]11036 958 | auto controlStub = nix::remote::Scheduler::NewStub(controlChannel);11037 | ^11038../tests/oidc-test.cc:963:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11039 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11040 | ^11041 | -> std::unique_ptr< ::grpc::ClientReaderWriter< ::nix::remote::WorkerMsgs, ::nix::remote::SchedCmds>>11042../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]11043 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11044 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11045../tests/oidc-test.cc:963:73: note: the first parameter in the range is 'claim'11046 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11047 | ^~~~~11048../tests/oidc-test.cc:963:97: note: the last parameter in the range is 'addr'11049 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11050 | ^~~~11051../tests/oidc-test.cc:965:26: error: no header providing "nix::remote::WorkerMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11052 965 | nix::remote::WorkerMsgs messages;11053 | ^11054../tests/oidc-test.cc:988:26: error: no header providing "nix::remote::SchedCmds" is directly included [misc-include-cleaner,-warnings-as-errors]11055 988 | nix::remote::SchedCmds commands;11056 | ^11057../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]11058 1033 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11059 | ^11060../tests/oidc-test.cc:1036:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11061 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11062 | ^11063 | -> bool11064../tests/oidc-test.cc:1036:74: error: no header providing "nix::remote::SchedMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11065 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11066 | ^11067../tests/oidc-test.cc:1036:104: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11068 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11069 | ^11070 | -> void11071../tests/oidc-test.cc:1037:26: error: no header providing "nix::remote::ClientMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11072 1037 | nix::remote::ClientMsgs want;11073 | ^11074../tests/oidc-test.cc:1046:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11075 1046 | auto const id = commands.msgs(0).expect().assign_id();11076 | ^11077../tests/oidc-test.cc:1074:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11078 1074 | auto reauth = [](std::string tokenValue) {11079 | ^11080 | -> nix::remote::WorkerMsgs11081../tests/oidc-test.cc:1076:67: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11082 1076 | messages.add_msgs()->mutable_reauth()->set_token(std::move(tokenValue));11083 | ^11084../tests/oidc-test.cc:1080:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11085 1080 | auto memberCount = [&] { return dispatcher.podConnected(workerId) ? size_t{1} : size_t{0}; };11086 | ^11087 | -> size_t11088../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]11089 1092 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11090 | ^11091../tests/oidc-test.cc:1094:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11092 1094 | soon["exp"] = now() + 2;11093 | ^~~~~~~11094../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]11095 1109 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11096 | ^11097../tests/oidc-test.cc:1111:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11098 1111 | soon["exp"] = now() + 2;11099 | ^~~~~~~11100../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]11101 1116 | std::this_thread::sleep_for(std::chrono::milliseconds(20));11102 | ^11103../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]11104 1128 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11105 | ^11106../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]11107 1132 | dataCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11108 | ^11109../tests/oidc-test.cc:1147:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11110 1147 | auto client = dispatcher.connectClient([&](const nix::remote::SchedMsg &msg) {11111 | ^11112 | -> bool11113../tests/oidc-test.cc:1153:16: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11114 1153 | }, [] {});11115 | ^11116 | -> void11117../tests/oidc-test.cc:1165:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11118 1165 | auto const id = commands.msgs(0).expect().assign_id();11119 | ^11120../tests/oidc-test.cc:1177:17: error: variable 'routeReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11121 1177 | nix::remote::StoreInfoRequest routeReq;11122 | ^11123 | const 11124../tests/oidc-test.cc:1182:40: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11125 1182 | std::jthread responder([&] {11126 | ^11127 | -> void11128../tests/oidc-test.cc:1189:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11129 1189 | if (!selected) return;11130 | ^ 11131 | {11132../tests/oidc-test.cc:1194:55: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11133 1194 | if (requestFrame.half_close()) break;11134 | ^ 11135 | {11136../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]11137 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11138 | ^11139../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]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:70: error: statement should be inside braces [readability-braces-around-statements,-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 | {11146../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]11147 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11148 | ^11149../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]11150 1217 | relayCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11151 | ^11152../tests/oidc-test.cc:1224:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11153 1224 | std::jthread buildResponder([&] {11154 | ^11155 | -> void11156../tests/oidc-test.cc:1226:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11157 1226 | if (!dataStream->Read(&frame)) return;11158 | ^ 11159 | {11160../tests/oidc-test.cc:1228:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11161 1228 | if (!selected) return;11162 | ^ 11163 | {11164../tests/oidc-test.cc:1234:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11165 1234 | if (frame.half_close()) break;11166 | ^ 11167 | {11168../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]11169 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11170 | ^11171../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]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:70: error: statement should be inside braces [readability-braces-around-statements,-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 | {11178../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]11179 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11180 | ^11181../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]11182 1257 | buildCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11183 | ^11184../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]11185 1275 | replacementCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11186 | ^11187../tests/oidc-test.cc:1297:13: error: variable 'cancelledReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11188 1297 | nix::remote::StoreInfoRequest cancelledReq;11189 | ^11190 | const 11191../tests/oidc-test.cc:1311:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11192 1311 | if (!status.ok()) std::cerr << "control Finish: " << status.error_message() << "\n";11193 | ^ 11194 | {11195>>> /nix/store/qg4sgs5my0jin1z9frysyc4qr3pw5gm9-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/main.cc11196../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]11197 12 | #include <chrono>11198 | 11199 13 | #include <chrono>11200 | ^~~~~~~~~~~~~~~~~11201../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]11202 90 | std::chrono::system_clock::time_point credentialExpiresAt{};11203 | ^~11204../src/daemon/main.cc:354:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11205 354 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) {11206 | ^11207 | -> bool11208../src/daemon/main.cc:367:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]11209 15 | const std::function<bool()> & cancelled,11210 | ^11211../src/daemon/main.cc:378:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11212 378 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status;11213 | ^ 11214 | {11215../src/daemon/main.cc:382:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11216 382 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"};11217 | ^ 11218 | {11219../src/daemon/main.cc:383:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11220 383 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"};11221 | ^ 11222 | {11223../src/daemon/main.cc:384:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11224 384 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"};11225 | ^ 11226 | {11227../src/daemon/main.cc:387:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11228 387 | nix::StorePath drvPath(request.drv_path());11229 | ^11230 | const 11231../src/daemon/main.cc:391:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11232 391 | auto const sendLog = [&](nixgrpc::BuildEvent event) {11233 | ^11234 | -> void11235../src/daemon/main.cc:392:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11236 392 | if (!emit(nixgrpc::toChunk<nix::remote::BuildDerivationChunk>(std::move(event))))11237 | ^11238 | {11239 393 | throw nixgrpc::CancelledWait("reverse build response closed");11240 | 11241../src/daemon/main.cc:401:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11242 401 | auto const retireUnacknowledged = [&] {11243 | ^11244 | -> void11245../src/daemon/main.cc:402:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11246 402 | if (afterFinish) std::exchange(afterFinish, nullptr)();11247 | ^ 11248 | {11249../src/daemon/main.cc:414:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11250 414 | if (status.ok() && !emit(chunk))11251 | ^11252 | {11253 415 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"};11254 | 11255../src/daemon/main.cc:416:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11256 416 | if (!status.ok()) retireUnacknowledged();11257 | ^ 11258 | {11259../src/daemon/main.cc:421:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11260 421 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call,11261 | ^11262../src/daemon/main.cc:424:24: note: nesting level increased to 111263 424 | return guarded([&] -> grpc::Status {11264 | ^11265../src/daemon/main.cc:425:13: note: +2, including nesting penalty of 1, nesting level increased to 211266 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11267 | ^11268../src/daemon/main.cc:425:32: note: +111269 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11270 | ^11271../src/daemon/main.cc:428:13: note: +2, including nesting penalty of 1, nesting level increased to 211272 428 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs",11273 | ^11274../src/daemon/main.cc:430:31: note: nesting level increased to 211275 430 | auto const live = [&] {11276 | ^11277../src/daemon/main.cc:432:21: note: +111278 432 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId);11279 | ^11280../src/daemon/main.cc:434:13: note: +2, including nesting penalty of 1, nesting level increased to 211281 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11282 | ^11283../src/daemon/main.cc:436:13: note: +2, including nesting penalty of 1, nesting level increased to 211284 436 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first)11285 | ^11286../src/daemon/main.cc:437:17: note: +111287 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11288 | ^11289../src/daemon/main.cc:438:48: note: +2, including nesting penalty of 1, nesting level increased to 211290 438 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair;11291 | ^11292../src/daemon/main.cc:439:55: note: +2, including nesting penalty of 1, nesting level increased to 211293 439 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs;11294 | ^11295../src/daemon/main.cc:458:17: note: nesting level increased to 211296 458 | CheckedSource(nix::Source & inner, std::function<bool()> valid)11297 | ^11298../src/daemon/main.cc:464:17: note: nesting level increased to 211299 464 | auto read(char * data, size_t length) -> size_t override {11300 | ^11301../src/daemon/main.cc:465:21: note: +3, including nesting penalty of 2, nesting level increased to 311302 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11303 | ^11304../src/daemon/main.cc:471:21: note: +3, including nesting penalty of 2, nesting level increased to 311305 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11306 | ^11307../src/daemon/main.cc:449:19: note: nesting level increased to 211308 449 | class CheckedSource : public nix::Source {11309 | ^11310../src/daemon/main.cc:449:19: note: nesting level increased to 211311../src/daemon/main.cc:449:19: note: nesting level increased to 211312../src/daemon/main.cc:449:19: note: nesting level increased to 211313../src/daemon/main.cc:449:19: note: nesting level increased to 211314../src/daemon/main.cc:483:68: note: +2, including nesting penalty of 1, nesting level increased to 211315 483 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair,11316 | ^11317../src/daemon/main.cc:484:68: note: +2, including nesting penalty of 1, nesting level increased to 211318 484 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs,11319 | ^11320../src/daemon/main.cc:485:17: note: nesting level increased to 211321 485 | [&] { return !live(); }, imported,11322 | ^11323../src/daemon/main.cc:486:17: note: nesting level increased to 211324 486 | [&] {11325 | ^11326../src/daemon/main.cc:493:21: note: +3, including nesting penalty of 2, nesting level increased to 311327 493 | if (!call.pipe->endWithoutTrailingData() || !live())11328 | ^11329../src/daemon/main.cc:493:62: note: +111330 493 | if (!call.pipe->endWithoutTrailingData() || !live())11331 | ^11332../src/daemon/main.cc:497:56: note: nesting level increased to 211333 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11334 | ^11335../src/daemon/main.cc:498:13: note: +2, including nesting penalty of 1, nesting level increased to 211336 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11337 | ^11338../src/daemon/main.cc:425:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11339 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11340 | ^11341../src/daemon/main.cc:426:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11342 426 | call.delegated.drvPath, call.delegated.assignId))11343 | ^11344 | {11345 427 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};11346 | 11347../src/daemon/main.cc:429:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11348 429 | nixgrpc::Role::write); !status.ok()) return status;11349 | ^ 11350 | {11351../src/daemon/main.cc:430:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11352 430 | auto const live = [&] {11353 | ^11354 | -> bool11355../src/daemon/main.cc:434:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11356 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11357 | ^ 11358 | {11359../src/daemon/main.cc:437:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11360 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11361 | ^ 11362 | {11363../src/daemon/main.cc:441:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11364 89 | nixgrpc::ZstdReaderSource<nixgrpc::ReverseUploadPipe, nix::remote::AddMultipleChunk> source(11365 | ^11366../src/daemon/main.cc:450:31: error: member 'inner' of type 'nix::Source &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11367 450 | nix::Source & inner;11368 | ^11369../src/daemon/main.cc:465:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11370 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11371 | ^ 11372 | {11373../src/daemon/main.cc:471:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11374 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11375 | ^ 11376 | {11377../src/daemon/main.cc:485:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11378 485 | [&] { return !live(); }, imported,11379 | ^11380 | -> bool11381../src/daemon/main.cc:486:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11382 486 | [&] {11383 | ^11384 | -> void11385../src/daemon/main.cc:493:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11386 493 | if (!call.pipe->endWithoutTrailingData() || !live())11387 | ^11388 | {11389 494 | throw nix::Error("reverse upload incomplete or assignment changed");11390 | 11391../src/daemon/main.cc:497:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11392 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11393 | ^11394 | -> bool11395../src/daemon/main.cc:498:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11396 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11397 | ^ 11398 | {11399../src/daemon/main.cc:641:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11400 641 | if (beforeApply) beforeApply();11401 | ^ 11402 | {11403../src/daemon/main.cc:650:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11404 650 | if (beforeApply) beforeApply();11405 | ^ 11406 | {11407../src/daemon/main.cc:652:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11408 652 | if (beforeApply) beforeApply();11409 | ^ 11410 | {11411../src/daemon/main.cc:716:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11412 716 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder)11413 | ^11414 | {11415 717 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"};11416 | 11417../src/daemon/main.cc:719:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11418 719 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"};11419 | ^ 11420 | {11421../src/daemon/main.cc:722:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors]11422 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk()11423 | ^11424../src/daemon/main.cc:723:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11425 723 | || drv.empty() || assignment == 0)11426 | ^11427 | {11428 724 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"};11429 | 11430../src/daemon/main.cc:726:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11431 726 | if (caller.kind != nixgrpc::Caller::Kind::named)11432 | ^11433 | {11434 727 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"};11435 | 11436../src/daemon/main.cc:729:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11437 729 | !status.ok()) return status;11438 | ^ 11439 | {11440../src/daemon/main.cc:731:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11441 731 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"};11442 | ^ 11443 | {11444../src/daemon/main.cc:732:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11445 732 | auto const assigned = [this, pod = *pod, drv, assignment] {11446 | ^11447 | -> bool11448../src/daemon/main.cc:736:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11449 736 | [&](uint64_t id) {11450 | ^11451 | -> Result11452../src/daemon/main.cc:736:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11453 736 | [&](uint64_t id) {11454 | ^11455../src/daemon/main.cc:738:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11456 738 | [this](std::string_view path, uint64_t assignId) {11457 | ^11458 | -> std::optional<std::string>11459../src/daemon/main.cc:741:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11460 741 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); },11461 | ^11462 | -> bool11463../src/daemon/main.cc:1011:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11464 1011 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"};11465 | ^ 11466 | {11467../src/daemon/main.cc:1108:37: error: implicit conversion 'std::string *' (aka 'basic_string<char> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11468 1108 | if (!missing.empty() && missingInput) {11469 | ^ 11470 | ( != nullptr)11471../src/daemon/main.cc:1167:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11472 1167 | auto BuildDerivation(11473 | ^11474../src/daemon/main.cc:1172:24: note: nesting level increased to 111475 1172 | return guarded([&] -> grpc::Status {11476 | ^11477../src/daemon/main.cc:1176:13: note: +2, including nesting penalty of 1, nesting level increased to 211478 1176 | if (request->protocol() != nixcompat::kBuildProtocolWire11479 | ^11480../src/daemon/main.cc:1177:17: note: +111481 1177 | || request->build_mode() > static_cast<uint32_t>(nix::bmCheck)) {11482 | ^11483../src/daemon/main.cc:1184:17: note: +2, including nesting penalty of 1, nesting level increased to 211484 1184 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt;11485 | ^11486../src/daemon/main.cc:1183:51: note: +111487 1183 | auto const selectedPod = reverseRelay && coord.dispatcher11488 | ^11489../src/daemon/main.cc:1185:13: note: +2, including nesting penalty of 1, nesting level increased to 211490 1185 | if (selectedPod) {11491 | ^11492../src/daemon/main.cc:1188:21: note: nesting level increased to 311493 1188 | [&](uint64_t id) {11494 | ^11495../src/daemon/main.cc:1190:29: note: nesting level increased to 411496 1190 | [this](std::string_view drv, uint64_t assignment) {11497 | ^11498../src/daemon/main.cc:1193:34: note: nesting level increased to 311499 1193 | }, *request, [&](std::string_view wire) {11500 | ^11501../src/daemon/main.cc:1195:25: note: +4, including nesting penalty of 3, nesting level increased to 411502 1195 | if (!chunk.ParseFromArray(wire.data(), static_cast<int>(wire.size()))11503 | ^11504../src/daemon/main.cc:1196:103: note: +111505 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11506 | ^11507../src/daemon/main.cc:1198:25: note: +4, including nesting penalty of 3, nesting level increased to 411508 1198 | if (!writer->Write(chunk)) return false;11509 | ^11510../src/daemon/main.cc:1199:25: note: +4, including nesting penalty of 3, nesting level increased to 411511 1199 | if (chunk.has_done()) receivedDone = true;11512 | ^11513../src/daemon/main.cc:1201:24: note: nesting level increased to 311514 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11515 | ^11516../src/daemon/main.cc:1204:24: note: nesting level increased to 311517 1204 | }, [&] { return receivedDone.load(); });11518 | ^11519../src/daemon/main.cc:1206:21: note: +3, including nesting penalty of 2, nesting level increased to 311520 1206 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status;11521 | ^11522../src/daemon/main.cc:1205:36: note: +111523 1205 | return status.ok() && !receivedDone.load()11524 | ^11525../src/daemon/main.cc:1212:13: note: +2, including nesting penalty of 1, nesting level increased to 211526 1212 | if (!coord.builder) {11527 | ^11528../src/daemon/main.cc:1217:38: note: nesting level increased to 211529 1217 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void {11530 | ^11531../src/daemon/main.cc:1231:13: note: +2, including nesting penalty of 1, nesting level increased to 211532 1231 | for (auto & [name, path] : staticOutputs(*localStore, drv)) {11533 | ^11534../src/daemon/main.cc:1239:13: note: +2, including nesting penalty of 1, nesting level increased to 211535 1239 | if (auto const status =11536 | ^11537../src/daemon/main.cc:1240:27: note: nesting level increased to 211538 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11539 | ^11540../src/daemon/main.cc:1243:17: note: +3, including nesting penalty of 2, nesting level increased to 311541 1243 | if (!missingInput.empty()) {11542 | ^11543../src/daemon/main.cc:1188:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11544 1188 | [&](uint64_t id) {11545 | ^11546 | -> Result11547../src/daemon/main.cc:1188:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11548 1188 | [&](uint64_t id) {11549 | ^11550../src/daemon/main.cc:1190:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11551 1190 | [this](std::string_view drv, uint64_t assignment) {11552 | ^11553 | -> std::optional<std::string>11554../src/daemon/main.cc:1193:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11555 1193 | }, *request, [&](std::string_view wire) {11556 | ^11557 | -> bool11558../src/daemon/main.cc:1196:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11559 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())11560 | ^11561 | {11562 1197 | return false;11563 | 11564../src/daemon/main.cc:1198:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11565 1198 | if (!writer->Write(chunk)) return false;11566 | ^ 11567 | {11568../src/daemon/main.cc:1199:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11569 1199 | if (chunk.has_done()) receivedDone = true;11570 | ^ 11571 | {11572../src/daemon/main.cc:1201:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11573 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),11574 | ^11575 1202 | pod = *selectedPod] {11576 | -> bool11577../src/daemon/main.cc:1204:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11578 1204 | }, [&] { return receivedDone.load(); });11579 | ^11580 | -> bool11581../src/daemon/main.cc:1240:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11582 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,11583 | ^11584 | -> bool11585../src/daemon/main.cc:1498:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11586 1498 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) {11587 | ^11588 | -> auto11589../src/daemon/main.cc:1501:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11590 1501 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) {11591 | ^11592 | -> auto11593../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11594 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result11595 | ^11596../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 111597 522 | if (!parsed) {11598 | ^11599../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 111600 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : "";11601 | ^11602../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 111603 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) {11604 | ^11605../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 211606 528 | if (provider.issuer != iss) {11607 | ^11608../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 211609 531 | if (!parsed->has_expires_at()) {11610 | ^11611../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 211612 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) {11613 | ^11614../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 311615 538 | if (!err) {11616 | ^11617../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 211618 542 | if (err) {11619 | ^11620../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 211621 547 | if (sub.empty() || sub.contains('\0')) {11622 | ^11623../src/daemon/oidc.hh:547:29: note: +111624 547 | if (sub.empty() || sub.contains('\0')) {11625 | ^11626../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 211627 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace");11628 | ^11629../src/daemon/oidc.hh:553:32: note: +111630 553 | namespaceClaim && namespaceClaim->is_string()) {11631 | ^11632../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 211633 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11634 | ^11635../src/daemon/oidc.hh:556:82: note: +111636 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11637 | ^11638../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 311639 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11640 | ^11641../src/daemon/oidc.hh:557:67: note: +111642 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11643 | ^11644../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 311645 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11646 | ^11647../src/daemon/oidc.hh:560:66: note: +111648 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11649 | ^11650../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 211651 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11652 | ^11653../src/daemon/oidc.hh:564:91: note: +111654 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11655 | ^11656../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 311657 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11658 | ^11659../src/daemon/oidc.hh:565:65: note: +111660 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11661 | ^11662../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 211663 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) {11664 | ^11665../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 311666 570 | if (aud->is_string()) {11667 | ^11668../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 311669 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11670 | ^11671../src/daemon/oidc.hh:572:64: note: +111672 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {11673 | ^11674../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 211675 577 | if (parsed->has_issued_at()) {11676 | ^11677../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 211678 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"};11679 | ^11680../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11681 553 | namespaceClaim && namespaceClaim->is_string()) {11682 | ^11683 | ( != nullptr)11684../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11685 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {11686 | ^11687 | ( != nullptr)11688../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11689 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {11690 | ^11691../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11692 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {11693 | ^11694../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11695 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11696 | ^11697../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11698 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {11699 | ^11700 | ( != nullptr)11701../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11702 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {11703 | ^11704../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]11705 45 | std::chrono::seconds reverseMaxTokenLifetime{600};11706 | ^11707../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11708 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)11709 | ^11710../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]11711 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||11712 | ^11713../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]11714 96 | result.push_back(static_cast<char>(size >> (i * 8)));11715 | ^11716../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]11717 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,11718 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11719../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'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:87: note: the last parameter in the range is 'workerId'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:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11726 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11727 | ^~~11728../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]11729 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);11730 | ^11731../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11732 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)11733 | ^11734../src/daemon/reverse-capability.hh:176:75: 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: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]11738 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||11739 | ^11740../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11741 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;11742 | ^ 11743 | {11744../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]11745 250 | unsigned char mac[EVP_MAX_MD_SIZE];11746 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11747../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11748 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),11749 | ~^11750 | (11751 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11752 | == nullptr)11753../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11754 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11755 | ^11756../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]11757 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||11758 | ^11759../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]11760 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);11761 | ^11762../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]11763 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11764 | ^11765../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning11766 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11767 | ^~~~~~~~~11768 | static_cast<const size_t>( )11769../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type11770 23 | static constexpr size_t maxFrameBytes = 64 * 1024;11771 | ^~11772 | static_cast<long>( )11773../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]11774 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11775 | ^11776../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning11777 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11778 | ^~~~~~~~~~~~~~~11779 | static_cast<const size_t>( )11780../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type11781 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;11782 | ^~~~~~~~11783 | static_cast<long>( )11784../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]11785 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool11786 | ^11787../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]11788 53 | auto data(uint64_t id, std::string_view bytes) -> bool11789 | ^11790../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]11791 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);11792 | ^11793../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]11794 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11795 | ^11796../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]11797 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool11798 | ^11799 | const &11800../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11801 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;11802 | ^ 11803 | {11804../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11805 81 | if (size > limit) return false;11806 | ^ 11807 | {11808../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11809 83 | cv.wait(lock, stop, [&] {11810 | ^11811 | -> bool11812../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]11813 84 | auto it = streams.find(id);11814 | ^11815../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]11816 87 | auto const it = streams.find(id);11817 | ^11818../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11819 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;11820 | ^ 11821 | {11822../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]11823 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }11824 | ^11825../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]11826 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }11827 | ^11828../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]11829 96 | auto acknowledge(uint64_t id) -> bool11830 | ^11831../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11832 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;11833 | ^ 11834 | {11835../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11836 105 | if (!enqueue(std::move(msg))) return false;11837 | ^ 11838 | {11839../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]11840 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool11841 | ^11842 | const &11843../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11844 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });11845 | ^11846 | -> bool11847../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]11848 145 | auto finished(uint64_t id) -> bool11849 | ^11850../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11851 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;11852 | ^ 11853 | {11854../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11855 150 | if (removed) cv.notify_all();11856 | ^ 11857 | {11858../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]11859 156 | void acknowledgementSent(uint64_t id)11860 | ^11861../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11862 159 | if (acknowledged.erase(id)) streams.erase(id);11863 | ^ 11864 | != 0u11865../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11866 159 | if (acknowledged.erase(id)) streams.erase(id);11867 | ^ 11868 | {11869../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]11870 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {11871 | ^11872../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]11873 208 | auto terminal(uint64_t id, bool abort) -> bool11874 | ^11875../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11876 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11877 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11878 | .status= .prepared=11879../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11880 41 | struct Result11881 | ^11882../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]11883 65 | Role minRole;11884 | ^11885../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11886 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};11887 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11888 | .status= .prepared=11889../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11890 41 | struct Result11891 | ^11892../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11893 85 | return {status, {}};11894 | ^~~~~~~~~~~~11895 | .status=.prepared=11896../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11897 41 | struct Result11898 | ^11899../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11900 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};11901 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11902 | .status= .prepared=11903../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11904 41 | struct Result11905 | ^11906../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11907 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11908 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11909 | .status= .prepared=11910../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11911 41 | struct Result11912 | ^11913../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11914 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};11915 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11916 | .status= .prepared=11917../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11918 41 | struct Result11919 | ^11920../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11921 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};11922 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11923 | .status= .prepared=11924../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11925 41 | struct Result11926 | ^11927../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11928 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};11929 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11930 | .status= .prepared=11931../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11932 41 | struct Result11933 | ^11934../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11935 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};11936 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11937 | .status= .prepared=11938../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11939 41 | struct Result11940 | ^11941../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11942 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11943 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11944 | .status= .prepared=11945 123 | std::string(drvPath), assignId}};11946 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11947../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11948 41 | struct Result11949 | ^11950../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]11951 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),11952 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11953 | .session= .open=11954 123 | std::string(drvPath), assignId}};11955 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11956 | .drvPath= .assignId=11957../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here11958 33 | struct Prepared11959 | ^11960../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11961 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11962 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11963 | .status= .prepared=11964../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11965 41 | struct Result11966 | ^11967../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11968 189 | return {status, {}};11969 | ^~~~~~~~~~~~11970 | .status=.prepared=11971../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11972 41 | struct Result11973 | ^11974../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11975 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};11976 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11977 | .status= .prepared=11978../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11979 41 | struct Result11980 | ^11981../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11982 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};11983 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11984 | .status= .prepared=11985../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11986 41 | struct Result11987 | ^11988../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11989 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};11990 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11991 | .status= .prepared=11992../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here11993 41 | struct Result11994 | ^11995../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]11996 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};11997 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11998 | .status= .prepared=11999../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12000 41 | struct Result12001 | ^12002../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12003 218 | return {status, {}};12004 | ^~~~~~~~~~~~12005 | .status=.prepared=12006../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12007 41 | struct Result12008 | ^12009../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12010 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};12011 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12012 | .status= .prepared=12013../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12014 41 | struct Result12015 | ^12016../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12017 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};12018 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12019 | .status= .prepared=12020../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12021 41 | struct Result12022 | ^12023../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]12024 233 | Auth &auth;12025 | ^12026../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]12027 234 | ReverseRegistry ®istry;12028 | ^12029../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12030 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional<Event>12031 | ^12032../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 112033 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12034 | ^12035../src/daemon/reverse-inbound.hh:45:79: note: +112036 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12037 | ^12038../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 212039 47 | rejection = closed ? "session closed" : "bad frame header";12040 | ^12041../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 112042 51 | if (frame.has_open())12043 | ^12044../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 212045 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12046 | ^12047../src/daemon/reverse-inbound.hh:53:30: note: +112048 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12049 | ^12050../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 312051 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams";12052 | ^12053../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212054 59 | if (!caller)12055 | ^12056../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 112057 69 | if (it == streams.end())12058 | ^12059../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212060 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()12061 | ^12062../src/daemon/reverse-inbound.hh:74:17: note: +112063 74 | && finishedIds.erase(id))12064 | ^12065../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112066 79 | if (frame.has_data())12067 | ^12068../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212069 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12070 | ^12071../src/daemon/reverse-inbound.hh:81:59: note: +112072 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12073 | ^12074../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 112075 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12076 | ^12077../src/daemon/reverse-inbound.hh:88:97: note: +112078 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12079 | ^12080../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112081 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12082 | ^12083../src/daemon/reverse-inbound.hh:93:72: note: +112084 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12085 | ^12086../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 212087 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; }12088 | ^12089../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]12090 50 | auto const id = frame.stream_id();12091 | ^12092../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]12093 68 | auto it = streams.find(id);12094 | ^12095../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12096 74 | && finishedIds.erase(id))12097 | ^ 12098 | ( != 0u)12099../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12100 74 | && finishedIds.erase(id))12101 | ^12102 | {12103 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};12104 | 12105../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]12106 109 | auto finished(uint64_t id) -> bool12107 | ^12108../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12109 111 | if (cancelledIds.erase(id)) return true;12110 | ^ 12111 | != 0u12112../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12113 111 | if (cancelledIds.erase(id)) return true;12114 | ^ 12115 | {12116../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12117 112 | if (!streams.erase(id)) return false;12118 | ~^ 12119 | == 0u12120../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12121 112 | if (!streams.erase(id)) return false;12122 | ^ 12123 | {12124../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]12125 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {12126 | ^12127../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]12128 82 | auto it = sessions.find(std::string(workerId));12129 | ^12130../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]12131 92 | auto it = sessions.find(handle->workerId);12132 | ^12133../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]12134 107 | auto it = sessions.find(handle->workerId);12135 | ^12136../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]12137 130 | for (auto & [id, session] : sessions) {12138 | ^12139../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12140 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select,12141 | ^12142../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 112143 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12144 | ^12145../src/daemon/reverse-relay.hh:49:21: note: +112146 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12147 | ^12148../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 112149 56 | if (!selection.status.ok()) return selection.status;12150 | ^12151../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 112152 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12153 | ^12154../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 112155 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12156 | ^12157../src/daemon/reverse-relay.hh:59:22: note: +112158 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12159 | ^12160../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 112161 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12162 | ^12163../src/daemon/reverse-relay.hh:60:27: note: +112164 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12165 | ^12166../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 112167 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12168 | ^12169../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 112170 64 | if (!selection.status.ok()) return selection.status;12171 | ^12172../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 112173 65 | if (!selection.prepared || selection.prepared->session != session)12174 | ^12175../src/daemon/reverse-relay.hh:65:33: note: +112176 65 | if (!selection.prepared || selection.prepared->session != session)12177 | ^12178../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 112179 67 | if (request.ByteSizeLong() > maxRequestBytes)12180 | ^12181../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 112182 70 | if (bytes.size() > maxRequestBytes)12183 | ^12184../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 112185 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12186 | ^12187../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112188 75 | if (!status.ok()) return status;12189 | ^12190../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 112191 81 | ~Release() {12192 | ^12193../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 212194 84 | if (!completed) (void) transport.outgoing.cancel(id);12195 | ^12196../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 112197 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12198 | ^12199../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 112200 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) {12201 | ^12202../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 212203 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12204 | ^12205../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 212206 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12207 | ^12208../src/daemon/reverse-relay.hh:100:44: note: +112209 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12210 | ^12211../src/daemon/reverse-relay.hh:100:62: note: +112212 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12213 | ^12214../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 212215 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12216 | ^12217../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112218 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12219 | ^12220../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 112221 111 | std::jthread monitor([&](std::stop_token stop) {12222 | ^12223../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 212224 113 | while (!stop.stop_requested()) {12225 | ^12226../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 312227 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)12228 | ^12229../src/daemon/reverse-relay.hh:115:22: note: +112230 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12231 | ^12232../src/daemon/reverse-relay.hh:115:60: note: +112233 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12234 | ^12235../src/daemon/reverse-relay.hh:115:80: note: +112236 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12237 | ^12238../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 312239 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12240 | ^12241../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 112242 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) {12243 | ^12244../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 212245 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12246 | ^12247../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 212248 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12249 | ^12250../src/daemon/reverse-relay.hh:127:44: note: +112251 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12252 | ^12253../src/daemon/reverse-relay.hh:127:82: note: +112254 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12255 | ^12256../src/daemon/reverse-relay.hh:127:102: note: +112257 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12258 | ^12259../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 312260 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12261 | ^12262../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 212263 130 | if (frame.has_finish()) {12264 | ^12265../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 312266 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12267 | ^12268../src/daemon/reverse-relay.hh:131:55: note: +112269 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12270 | ^12271../src/daemon/reverse-relay.hh:131:75: note: +112272 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12273 | ^12274../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 312275 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12276 | ^12277../src/daemon/reverse-relay.hh:133:38: note: +112278 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12279 | ^12280../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 312281 134 | if (resultReceived && resultReceived()) {12282 | ^12283../src/daemon/reverse-relay.hh:134:36: note: +112284 134 | if (resultReceived && resultReceived()) {12285 | ^12286../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 412287 135 | if (beforeAck) beforeAck();12288 | ^12289../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 412290 136 | if (!transport.outgoing.acknowledge(id))12291 | ^12292../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 212293 143 | while (true) {12294 | ^12295../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 312296 144 | if (!expected) {12297 | ^12298../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 412299 145 | if (pending.size() < 4) break;12300 | ^12301../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 412302 147 | for (unsigned i = 0; i != 4; ++i)12303 | ^12304../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 412305 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12306 | ^12307../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 312308 153 | if (pending.size() < *expected) break;12309 | ^12310../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 312311 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12312 | ^12313../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 212314 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12315 | ^12316../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 112317 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12318 | ^12319../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 112320 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12321 | ^12322../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 112323 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12324 | ^12325../src/daemon/reverse-relay.hh:163:47: note: +112326 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12327 | ^12328../src/daemon/reverse-relay.hh:163:67: note: +112329 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12330 | ^12331../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12332 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12333 | ^ 12334 | {12335../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12336 56 | if (!selection.status.ok()) return selection.status;12337 | ^ 12338 | {12339../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12340 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12341 | ^ 12342 | {12343../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12344 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12345 | ^ 12346 | {12347../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12348 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12349 | ^ 12350 | {12351../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]12352 61 | auto const id = session->transport->nextStreamId.fetch_add(1);12353 | ^12354../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12355 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12356 | ^ 12357 | {12358../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12359 64 | if (!selection.status.ok()) return selection.status;12360 | ^ 12361 | {12362../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12363 65 | if (!selection.prepared || selection.prepared->session != session)12364 | ^12365 | {12366 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};12367 | 12368../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12369 67 | if (request.ByteSizeLong() > maxRequestBytes)12370 | ^12371 | {12372 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12373 | 12374../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12375 70 | if (bytes.size() > maxRequestBytes)12376 | ^12377 | {12378 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12379 | 12380../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12381 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12382 | ^ 12383 | {12384../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12385 75 | if (!status.ok()) return status;12386 | ^ 12387 | {12388../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]12389 77 | struct Release {12390 | ^12391../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]12392 77 | struct Release {12393 | ^12394 78 | ReverseTransport & transport;12395 79 | uint64_t id;12396 | 12397 | {}12398../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]12399 78 | ReverseTransport & transport;12400 | ^12401../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12402 84 | if (!completed) (void) transport.outgoing.cancel(id);12403 | ^ 12404 | {12405../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12406 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12407 | ^ 12408 | {12409../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]12410 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12411 | ^12412../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]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:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12416 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12417 | ^ 12418 | {12419../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12420 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12421 | ^12422 | {12423 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};12424 | 12425../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12426 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12427 | ^12428 | {12429 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};12430 | 12431../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12432 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12433 | ^ 12434 | {12435../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12436 111 | std::jthread monitor([&](std::stop_token stop) {12437 | ^12438 | const 12439../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12440 111 | std::jthread monitor([&](std::stop_token stop) {12441 | ^12442 | -> auto12443../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]12444 111 | std::jthread monitor([&](std::stop_token stop) {12445 | ^12446 | const &12447../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]12448 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12449 | ^12450../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12451 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12452 | ^12453 | -> auto12454../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12455 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12456 | ^ 12457 | {12458../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12459 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12460 | ^12461 | {12462 128 | return {grpc::StatusCode::UNAVAILABLE,12463 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12464 | 12465../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12466 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12467 | ^12468 | {12469 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12470 | 12471../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12472 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12473 | ^ 12474 | {12475../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12476 135 | if (beforeAck) beforeAck();12477 | ^ 12478 | {12479../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12480 136 | if (!transport.outgoing.acknowledge(id))12481 | ^12482 | {12483 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};12484 | 12485../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12486 145 | if (pending.size() < 4) break;12487 | ^ 12488 | {12489../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12490 147 | for (unsigned i = 0; i != 4; ++i)12491 | ^12492 | {12493 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12494 | 12495../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]12496 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12497 | ^~~12498../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]12499 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);12500 | ^12501../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12502 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12503 | ^ 12504 | {12505../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12506 153 | if (pending.size() < *expected) break;12507 | ^ 12508 | {12509../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12510 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12511 | ^12512 | {12513 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};12514 | 12515../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12516 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12517 | ^ 12518 | {12519../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12520 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12521 | ^ 12522 | {12523../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12524 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12525 | ^ 12526 | {12527../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12528 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12529 | ^12530 | {12531 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12532 | 12533../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]12534 169 | ReverseGateway & gateway;12535 | ^12536../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]12537 170 | ReverseRegistry & registry;12538 | ^12539../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12540 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool12541 | ^12542../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 112543 52 | if (!event) { rejection = inbound.lastRejection(); return false; }12544 | ^12545../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 112546 54 | switch (event->kind) {12547 | ^12548../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 212549 56 | if (!event->caller) { rejection = "open without caller"; return false; }12550 | ^12551../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212552 59 | if (frame.open().method() == "UploadBuildInputs") {12553 | ^12554../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 312555 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12556 | ^12557../src/daemon/reverse-request.hh:61:30: note: +112558 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {12559 | ^12560../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 312561 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12562 | ^12563../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212564 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }12565 | ^12566../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 212567 77 | if (auto it = uploads.find(id); it != uploads.end())12568 | ^12569../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212570 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 412571 | ^12572../src/daemon/reverse-request.hh:82:17: note: +112573 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }12574 | ^12575../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 212576 84 | if (!pending.length && pending.wire.size() >= 4) {12577 | ^12578../src/daemon/reverse-request.hh:84:33: note: +112579 84 | if (!pending.length && pending.wire.size() >= 4) {12580 | ^12581../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 312582 86 | for (unsigned i = 0; i != 4; ++i)12583 | ^12584../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 312585 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }12586 | ^12587../src/daemon/reverse-request.hh:91:36: note: +112588 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;12589 | ^12590../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 212591 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12592 | ^12593../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 212594 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12595 | ^12596../src/daemon/reverse-request.hh:96:60: note: +112597 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {12598 | ^12599../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 212600 108 | if (auto it = uploads.find(id); it != uploads.end()) {12601 | ^12602../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 212603 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12604 | ^12605../src/daemon/reverse-request.hh:112:29: note: +112606 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12607 | ^12608../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 212609 114 | if (ready && ready->id == id) ready.reset();12610 | ^12611../src/daemon/reverse-request.hh:114:23: note: +112612 114 | if (ready && ready->id == id) ready.reset();12613 | ^12614../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]12615 48 | std::scoped_lock lock(mutex);12616 | ^12617 | const 12618../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]12619 53 | auto const id = event->streamId;12620 | ^12621../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12622 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {12623 | ^12624 | -> bool12625../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]12626 77 | if (auto it = uploads.find(id); it != uploads.end())12627 | ^12628../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12629 77 | if (auto it = uploads.find(id); it != uploads.end())12630 | ^12631 | {12632 78 | return it->second->feed(frame.data().data());12633 | 12634../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12635 86 | for (unsigned i = 0; i != 4; ++i)12636 | ^12637 | {12638 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12639 | 12640../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]12641 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12642 | ^~~12643../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]12644 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);12645 | ^12646../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]12647 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12648 | ^12649../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12650 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();12651 | ^ 12652 | {12653../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]12654 95 | auto it = requests.find(id);12655 | ^12656../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]12657 108 | if (auto it = uploads.find(id); it != uploads.end()) {12658 | ^12659../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12660 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();12661 | ^ 12662 | {12663../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12664 114 | if (ready && ready->id == id) ready.reset();12665 | ^ 12666 | {12667../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]12668 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }12669 | ^12670 | const 12671../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]12672 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }12673 | ^12674 | const 12675../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]12676 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }12677 | ^12678 | const 12679../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]12680 130 | std::scoped_lock lock(mutex);12681 | ^12682 | const 12683../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]12684 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12685 | ^12686../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12687 131 | for (auto & [id, pipe] : uploads) pipe->cancel();12688 | ^ 12689 | {12690../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]12691 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {12692 | ^12693../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]12694 142 | std::scoped_lock lock(mutex);12695 | ^12696 | const 12697../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]12698 148 | std::scoped_lock lock(mutex);12699 | ^12700 | const 12701../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]12702 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12703 | ^12704../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12705 149 | for (auto & [id, pipe] : uploads) pipe->cancel();12706 | ^ 12707 | {12708../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]12709 32 | [[nodiscard]] auto open(uint64_t id) -> bool12710 | ^12711../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]12712 51 | auto it = streams.find(frame.stream_id());12713 | ^12714../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12715 56 | if (!cancelled.contains(frame.stream_id())) return false;12716 | ^ 12717 | {12718../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12719 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;12720 | ^ 12721 | {12722../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]12723 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12724 | ^12725../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]12726 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool12727 | ^12728 | const &12729../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12730 104 | auto pending = [&] {12731 | ^12732 | -> std::_Deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg *>12733../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]12734 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12735 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~12736 | std::ranges::find_if queue12737../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12738 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });12739 | ^12740 | -> auto12741../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12742 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });12743 | ^12744 | -> bool12745../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]12746 111 | auto it = pending();12747 | ^12748../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]12749 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool12750 | ^12751../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12752 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);12753 | ^ 12754 | {12755../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]12756 168 | [[nodiscard]] auto finished(uint64_t id) -> bool12757 | ^12758../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]12759 171 | auto it = streams.find(id);12760 | ^12761../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12762 42 | if (context) {12763 | ^ 12764 | != nullptr12765../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]12766 54 | WorkerIdentity & identity;12767 | ^12768../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]12769 55 | ReverseRegistry & registry;12770 | ^12771../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]12772 56 | Auth & workerAuth;12773 | ^12774../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12775 66 | auto Register(12776 | ^12777../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112778 75 | if (!auth) {12779 | ^12780../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112781 79 | if (transports.size() != 1 ||12782 | ^12783../src/daemon/reverse-session.hh:79:36: note: +112784 79 | if (transports.size() != 1 ||12785 | ^12786../src/daemon/reverse-session.hh:80:94: note: +112787 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" &&12788 | ^12789../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 112790 90 | if (caller.kind != Caller::Kind::named) {12791 | ^12792../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112793 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) {12794 | ^12795../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 112796 100 | if (first == last || std::next(first) != last) {12797 | ^12798../src/daemon/reverse-session.hh:100:27: note: +112799 100 | if (first == last || std::next(first) != last) {12800 | ^12801../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112802 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12803 | ^12804../src/daemon/reverse-session.hh:105:40: note: +112805 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {12806 | ^12807../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 112808 111 | if (!stream->Read(&msg)) {12809 | ^12810../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 112811 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET12812 | ^12813../src/daemon/reverse-session.hh:115:13: note: +112814 115 | || !msg.credential().empty()) {12815 | ^12816../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 112817 118 | if (msg.protocol() != reverseProtocolVersion) {12818 | ^12819../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 112820 122 | if (!bound) {12821 | ^12822../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 112823 128 | if (!sessionKey) {12824 | ^12825../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 112826 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12827 | ^12828../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 112829 136 | if (!handle) {12830 | ^12831../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 112832 144 | ~Cleanup()12833 | ^12834../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112835 139 | struct Cleanup12836 | ^12837../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 112838../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 112839 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12840 | ^12841../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 212842 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12843 | ^12844../src/daemon/reverse-session.hh:160:43: note: +112845 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {12846 | ^12847../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 312848 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12849 | ^12850../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 212851 163 | if (!stop.stop_requested()) {12852 | ^12853../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 112854 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12855 | ^12856../src/daemon/reverse-session.hh:171:40: note: +112857 171 | if (!registry.current(*handle) || !stream->Write(ack)) {12858 | ^12859../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 112860 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12861 | ^12862../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 212863 179 | while (transport->outgoing.waitTake(frame, stop)) {12864 | ^12865../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 312866 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12867 | ^12868../src/daemon/reverse-session.hh:180:48: note: +112869 180 | if (!registry.current(*handle) || !stream->Write(frame)) {12870 | ^12871../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 312872 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12873 | ^12874../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 112875 187 | while (stream->Read(&msg)) {12876 | ^12877../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 212878 188 | if (!msg.credential().empty()) {12879 | ^12880../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 312881 191 | ? identity.renew(msg.credential(), bound->workerId)12882 | ^12883../src/daemon/reverse-session.hh:190:52: note: +112884 190 | && msg.worker_id().empty() && registry.current(*handle)12885 | ^12886../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 312887 193 | if (!renewed) {12888 | ^12889../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 212890 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12891 | ^12892../src/daemon/reverse-session.hh:205:44: note: +112893 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {12894 | ^12895../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]12896 104 | std::string_view value(first->second.data(), first->second.size());12897 | ^12898 | const 12899../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12900 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },12901 | ^12902 | -> void12903../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12904 139 | struct Cleanup12905 | ^12906../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]12907 139 | struct Cleanup12908 | ^12909../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]12910 141 | ReverseRegistry & registry;12911 | ^12912../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]12913 149 | } cleanup{registry, *handle, cancellation};12914 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12915 | .registry=.handle= .cancellation=12916../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here12917 139 | struct Cleanup12918 | ^12919../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]12920 156 | std::condition_variable_any cv;12921 | ^12922../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12923 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12924 | ^12925 | const 12926../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12927 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12928 | ^12929 | -> void12930../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]12931 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {12932 | ^12933 | const &12934../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12935 161 | cv.wait_until(lock, stop, deadline, [] { return false; });12936 | ^12937 | -> bool12938../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]12939 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12940 | ^12941 | const 12942../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12943 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12944 | ^12945 | -> void12946../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]12947 177 | std::jthread writer([&, cancellation](std::stop_token stop) {12948 | ^12949 | const &12950../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12951 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());12952 | ^ 12953 | {12954../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]12955 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12956 | ^12957../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]12958 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12959 | ^12960 | -> bool12961../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]12962 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {12963 | ^12964../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12965 33 | if (assigned && !assigned()) return false;12966 | ^ 12967 | {12968../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]12969 35 | std::scoped_lock lock(mutex);12970 | ^12971 | const 12972../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12973 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;12974 | ^ 12975 | {12976../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12977 42 | if (!ok) cancel();12978 | ^ 12979 | {12980../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]12981 49 | std::scoped_lock lock(mutex);12982 | ^12983 | const 12984../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12985 68 | if (closed) return false;12986 | ^ 12987 | {12988../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12989 79 | if (ended || !chunks.empty()) break;12990 | ^ 12991 | {12992../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]12993 80 | cv.wait_for(lock, std::chrono::milliseconds(25));12994 | ^12995../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12996 82 | if (chunks.empty()) return false;12997 | ^ 12998 | {12999../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]13000 92 | std::scoped_lock lock(mutex);13001 | ^13002 | const 13003../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]13004 103 | cv.wait_for(lock, std::chrono::milliseconds(25));13005 | ^13006../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13007 113 | if (!ended || closed || !chunks.empty()) return false;13008 | ^ 13009 | {13010../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]13011 120 | std::scoped_lock lock(mutex);13012 | ^13013 | const 13014../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]13015 129 | std::scoped_lock lock(mutex);13016 | ^13017 | const 13018../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]13019 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned,13020 | ^13021../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 113022 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes13023 | ^13024../src/daemon/reverse-upload-relay.hh:37:63: note: +113025 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13026 | ^13027../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 113028 40 | if (!selection.status.ok()) return selection.status;13029 | ^13030../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 113031 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13032 | ^13033../src/daemon/reverse-upload-relay.hh:41:65: note: +113034 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13035 | ^13036../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 113037 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13038 | ^13039../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 113040 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13041 | ^13042../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 113043 48 | if (!selection.status.ok()) return selection.status;13044 | ^13045../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 113046 49 | if (!selection.prepared || selection.prepared->session != session)13047 | ^13048../src/daemon/reverse-upload-relay.hh:49:33: note: +113049 49 | if (!selection.prepared || selection.prepared->session != session)13050 | ^13051../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 113052 53 | if (!delegated || !ReverseUpload::first(*delegated, first)13053 | ^13054../src/daemon/reverse-upload-relay.hh:55:13: note: +113055 55 | || selection.prepared->assignId != first.assign_id())13056 | ^13057../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 113058 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13059 | ^13060../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 113061 60 | if (!status.ok()) return status;13062 | ^13063../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 113064 65 | ~Release() {13065 | ^13066../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 213067 66 | if (!completed) (void) transport.outgoing.cancel(id);13068 | ^13069../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 113070 76 | std::jthread monitor([&](std::stop_token stop) {13071 | ^13072../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 213073 78 | while (!stop.stop_requested()) {13074 | ^13075../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 313076 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)13077 | ^13078../src/daemon/reverse-upload-relay.hh:80:21: note: +113079 80 | || !assigned()) {13080 | ^13081../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 313082 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13083 | ^13084../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 113085 90 | auto const live = [&] {13086 | ^13087../src/daemon/reverse-upload-relay.hh:91:98: note: +113088 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned();13089 | ^13090../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 113091 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool {13092 | ^13093../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 213094 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13095 | ^13096../src/daemon/reverse-upload-relay.hh:95:27: note: +113097 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13098 | ^13099../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 213100 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13101 | ^13102../src/daemon/reverse-upload-relay.hh:97:30: note: +113103 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13104 | ^13105../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 213106 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13107 | ^13108../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 213109 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13110 | ^13111../src/daemon/reverse-upload-relay.hh:100:25: note: +113112 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13113 | ^13114../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 213115 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13116 | ^13117../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 313118 102 | if (!live() || !transport.outgoing.waitData(id,13119 | ^13120../src/daemon/reverse-upload-relay.hh:102:29: note: +113121 102 | if (!live() || !transport.outgoing.waitData(id,13122 | ^13123../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 113124 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13125 | ^13126../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 113127 108 | while (read(next)) {13128 | ^13129../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 213130 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13131 | ^13132../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 213133 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13134 | ^13135../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 113136 113 | if (!live() || !transport.outgoing.halfClose(id))13137 | ^13138../src/daemon/reverse-upload-relay.hh:113:21: note: +113139 113 | if (!live() || !transport.outgoing.halfClose(id))13140 | ^13141../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 113142 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13143 | ^13144../src/daemon/reverse-upload-relay.hh:116:75: note: +113145 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13146 | ^13147../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113148 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13149 | ^13150../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 113151 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13152 | ^13153../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 113154 120 | if (!transport.responses.finished(id))13155 | ^13156../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]13157 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status13158 | ^13159 | const &13160../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13161 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13162 | ^13163 | {13164 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};13165 | 13166../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13167 40 | if (!selection.status.ok()) return selection.status;13168 | ^ 13169 | {13170../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13171 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13172 | ^13173 | {13174 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};13175 | 13176../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13177 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13178 | ^ 13179 | {13180../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]13181 45 | auto const id = session->transport->nextStreamId.fetch_add(1);13182 | ^13183../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13184 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13185 | ^ 13186 | {13187../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13188 48 | if (!selection.status.ok()) return selection.status;13189 | ^ 13190 | {13191../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13192 49 | if (!selection.prepared || selection.prepared->session != session)13193 | ^13194 | {13195 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};13196 | 13197../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13198 55 | || selection.prepared->assignId != first.assign_id())13199 | ^13200 | {13201 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};13202 | 13203../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13204 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13205 | ^ 13206 | {13207../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13208 60 | if (!status.ok()) return status;13209 | ^ 13210 | {13211../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]13212 61 | struct Release {13213 | ^13214../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]13215 61 | struct Release {13216 | ^13217 62 | ReverseTransport & transport;13218 63 | uint64_t id;13219 | 13220 | {}13221../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]13222 62 | ReverseTransport & transport;13223 | ^13224../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13225 66 | if (!completed) (void) transport.outgoing.cancel(id);13226 | ^ 13227 | {13228../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]13229 70 | } release{transport, id};13230 | ^~~~~~~~~~~~~~~13231 | .transport=.id=13232../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here13233 61 | struct Release {13234 | ^13235../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]13236 75 | std::condition_variable_any cv;13237 | ^13238../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]13239 76 | std::jthread monitor([&](std::stop_token stop) {13240 | ^13241 | const 13242../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]13243 76 | std::jthread monitor([&](std::stop_token stop) {13244 | ^13245 | -> void13246../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]13247 76 | std::jthread monitor([&](std::stop_token stop) {13248 | ^13249 | const &13250../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]13251 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13252 | ^13253../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]13254 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13255 | ^13256 | -> bool13257../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]13258 90 | auto const live = [&] {13259 | ^13260 | -> bool13261../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13262 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13263 | ^ 13264 | {13265../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13266 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13267 | ^ 13268 | {13269../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13270 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13271 | ^ 13272 | {13273../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]13274 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13275 | ^~~13276../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]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:103: error: 0xff 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:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13283 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13284 | ^ 13285 | {13286../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13287 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13288 | ^13289 | {13290 102 | if (!live() || !transport.outgoing.waitData(id,13291 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13292 | 13293../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13294 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13295 | ^ 13296 | {13297../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13298 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13299 | ^ 13300 | {13301../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13302 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13303 | ^ 13304 | {13305../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13306 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13307 | ^ 13308 | {13309../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13310 113 | if (!live() || !transport.outgoing.halfClose(id))13311 | ^13312 | {13313 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};13314 | 13315../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13316 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13317 | ^13318 | {13319 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};13320 | 13321../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13322 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13323 | ^ 13324 | {13325../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13326 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13327 | ^ 13328 | {13329../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13330 120 | if (!transport.responses.finished(id))13331 | ^13332 | {13333 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};13334 | 13335../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]13336 127 | ReverseGateway & gateway;13337 | ^13338../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]13339 128 | ReverseRegistry & registry;13340 | ^13341../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]13342 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13343 | ^13344../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning13345 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13346 | ^~~~~~~~~~~13347 | static_cast<const size_t>( )13348../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type13349 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13350 | ^~~~13351 | static_cast<long>( )13352../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13353 49 | if (failed || bytes.empty() || !consume) return fail();13354 | ^ 13355 | {13356../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]13357 53 | buffer.append(bytes.data(), count);13358 | ~~~~~~^~~~13359../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13360 57 | for (unsigned i = 0; i < 4; ++i)13361 | ^13362 | {13363 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13364 | 13365../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]13366 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13367 | ^~~13368../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]13369 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13370 | ^13371../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13372 59 | if (length == 0 || length > maxChunkBytes) return fail();13373 | ^ 13374 | {13375../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]13376 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))13377 | ^13378../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13379 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))13380 | ^13381 | {13382 66 | return fail();13383 | 13384../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]13385 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();13386 | ^13387../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13388 371 | auto const it = workerIds.find(std::string(addr));13389 | ^13390../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]13391 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience13392 | ^13393../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13394 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13395 | ^13396 | -> bool13397../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]13398 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {13399 | ^13400../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]13401 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13402 | ^13403../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]13404 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13405 | ^13406../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]13407 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13408 | ^13409../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]13410 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {13411 | ^13412../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]13413 44 | if (uid[i] != '-') {13414 | ^~~13415../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]13416 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13417 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~13418 | < || > && < || >13419../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]13420 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13421 | ^~~13422../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]13423 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13424 | ^~~13425../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]13426 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13427 | ^~~13428../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]13429 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {13430 | ^~~13431../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]13432 96 | auto const & id = *result.identity;13433 | ^13434../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13435 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime13436 | ^~~~~~~~~~~~13437../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13438 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {13439 | ^~~~~~~~~~~~13440../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13441 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;13442 | ^~~~~~~~~13443../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]13444 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};13445 | ^~~~~~~~~~~~13446../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]13447 327 | char extra;13448 | ^ 13449 | = 013450../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13451 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");13452 | ^ 13453 | {13454../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13455 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");13456 | ^ 13457 | {13458../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13459 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");13460 | ^ 13461 | {13462Errors encountered while running clang-tidy13463FAILED: [code=1] meson-internal__clang-tidy 13464/nix/store/aznm4kx8p4br84x9zdqb5spww7m4bknp-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always13465ninja: build stopped: subcommand failed.