nix-grpc-store-clang-tidy-0.2.2
checks.aarch64-darwin.clang-tidy
· build #789
· raw
1tribuchet: building on mac02
unpackPhase
2unpacking source archive /nix/store/kakc7wqns1hjbjrx32prm66f2kc8lsj2-source3source root is sourceconfigurePhase
4mesonConfigurePhase flags: --prefix=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain -Db_pch=false5The Meson build system6Version: 1.12.17Source dir: /private/var/tb/6/scratch/88fd9d11b83d940e/build/source8Build dir: /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build9Build type: native build10WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead11Project name: nix-grpc-store12Project version: 0.2.213C++ compiler for the host machine: clang++ (clang 22.1.8 "clang version 22.1.8")14C++ linker for the host machine: clang++ ld64 956.615Host machine cpu family: aarch6416Host machine cpu: aarch6417Found pkg-config: YES (/nix/store/8rqbivyzdx8xkj8k47b07f4089bz32pb-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.218Run-time dependency grpc++ found: YES 1.84.019Run-time dependency protobuf found: YES 36.2.020Run-time dependency libzstd found: YES 1.5.721Run-time dependency threads found: YES22Run-time dependency libcrypto found: YES 3.5.923Run-time dependency prometheus-cpp-core found: YES 1.3.024Run-time dependency prometheus-cpp-pull found: YES 1.3.025Run-time dependency absl_flat_hash_map found: YES 2026081726Run-time dependency absl_hash found: YES 2026081727Run-time dependency absl_synchronization found: YES 2026081728Compiler for C++ supports arguments -Werror=thread-safety: YES 29Run-time dependency nix-store found: YES 2.36.0pre20261025_d99b751630Run-time dependency nix-util found: YES 2.36.0pre20261025_d99b751631Run-time dependency jemalloc found: YES 5.4.0_032Run-time dependency libcurl found: YES 8.22.033Run-time dependency nlohmann_json found: YES 3.12.034Check usable header "jwt-cpp/traits/nlohmann-json/defaults.h" : YES 35Checking if "Store::addTempRoots" with dependencies nix-store, nix-util compiles: YES 36Program protoc found: YES (/nix/store/jxrris8n0dw7am1kzs3ygfqyd9l6s4l3-protobuf-36.2/bin/protoc)37Program grpc_cpp_plugin found: YES (/nix/store/hm4j3zqs3jvbg3gjgw33lc322yjb07f4-grpc-1.84.0/bin/grpc_cpp_plugin)38Run-time dependency dl found: YES39Program tests/farm-client-test.sh found: YES (/private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/farm-client-test.sh)40Program tests/oidc-test.sh found: YES (/private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/oidc-test.sh)41Program tests/reverse-gateway-test.sh found: YES (/private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-gateway-test.sh)42Build targets in project: 3643WARNING: Project specifies no minimum version but uses features which were added in versions:44 * 1.1: {'meson.options file'}4546nix-grpc-store 0.2.24748 User defined options49 auto_features: enabled50 b_pch : false51 bindir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/bin52 buildtype : plain53 includedir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/include54 infodir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/info55 libdir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/lib56 libexecdir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/libexec57 localedir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/locale58 mandir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/share/man59 prefix : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.260 sbindir : /nix/store/zjcvywrh9lafa2plihwrrpn2lj11ai7s-nix-grpc-store-clang-tidy-0.2.2/sbin61 wrap_mode : nodownload6263Found ninja-1.13.2 at /nix/store/ndfr0d2nizw172ppn99n505ikpsq9727-ninja-1.13.2/bin/ninja64mesonConfigurePhase: enabled\ parallel\ buildingbuildPhase
65[1/2] Generating nix_remote_proto with a custom command66[2/2] Generating eds_proto with a custom command67[0/1] /nix/store/sn59lgid7r01w49nyz81hcp1rjmpby3m-meson-1.12.1/bin/meson --internal clangtidy /private/var/tb/6/scratch/88fd9d11b83d940e/build/source /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build --color always68>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-responses-test.cc69../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]70 23 | static constexpr size_t maxFrameBytes = 64 * 1024;71 | ^72../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning73 23 | static constexpr size_t maxFrameBytes = 64 * 1024;74 | ^~~~~~~~~75 | static_cast<const size_t>( )76../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type77 23 | static constexpr size_t maxFrameBytes = 64 * 1024;78 | ^~79 | static_cast<long>( )80../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]81 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;82 | ^83../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning84 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;85 | ^~~~~~~~~~~~~~~86 | static_cast<const size_t>( )87../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type88 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;89 | ^~~~~~~~90 | static_cast<long>( )91../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]92 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool93 | ^94../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]95 53 | auto data(uint64_t id, std::string_view bytes) -> bool96 | ^97../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]98 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);99 | ^100../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]101 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool102 | ^103../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]104 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool105 | ^106 | const &107../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]108 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;109 | ^ 110 | {111../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]112 81 | if (size > limit) return false;113 | ^ 114 | {115../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]116 83 | cv.wait(lock, stop, [&] {117 | ^118 | -> bool119../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]120 84 | auto it = streams.find(id);121 | ^122../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]123 87 | auto const it = streams.find(id);124 | ^125../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]126 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;127 | ^ 128 | {129../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]130 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }131 | ^132../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]133 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }134 | ^135../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]136 96 | auto acknowledge(uint64_t id) -> bool137 | ^138../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]139 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;140 | ^ 141 | {142../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]143 105 | if (!enqueue(std::move(msg))) return false;144 | ^ 145 | {146../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]147 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool148 | ^149 | const &150../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]151 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });152 | ^153 | -> bool154../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]155 145 | auto finished(uint64_t id) -> bool156 | ^157../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]158 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;159 | ^ 160 | {161../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]162 150 | if (removed) cv.notify_all();163 | ^ 164 | {165../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]166 156 | void acknowledgementSent(uint64_t id)167 | ^168../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]169 159 | if (acknowledged.erase(id)) streams.erase(id);170 | ^ 171 | != 0u172../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]173 159 | if (acknowledged.erase(id)) streams.erase(id);174 | ^ 175 | {176../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]177 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {178 | ^179../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]180 208 | auto terminal(uint64_t id, bool abort) -> bool181 | ^182../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]183 32 | [[nodiscard]] auto open(uint64_t id) -> bool184 | ^185../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]186 51 | auto it = streams.find(frame.stream_id());187 | ^188../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]189 56 | if (!cancelled.contains(frame.stream_id())) return false;190 | ^ 191 | {192../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]193 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;194 | ^ 195 | {196../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]197 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool198 | ^199../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]200 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool201 | ^202 | const &203../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]204 104 | auto pending = [&] {205 | ^206 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>207../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]208 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });209 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~210 | std::ranges::find_if queue211../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]212 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });213 | ^214 | -> auto215../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]216 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });217 | ^218 | -> bool219../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]220 111 | auto it = pending();221 | ^222../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]223 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool224 | ^225../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]226 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);227 | ^ 228 | {229../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]230 168 | [[nodiscard]] auto finished(uint64_t id) -> bool231 | ^232../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]233 171 | auto it = streams.find(id);234 | ^235../tests/reverse-responses-test.cc:8:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]236 8 | int main()237 | ^238/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here239 67 | throw bad_array_new_length();240 | ^241/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here242 101 | std::__throw_bad_array_new_length();243 | ^244/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:259:12: note: frame #2: function 'allocate' calls function 'allocate' here245 259 | return __a.allocate(__n);246 | ^247/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocation_guard.h:55:16: note: frame #3: function '__allocation_guard<std::allocator<std::mutex>>' calls function 'allocate' here248 55 | __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important249 | ^250/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/shared_ptr.h:735:46: note: frame #4: function 'allocate_shared<std::mutex, std::allocator<std::mutex>, 0>' calls function '__allocation_guard<std::allocator<std::mutex>>' here251 735 | __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);252 | ^253/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/shared_ptr.h:744:10: note: frame #5: function 'make_shared<std::mutex, 0>' calls function 'allocate_shared<std::mutex, std::allocator<std::mutex>, 0>' here254 744 | return std::allocate_shared<_Tp>(allocator<__remove_cv_t<_Tp> >(), std::forward<_Args>(__args)...);255 | ^256/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/condition_variable:222:66: note: frame #6: function 'condition_variable_any' calls function 'make_shared<std::mutex, 0>' here257 222 | inline condition_variable_any::condition_variable_any() : __mut_(make_shared<mutex>()) {}258 | ^259../src/daemon/reverse-responses.hh:25:7: note: frame #7: function 'ReverseResponses' calls function 'condition_variable_any' here260 25 | class ReverseResponses261 | ^262../tests/reverse-responses-test.cc:10:31: note: frame #8: function 'main' calls function 'ReverseResponses' here263 10 | nixgrpc::ReverseResponses replies;264 | ^265../tests/reverse-responses-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]266 8 | int main()267 | ~~~ ^ 268 | auto -> int269../tests/reverse-responses-test.cc:13:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]270 6 | #include "reverse-responses.hh"271 7 | 272 8 | int main()273 9 | {274 10 | nixgrpc::ReverseResponses replies;275 11 | assert(!replies.open(0));276 12 | assert(replies.open(1) && !replies.open(1));277 13 | nix::remote::ReverseWorkerMsg response;278 | ^279../tests/reverse-responses-test.cc:23:60: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]280 6 | response.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x'));281 | ^282../tests/reverse-responses-test.cc:27:53: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]283 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));284 | ^285../tests/reverse-responses-test.cc:27:69: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]286 2 | response.mutable_finish()->set_code(static_cast<uint32_t>(grpc::StatusCode::OK));287 | ^288../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]289 40 | response.mutable_finish()->set_code(123);290 | ^291../tests/reverse-responses-test.cc:63:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]292 2 | size_t queued = 0;293 | ^294../tests/reverse-responses-test.cc:77:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]295 77 | std::jthread waiter([&] {296 | ^297 | -> void298../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]299 79 | received = replies.waitTake(6, isolated, stop.get_token())300 | ^301../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]302 80 | && isolated.stream_id() == 6 && isolated.data().data() == "only six";303 | ^304../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]305 82 | response.set_stream_id(5);306 | ^307../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]308 85 | response.set_stream_id(6);309 | ^310>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-upload-test.cc311../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]312 553 | namespaceClaim && namespaceClaim->is_string()) {313 | ^314 | ( != nullptr)315../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]316 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {317 | ^318 | ( != nullptr)319../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]320 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {321 | ^322../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]323 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {324 | ^325../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]326 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {327 | ^328../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]329 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {330 | ^331 | ( != nullptr)332../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]333 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {334 | ^335../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]336 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)337 | ^338../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]339 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||340 | ^341../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]342 96 | result.push_back(static_cast<char>(size >> (i * 8)));343 | ^344../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]345 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,346 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~347../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'348 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,349 | ^~~~~350../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'351 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,352 | ^~~~~~~~353../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]354 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);355 | ^~~356../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]357 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);358 | ^359../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]360 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)361 | ^362../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]363 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)364 | ^365../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]366 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||367 | ^368../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]369 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;370 | ^ 371 | {372../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]373 250 | unsigned char mac[EVP_MAX_MD_SIZE];374 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~375../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]376 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),377 | ~^378 | (379 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||380 | == nullptr)381../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]382 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||383 | ^384../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]385 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||386 | ^387../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]388 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);389 | ^390../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]391 23 | static constexpr size_t maxFrameBytes = 64 * 1024;392 | ^393../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning394 23 | static constexpr size_t maxFrameBytes = 64 * 1024;395 | ^~~~~~~~~396 | static_cast<const size_t>( )397../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type398 23 | static constexpr size_t maxFrameBytes = 64 * 1024;399 | ^~400 | static_cast<long>( )401../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]402 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;403 | ^404../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning405 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;406 | ^~~~~~~~~~~~~~~407 | static_cast<const size_t>( )408../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type409 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;410 | ^~~~~~~~411 | static_cast<long>( )412../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]413 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool414 | ^415../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]416 53 | auto data(uint64_t id, std::string_view bytes) -> bool417 | ^418../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]419 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);420 | ^421../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]422 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool423 | ^424../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]425 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool426 | ^427 | const &428../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]429 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;430 | ^ 431 | {432../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]433 81 | if (size > limit) return false;434 | ^ 435 | {436../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]437 83 | cv.wait(lock, stop, [&] {438 | ^439 | -> bool440../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]441 84 | auto it = streams.find(id);442 | ^443../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]444 87 | auto const it = streams.find(id);445 | ^446../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]447 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;448 | ^ 449 | {450../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]451 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }452 | ^453../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]454 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }455 | ^456../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]457 96 | auto acknowledge(uint64_t id) -> bool458 | ^459../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]460 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;461 | ^ 462 | {463../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]464 105 | if (!enqueue(std::move(msg))) return false;465 | ^ 466 | {467../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]468 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool469 | ^470 | const &471../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]472 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });473 | ^474 | -> bool475../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]476 145 | auto finished(uint64_t id) -> bool477 | ^478../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]479 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;480 | ^ 481 | {482../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]483 150 | if (removed) cv.notify_all();484 | ^ 485 | {486../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]487 156 | void acknowledgementSent(uint64_t id)488 | ^489../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]490 159 | if (acknowledged.erase(id)) streams.erase(id);491 | ^ 492 | != 0u493../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]494 159 | if (acknowledged.erase(id)) streams.erase(id);495 | ^ 496 | {497../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]498 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {499 | ^500../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]501 208 | auto terminal(uint64_t id, bool abort) -> bool502 | ^503../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]504 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {505 | ^506../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]507 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {508 | ^509 | -> bool510../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]511 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {512 | ^513../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]514 33 | if (assigned && !assigned()) return false;515 | ^ 516 | {517../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]518 35 | std::scoped_lock lock(mutex);519 | ^520 | const 521../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]522 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;523 | ^ 524 | {525../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]526 42 | if (!ok) cancel();527 | ^ 528 | {529../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]530 49 | std::scoped_lock lock(mutex);531 | ^532 | const 533../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]534 68 | if (closed) return false;535 | ^ 536 | {537../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]538 79 | if (ended || !chunks.empty()) break;539 | ^ 540 | {541../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]542 80 | cv.wait_for(lock, std::chrono::milliseconds(25));543 | ^544../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]545 82 | if (chunks.empty()) return false;546 | ^ 547 | {548../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]549 92 | std::scoped_lock lock(mutex);550 | ^551 | const 552../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]553 103 | cv.wait_for(lock, std::chrono::milliseconds(25));554 | ^555../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]556 113 | if (!ended || closed || !chunks.empty()) return false;557 | ^ 558 | {559../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]560 120 | std::scoped_lock lock(mutex);561 | ^562 | const 563../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]564 129 | std::scoped_lock lock(mutex);565 | ^566 | const 567../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]568 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;569 | ^570../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning571 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;572 | ^~~~~~~~~~~573 | static_cast<const size_t>( )574../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type575 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;576 | ^~~~577 | static_cast<long>( )578../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]579 49 | if (failed || bytes.empty() || !consume) return fail();580 | ^ 581 | {582../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]583 53 | buffer.append(bytes.data(), count);584 | ~~~~~~^~~~585../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]586 57 | for (unsigned i = 0; i < 4; ++i)587 | ^588 | {589 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);590 | 591../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]592 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);593 | ^~~594../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]595 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);596 | ^597../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]598 59 | if (length == 0 || length > maxChunkBytes) return fail();599 | ^ 600 | {601../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]602 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))603 | ^604../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]605 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))606 | ^607 | {608 66 | return fail();609 | 610../tests/reverse-upload-test.cc:7:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]611 7 | int main()612 | ^613/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:74:3: note: frame #0: unhandled exception of type 'bad_function_call' may be thrown in function '__throw_bad_function_call' here614 74 | throw bad_function_call();615 | ^616/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:273:7: note: frame #1: function 'operator()' calls function '__throw_bad_function_call' here617 273 | std::__throw_bad_function_call();618 | ^619/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:772:10: note: frame #2: function 'operator()' calls function 'operator()' here620 772 | return __f_(std::forward<_ArgTypes>(__arg)...);621 | ^622../src/daemon/reverse-upload.hh:65:92: note: frame #3: function 'feed' calls function 'operator()' here623 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))624 | ^625../tests/reverse-upload-test.cc:76:16: note: frame #4: function 'main' calls function 'feed' here626 76 | assert(decoder.feed(std::string_view(wire).substr(offset, 16381), consume));627 | ^628../tests/reverse-upload-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]629 7 | int main()630 | ~~~ ^ 631 | auto -> int632../tests/reverse-upload-test.cc:9:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]633 4 | #include "reverse-upload.hh"634 5 | #include "reverse-upload-pipe.hh"635 6 | 636 7 | int main()637 8 | {638 9 | auto key = nixgrpc::ReverseCapability::newKey();639 | ^640../tests/reverse-upload-test.cc:12:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors]641 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,642 | ^643 | const 644../tests/reverse-upload-test.cc:12:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]645 4 | #include "reverse-upload.hh"646 5 | #include "reverse-upload-pipe.hh"647 6 | 648 7 | int main()649 8 | {650 9 | auto key = nixgrpc::ReverseCapability::newKey();651 10 | assert(key);652 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";653 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,654 | ^655../tests/reverse-upload-test.cc:12:63: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]656 4 | #include "reverse-upload.hh"657 5 | #include "reverse-upload-pipe.hh"658 6 | 659 7 | int main()660 8 | {661 9 | auto key = nixgrpc::ReverseCapability::newKey();662 10 | assert(key);663 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";664 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,665 | ^666../tests/reverse-upload-test.cc:14:116: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]667 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);668 | ^669../tests/reverse-upload-test.cc:19:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]670 4 | #include "reverse-upload.hh"671 5 | #include "reverse-upload-pipe.hh"672 6 | 673 7 | int main()674 8 | {675 9 | auto key = nixgrpc::ReverseCapability::newKey();676 10 | assert(key);677 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";678 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write,679 13 | .kind = nixgrpc::Caller::Kind::named};680 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42);681 15 | assert(token);682 16 | auto delegated = nixgrpc::ReverseCapability::verify(*key, *token, worker, 1, 1, "UploadBuildInputs");683 17 | assert(delegated);684 18 | 685 19 | nix::remote::UploadBuildInputsChunk first;686 | ^687../tests/reverse-upload-test.cc:21:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]688 21 | first.set_assign_id(42);689 | ^690../tests/reverse-upload-test.cc:24:25: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]691 24 | first.set_assign_id(43);692 | ^693../tests/reverse-upload-test.cc:26:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]694 26 | first.set_assign_id(42);695 | ^696../tests/reverse-upload-test.cc:39:24: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]697 39 | next.set_assign_id(42);698 | ^699../tests/reverse-upload-test.cc:52:119: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]700 52 | auto buildToken = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42);701 | ^702../tests/reverse-upload-test.cc:62:50: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]703 62 | follow.mutable_chunk()->set_data(std::string(70000, 'z'));704 | ^705../tests/reverse-upload-test.cc:65:41: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors]706 2 | auto const length = static_cast<uint32_t>(part.size());707 | ^708../tests/reverse-upload-test.cc:66:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]709 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));710 | ^ 711 | {712../tests/reverse-upload-test.cc:66:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]713 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));714 | ^715../tests/reverse-upload-test.cc:66:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]716 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));717 | ^718../tests/reverse-upload-test.cc:70:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]719 2 | size_t count = 0;720 | ^721../tests/reverse-upload-test.cc:71:20: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]722 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {723 | ^724 | -> bool725../tests/reverse-upload-test.cc:71:63: error: rvalue reference parameter 'part' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]726 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) {727 | ^728../tests/reverse-upload-test.cc:73:93: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]729 73 | return count == 1 ? part.chunk().data() == "header" : part.chunk().data().size() == 70000;730 | ^731../tests/reverse-upload-test.cc:75:61: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]732 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)733 | ^734../tests/reverse-upload-test.cc:75:67: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]735 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381)736 | ^737 | {738 76 | assert(decoder.feed(std::string_view(wire).substr(offset, 16381), consume));739 | 740../tests/reverse-upload-test.cc:86:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]741 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));742 | ^743 | -> bool744/nix/store/svkkgla6ini4hg035ka7wb8idm301r1i-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'745 99 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)746 | ^747../tests/reverse-upload-test.cc:86:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]748 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; }));749 | ^750../tests/reverse-upload-test.cc:89:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]751 89 | follow.set_assign_id(42);752 | ^753../tests/reverse-upload-test.cc:91:5: error: variable 'wireNext' of type 'std::string' (aka 'basic_string<char>') can be declared 'const' [misc-const-correctness,-warnings-as-errors]754 91 | std::string wireNext = follow.SerializeAsString();755 | ^756 | const 757../tests/reverse-upload-test.cc:95:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]758 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));759 | ^ 760 | {761../tests/reverse-upload-test.cc:95:92: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]762 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));763 | ^764../tests/reverse-upload-test.cc:95:102: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]765 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));766 | ^767../tests/reverse-upload-test.cc:98:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]768 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));769 | ^770 | -> bool771/nix/store/svkkgla6ini4hg035ka7wb8idm301r1i-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'772 99 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)773 | ^774../tests/reverse-upload-test.cc:98:82: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]775 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; }));776 | ^777../tests/reverse-upload-test.cc:106:53: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]778 106 | largePart.mutable_chunk()->set_data(std::string(70000, 'z'));779 | ^780../tests/reverse-upload-test.cc:108:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]781 108 | auto push = [&](std::string_view data) {782 | ^783 | -> void784../tests/reverse-upload-test.cc:111:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]785 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));786 | ^ 787 | {788../tests/reverse-upload-test.cc:111:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]789 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));790 | ^791../tests/reverse-upload-test.cc:111:99: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]792 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast<char>((length >> (8 * i)) & 0xff));793 | ^794../tests/reverse-upload-test.cc:113:67: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]795 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)796 | ^797../tests/reverse-upload-test.cc:113:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]798 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381)799 | ^800 | {801 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),802 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));803 | 804../tests/reverse-upload-test.cc:114:13: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors]805 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381),806 | ^807../tests/reverse-upload-test.cc:115:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]808 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));809 | ^810 | -> bool811/nix/store/svkkgla6ini4hg035ka7wb8idm301r1i-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'812 99 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)813 | ^814../tests/reverse-upload-test.cc:115:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]815 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; }));816 | ^817../tests/reverse-upload-test.cc:118:28: error: 70 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]818 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);819 | ^820../tests/reverse-upload-test.cc:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]821 118 | for (size_t i = 0; i < 70; ++i) push(laterWire);822 | ^ 823 | {824../tests/reverse-upload-test.cc:125:18: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]825 125 | auto frame = [](const nix::remote::UploadBuildInputsChunk & chunk) {826 | ^827 | -> std::string828../tests/reverse-upload-test.cc:129:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]829 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));830 | ^ 831 | {832../tests/reverse-upload-test.cc:129:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]833 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));834 | ^835../tests/reverse-upload-test.cc:129:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]836 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast<char>((length >> (8 * i)) & 0xff));837 | ^838../tests/reverse-upload-test.cc:136:28: error: 80 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]839 136 | for (size_t i = 0; i < 80; ++i) {840 | ^841>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-import-test.cc842../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]843 553 | namespaceClaim && namespaceClaim->is_string()) {844 | ^845 | ( != nullptr)846../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]847 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {848 | ^849 | ( != nullptr)850../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]851 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {852 | ^853../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]854 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {855 | ^856../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]857 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {858 | ^859../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]860 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {861 | ^862 | ( != nullptr)863../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]864 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {865 | ^866../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]867 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)868 | ^869../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]870 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||871 | ^872../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]873 96 | result.push_back(static_cast<char>(size >> (i * 8)));874 | ^875../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]876 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,877 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~878../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'879 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,880 | ^~~~~881../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'882 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,883 | ^~~~~~~~884../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]885 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);886 | ^~~887../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]888 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);889 | ^890../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]891 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)892 | ^893../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]894 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)895 | ^896../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]897 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||898 | ^899../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]900 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;901 | ^ 902 | {903../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]904 250 | unsigned char mac[EVP_MAX_MD_SIZE];905 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~906../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]907 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),908 | ~^909 | (910 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||911 | == nullptr)912../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]913 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||914 | ^915../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]916 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||917 | ^918../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]919 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);920 | ^921../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]922 23 | static constexpr size_t maxFrameBytes = 64 * 1024;923 | ^924../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning925 23 | static constexpr size_t maxFrameBytes = 64 * 1024;926 | ^~~~~~~~~927 | static_cast<const size_t>( )928../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type929 23 | static constexpr size_t maxFrameBytes = 64 * 1024;930 | ^~931 | static_cast<long>( )932../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]933 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;934 | ^935../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning936 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;937 | ^~~~~~~~~~~~~~~938 | static_cast<const size_t>( )939../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type940 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;941 | ^~~~~~~~942 | static_cast<long>( )943../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]944 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool945 | ^946../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]947 53 | auto data(uint64_t id, std::string_view bytes) -> bool948 | ^949../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]950 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);951 | ^952../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]953 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool954 | ^955../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]956 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool957 | ^958 | const &959../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]960 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;961 | ^ 962 | {963../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]964 81 | if (size > limit) return false;965 | ^ 966 | {967../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]968 83 | cv.wait(lock, stop, [&] {969 | ^970 | -> bool971../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]972 84 | auto it = streams.find(id);973 | ^974../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]975 87 | auto const it = streams.find(id);976 | ^977../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]978 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;979 | ^ 980 | {981../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]982 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }983 | ^984../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]985 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }986 | ^987../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]988 96 | auto acknowledge(uint64_t id) -> bool989 | ^990../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]991 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;992 | ^ 993 | {994../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]995 105 | if (!enqueue(std::move(msg))) return false;996 | ^ 997 | {998../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]999 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1000 | ^1001 | const &1002../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1003 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1004 | ^1005 | -> bool1006../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]1007 145 | auto finished(uint64_t id) -> bool1008 | ^1009../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1010 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1011 | ^ 1012 | {1013../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1014 150 | if (removed) cv.notify_all();1015 | ^ 1016 | {1017../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]1018 156 | void acknowledgementSent(uint64_t id)1019 | ^1020../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1021 159 | if (acknowledged.erase(id)) streams.erase(id);1022 | ^ 1023 | != 0u1024../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1025 159 | if (acknowledged.erase(id)) streams.erase(id);1026 | ^ 1027 | {1028../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]1029 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1030 | ^1031../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]1032 208 | auto terminal(uint64_t id, bool abort) -> bool1033 | ^1034../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]1035 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1036 | ^1037../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]1038 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1039 | ^1040 | -> bool1041../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]1042 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {1043 | ^1044../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1045 33 | if (assigned && !assigned()) return false;1046 | ^ 1047 | {1048../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]1049 35 | std::scoped_lock lock(mutex);1050 | ^1051 | const 1052../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1053 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;1054 | ^ 1055 | {1056../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1057 42 | if (!ok) cancel();1058 | ^ 1059 | {1060../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]1061 49 | std::scoped_lock lock(mutex);1062 | ^1063 | const 1064../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1065 68 | if (closed) return false;1066 | ^ 1067 | {1068../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1069 79 | if (ended || !chunks.empty()) break;1070 | ^ 1071 | {1072../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]1073 80 | cv.wait_for(lock, std::chrono::milliseconds(25));1074 | ^1075../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1076 82 | if (chunks.empty()) return false;1077 | ^ 1078 | {1079../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]1080 92 | std::scoped_lock lock(mutex);1081 | ^1082 | const 1083../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]1084 103 | cv.wait_for(lock, std::chrono::milliseconds(25));1085 | ^1086../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1087 113 | if (!ended || closed || !chunks.empty()) return false;1088 | ^ 1089 | {1090../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]1091 120 | std::scoped_lock lock(mutex);1092 | ^1093 | const 1094../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]1095 129 | std::scoped_lock lock(mutex);1096 | ^1097 | const 1098../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]1099 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1100 | ^1101../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning1102 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1103 | ^~~~~~~~~~~1104 | static_cast<const size_t>( )1105../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type1106 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;1107 | ^~~~1108 | static_cast<long>( )1109../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1110 49 | if (failed || bytes.empty() || !consume) return fail();1111 | ^ 1112 | {1113../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]1114 53 | buffer.append(bytes.data(), count);1115 | ~~~~~~^~~~1116../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1117 57 | for (unsigned i = 0; i < 4; ++i)1118 | ^1119 | {1120 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1121 | 1122../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]1123 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1124 | ^~~1125../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]1126 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);1127 | ^1128../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1129 59 | if (length == 0 || length > maxChunkBytes) return fail();1130 | ^ 1131 | {1132../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1133 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))1134 | ^1135../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1136 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))1137 | ^1138 | {1139 66 | return fail();1140 | 1141../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]1142 327 | char extra;1143 | ^ 1144 | = 01145../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1146 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");1147 | ^ 1148 | {1149../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1150 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");1151 | ^ 1152 | {1153../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1154 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");1155 | ^ 1156 | {1157../tests/reverse-import-test.cc:29:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1158 29 | int main()1159 | ^1160../src/daemon/upload-spool.hh:67:13: note: frame #0: unhandled exception of type 'nix::Error' may be thrown in function 'NarSpool' here1161 67 | throw nix::Error("cannot create a spool file: %s", opened.error().message());1162 | ^1163../tests/reverse-import-test.cc:136:23: note: frame #1: function 'main' calls function 'NarSpool' here1164 136 | nixgrpc::NarSpool spool;1165 | ^1166../tests/reverse-import-test.cc:29:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1167 29 | int main()1168 | ~~~ ^ 1169 | auto -> int1170../tests/reverse-import-test.cc:33:5: error: variable 'cleanup' of type 'nix::AutoDelete' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1171 33 | nix::AutoDelete cleanup(root);1172 | ^1173 | const 1174../tests/reverse-import-test.cc:39:33: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]1175 26 | #include "reverse-upload-pipe.hh"1176 27 | #include "upload-spool.hh"1177 28 | 1178 29 | int main()1179 30 | {1180 31 | nix::initLibStore(false);1181 32 | auto const root = nix::createTempDir();1182 33 | nix::AutoDelete cleanup(root);1183 34 | auto sourceStore = nix::openStore("local?root=" + (root / "source").string());1184 35 | auto destination = nix::openStore("local?root=" + (root / "destination").string());1185 36 | 1186 37 | // Compress poorly so the wire stream, not merely the decompressed NAR,1187 38 | // exceeds the registration reader's bounded 4 MiB queue.1188 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1189 | ^1190../tests/reverse-import-test.cc:39:65: error: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses,-warnings-as-errors]1191 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1192 | ^~~~~~~~~~~~~~~~1193 | ( )1194../tests/reverse-import-test.cc:39:65: error: performing an implicit widening conversion to type 'size_t' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1195../tests/reverse-import-test.cc:39:65: note: make conversion explicit to silence this warning1196 3 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1197 | ^~~~~~~~~~~~~~~1198 | static_cast<size_t>( )1199../tests/reverse-import-test.cc:39:65: note: perform multiplication in a wider type1200 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1201 | ^~~~~~~~1202 | static_cast<long>( )1203../tests/reverse-import-test.cc:39:69: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1204 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1205 | ^1206../tests/reverse-import-test.cc:39:76: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1207 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0');1208 | ^1209../tests/reverse-import-test.cc:40:23: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1210 40 | assert(RAND_bytes(reinterpret_cast<unsigned char *>(random.data()), static_cast<int>(random.size())) == 1);1211 | ^1212../tests/reverse-import-test.cc:58:64: error: no header providing "nix::NoRepair" is directly included [misc-include-cleaner,-warnings-as-errors]1213 6 | rejected->addToStore(unsignedOutput, unsignedNar, nix::NoRepair, nix::CheckSigs);1214 | ^1215../tests/reverse-import-test.cc:59:25: error: no header providing "nix::Error" is directly included [misc-include-cleaner,-warnings-as-errors]1216 6 | } catch (const nix::Error &) {1217 | ^1218../tests/reverse-import-test.cc:65:5: error: variable 'signer' of type 'nix::LocalSigner' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1219 65 | nix::LocalSigner signer(std::move(signingKey));1220 | ^1221 | const 1222../tests/reverse-import-test.cc:65:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1223 22 | nix::LocalSigner signer(std::move(signingKey));1224 | ^1225../tests/reverse-import-test.cc:68:39: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1226 68 | keys.emplace(publicKey.name, std::move(publicKey));1227 | ^1228../tests/reverse-import-test.cc:85:5: error: variable 'trusted' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors]1229 85 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted,1230 | ^1231 | const 1232../tests/reverse-import-test.cc:85:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1233 23 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted,1234 | ^1235../tests/reverse-import-test.cc:85:69: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1236 23 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted,1237 | ^1238../tests/reverse-import-test.cc:87:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]1239 26 | auto key = nixgrpc::ReverseCapability::newKey();1240 | ^1241../tests/reverse-import-test.cc:91:76: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1242 91 | trusted, "assigned.drv", 42);1243 | ^1244../tests/reverse-import-test.cc:95:49: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1245 95 | nixgrpc::ReverseUploadPipe pipe(*delegated, [] { return true; });1246 | ^1247 | -> bool1248../tests/reverse-import-test.cc:96:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1249 96 | auto send = [&](const nix::remote::UploadBuildInputsChunk & frame) {1250 | ^1251 | -> void1252../tests/reverse-import-test.cc:96:40: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors]1253 25 | auto send = [&](const nix::remote::UploadBuildInputsChunk & frame) {1254 | ^1255../tests/reverse-import-test.cc:100:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1256 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1257 | ^ 1258 | {1259../tests/reverse-import-test.cc:100:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1260 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1261 | ^1262../tests/reverse-import-test.cc:100:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1263 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast<char>((length >> (8 * i)) & 0xff));1264 | ^1265../tests/reverse-import-test.cc:102:14: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors]1266 3 | for (size_t offset = 0; offset < wire.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)1267 | ^1268../tests/reverse-import-test.cc:102:103: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1269 102 | for (size_t offset = 0; offset < wire.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes)1270 | ^1271 | {1272 103 | if (!pipe.feed(std::string_view(wire).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes)))1273 104 | throw std::runtime_error("bounded upload handoff overflowed");1274 | 1275../tests/reverse-import-test.cc:103:106: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1276 103 | if (!pipe.feed(std::string_view(wire).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes)))1277 | ^1278 | {1279 104 | throw std::runtime_error("bounded upload handoff overflowed");1280 | 1281../tests/reverse-import-test.cc:108:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1282 108 | header.set_assign_id(42);1283 | ^1284../tests/reverse-import-test.cc:119:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1285 119 | std::thread producer([&] {1286 | ^1287 | -> void1288../tests/reverse-import-test.cc:121:71: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1289 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) {1290 | ^1291../tests/reverse-import-test.cc:121:71: error: performing an implicit widening conversion to type 'size_t' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1292../tests/reverse-import-test.cc:121:71: note: make conversion explicit to silence this warning1293 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) {1294 | ^~~~~~~~~~1295 | static_cast<size_t>( )1296../tests/reverse-import-test.cc:121:71: note: perform multiplication in a wider type1297 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) {1298 | ^~~1299 | static_cast<long>( )1300../tests/reverse-import-test.cc:121:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1301 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) {1302 | ^1303../tests/reverse-import-test.cc:123:71: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1304 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024));1305 | ^1306../tests/reverse-import-test.cc:123:71: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]1307../tests/reverse-import-test.cc:123:71: note: make conversion explicit to silence this warning1308 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024));1309 | ^~~~~~~~~~1310 | static_cast<size_type>( )1311../tests/reverse-import-test.cc:123:71: note: perform multiplication in a wider type1312 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024));1313 | ^~~1314 | static_cast<long>( )1315../tests/reverse-import-test.cc:123:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]1316 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024));1317 | ^1318../tests/reverse-import-test.cc:130:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1319 130 | if (!pipe.finish()) throw std::runtime_error("upload half-close rejected");1320 | ^ 1321 | {1322../tests/reverse-import-test.cc:142:24: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]1323 142 | pipe, std::move(*flags.mutable_data()));1324 | ^1325../tests/reverse-import-test.cc:144:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1326 144 | [&](const nix::ValidPathInfo & imported, nix::Source & stream) {1327 | ^1328 | -> void1329../tests/reverse-import-test.cc:158:23: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1330 158 | if (producerError) std::rethrow_exception(producerError);1331 | ^ 1332 | {1333>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/src/daemon/sbpl.cc1334[1/1] (1/2) Processing file /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/src/daemon/sbpl.cc.1335[1/1] (2/2) Processing file /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/src/daemon/sbpl.cc.1336>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-inbound-test.cc1337../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1338 553 | namespaceClaim && namespaceClaim->is_string()) {1339 | ^1340 | ( != nullptr)1341../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1342 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1343 | ^1344 | ( != nullptr)1345../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1346 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1347 | ^1348../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1349 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1350 | ^1351../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1352 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1353 | ^1354../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1355 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1356 | ^1357 | ( != nullptr)1358../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1359 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1360 | ^1361../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1362 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1363 | ^1364../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]1365 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1366 | ^1367../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]1368 96 | result.push_back(static_cast<char>(size >> (i * 8)));1369 | ^1370../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]1371 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1372 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1373../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1374 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1375 | ^~~~~1376../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1377 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1378 | ^~~~~~~~1379../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]1380 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1381 | ^~~1382../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]1383 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1384 | ^1385../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1386 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1387 | ^1388../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1389 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1390 | ^1391../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]1392 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1393 | ^1394../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1395 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1396 | ^ 1397 | {1398../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]1399 250 | unsigned char mac[EVP_MAX_MD_SIZE];1400 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1401../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1402 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1403 | ~^1404 | (1405 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1406 | == nullptr)1407../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1408 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1409 | ^1410../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]1411 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1412 | ^1413../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1414 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1415 | ^1416../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]1417 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1418 | ^1419../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1420 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1421 | ^~~~~~~~~1422 | static_cast<const size_t>( )1423../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1424 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1425 | ^~1426 | static_cast<long>( )1427../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]1428 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1429 | ^1430../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1431 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1432 | ^~~~~~~~~~~~~~~1433 | static_cast<const size_t>( )1434../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1435 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1436 | ^~~~~~~~1437 | static_cast<long>( )1438../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]1439 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1440 | ^1441../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]1442 53 | auto data(uint64_t id, std::string_view bytes) -> bool1443 | ^1444../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]1445 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1446 | ^1447../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]1448 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1449 | ^1450../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]1451 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1452 | ^1453 | const &1454../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1455 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1456 | ^ 1457 | {1458../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1459 81 | if (size > limit) return false;1460 | ^ 1461 | {1462../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1463 83 | cv.wait(lock, stop, [&] {1464 | ^1465 | -> bool1466../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]1467 84 | auto it = streams.find(id);1468 | ^1469../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]1470 87 | auto const it = streams.find(id);1471 | ^1472../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1473 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1474 | ^ 1475 | {1476../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]1477 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1478 | ^1479../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]1480 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1481 | ^1482../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]1483 96 | auto acknowledge(uint64_t id) -> bool1484 | ^1485../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1486 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1487 | ^ 1488 | {1489../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1490 105 | if (!enqueue(std::move(msg))) return false;1491 | ^ 1492 | {1493../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]1494 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1495 | ^1496 | const &1497../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1498 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1499 | ^1500 | -> bool1501../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]1502 145 | auto finished(uint64_t id) -> bool1503 | ^1504../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1505 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1506 | ^ 1507 | {1508../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1509 150 | if (removed) cv.notify_all();1510 | ^ 1511 | {1512../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]1513 156 | void acknowledgementSent(uint64_t id)1514 | ^1515../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1516 159 | if (acknowledged.erase(id)) streams.erase(id);1517 | ^ 1518 | != 0u1519../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1520 159 | if (acknowledged.erase(id)) streams.erase(id);1521 | ^ 1522 | {1523../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]1524 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1525 | ^1526../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]1527 208 | auto terminal(uint64_t id, bool abort) -> bool1528 | ^1529../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]1530 50 | auto const id = frame.stream_id();1531 | ^1532../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]1533 68 | auto it = streams.find(id);1534 | ^1535../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1536 74 | && finishedIds.erase(id))1537 | ^ 1538 | ( != 0u)1539../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1540 74 | && finishedIds.erase(id))1541 | ^1542 | {1543 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};1544 | 1545../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]1546 109 | auto finished(uint64_t id) -> bool1547 | ^1548../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1549 111 | if (cancelledIds.erase(id)) return true;1550 | ^ 1551 | != 0u1552../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1553 111 | if (cancelledIds.erase(id)) return true;1554 | ^ 1555 | {1556../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1557 112 | if (!streams.erase(id)) return false;1558 | ~^ 1559 | == 0u1560../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1561 112 | if (!streams.erase(id)) return false;1562 | ^ 1563 | {1564../tests/reverse-inbound-test.cc:6:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1565 6 | int main()1566 | ^1567/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/stdexcept:256:3: note: frame #0: unhandled exception of type 'out_of_range' may be thrown in function '__throw_out_of_range' here1568 256 | throw out_of_range(__msg);1569 | ^1570/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string_view:464:30: note: frame #1: function 'substr' calls function '__throw_out_of_range' here1571 464 | return __pos > size() ? (__throw_out_of_range("string_view::substr"), basic_string_view())1572 | ^1573../src/daemon/reverse-capability.hh:174:21: note: frame #2: function 'verify' calls function 'substr' here1574 174 | auto wire = token.substr(4, size);1575 | ^1576../src/daemon/reverse-capability.hh:153:16: note: frame #3: function 'authorizeOpen' calls function 'verify' here1577 153 | return verify(key, open.capability(), workerId, generation, streamId, open.method(), now);1578 | ^1579../src/daemon/reverse-inbound.hh:58:27: note: frame #4: function 'accept' calls function 'authorizeOpen' here1580 58 | auto caller = ReverseCapability::authorizeOpen(sessionKey, frame.open(), workerId, generation, id);1581 | ^1582../tests/reverse-inbound-test.cc:24:18: note: frame #5: function 'main' calls function 'accept' here1583 24 | auto event = inbound.accept(open);1584 | ^1585../tests/reverse-inbound-test.cc:6:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1586 6 | int main()1587 | ~~~ ^ 1588 | auto -> int1589../tests/reverse-inbound-test.cc:8:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1590 4 | #include "reverse-inbound.hh"1591 5 | 1592 6 | int main()1593 7 | {1594 8 | using nixgrpc::Caller;1595 | ^1596../tests/reverse-inbound-test.cc:9:20: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]1597 4 | #include "reverse-inbound.hh"1598 5 | 1599 6 | int main()1600 7 | {1601 8 | using nixgrpc::Caller;1602 9 | using nixgrpc::ReverseCapability;1603 | ^1604../tests/reverse-inbound-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1605 4 | #include "reverse-inbound.hh"1606 5 | 1607 6 | int main()1608 7 | {1609 8 | using nixgrpc::Caller;1610 9 | using nixgrpc::ReverseCapability;1611 10 | using nixgrpc::ReverseInbound;1612 11 | using nixgrpc::Role;1613 | ^1614../tests/reverse-inbound-test.cc:15:5: error: 'const auto worker' can be declared as 'const auto *const worker' [readability-qualified-auto,-warnings-as-errors]1615 15 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef";1616 | ^~~~~~~~~~1617 | const auto *const 1618../tests/reverse-inbound-test.cc:20:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]1619 4 | nix::remote::ReverseFarmMsg open;1620 | ^1621../tests/reverse-inbound-test.cc:49:56: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors]1622 4 | data.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x'));1623 | ^1624>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/nar-fetcher-test.cc1625../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]1626 327 | char extra;1627 | ^ 1628 | = 01629../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1630 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");1631 | ^ 1632 | {1633../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1634 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");1635 | ^ 1636 | {1637../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1638 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");1639 | ^ 1640 | {1641>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/tests/reverse-roundtrip-test.cc1642../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1643 553 | namespaceClaim && namespaceClaim->is_string()) {1644 | ^1645 | ( != nullptr)1646../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1647 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {1648 | ^1649 | ( != nullptr)1650../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1651 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {1652 | ^1653../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1654 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {1655 | ^1656../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1657 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1658 | ^1659../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1660 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {1661 | ^1662 | ( != nullptr)1663../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]1664 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {1665 | ^1666../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1667 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)1668 | ^1669../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]1670 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||1671 | ^1672../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]1673 96 | result.push_back(static_cast<char>(size >> (i * 8)));1674 | ^1675../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]1676 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1677 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1678../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'1679 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1680 | ^~~~~1681../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'1682 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,1683 | ^~~~~~~~1684../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]1685 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1686 | ^~~1687../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]1688 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);1689 | ^1690../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1691 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1692 | ^1693../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]1694 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)1695 | ^1696../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]1697 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||1698 | ^1699../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1700 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;1701 | ^ 1702 | {1703../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]1704 250 | unsigned char mac[EVP_MAX_MD_SIZE];1705 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1706../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1707 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),1708 | ~^1709 | (1710 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1711 | == nullptr)1712../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1713 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1714 | ^1715../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]1716 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||1717 | ^1718../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]1719 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);1720 | ^1721../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]1722 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1723 | ^1724../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning1725 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1726 | ^~~~~~~~~1727 | static_cast<const size_t>( )1728../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type1729 23 | static constexpr size_t maxFrameBytes = 64 * 1024;1730 | ^~1731 | static_cast<long>( )1732../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]1733 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1734 | ^1735../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning1736 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1737 | ^~~~~~~~~~~~~~~1738 | static_cast<const size_t>( )1739../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type1740 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;1741 | ^~~~~~~~1742 | static_cast<long>( )1743../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]1744 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool1745 | ^1746../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]1747 53 | auto data(uint64_t id, std::string_view bytes) -> bool1748 | ^1749../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]1750 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);1751 | ^1752../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]1753 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1754 | ^1755../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]1756 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool1757 | ^1758 | const &1759../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1760 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;1761 | ^ 1762 | {1763../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1764 81 | if (size > limit) return false;1765 | ^ 1766 | {1767../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1768 83 | cv.wait(lock, stop, [&] {1769 | ^1770 | -> bool1771../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]1772 84 | auto it = streams.find(id);1773 | ^1774../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]1775 87 | auto const it = streams.find(id);1776 | ^1777../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1778 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;1779 | ^ 1780 | {1781../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]1782 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }1783 | ^1784../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]1785 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }1786 | ^1787../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]1788 96 | auto acknowledge(uint64_t id) -> bool1789 | ^1790../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1791 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;1792 | ^ 1793 | {1794../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1795 105 | if (!enqueue(std::move(msg))) return false;1796 | ^ 1797 | {1798../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]1799 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool1800 | ^1801 | const &1802../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1803 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });1804 | ^1805 | -> bool1806../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]1807 145 | auto finished(uint64_t id) -> bool1808 | ^1809../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1810 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;1811 | ^ 1812 | {1813../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1814 150 | if (removed) cv.notify_all();1815 | ^ 1816 | {1817../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]1818 156 | void acknowledgementSent(uint64_t id)1819 | ^1820../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1821 159 | if (acknowledged.erase(id)) streams.erase(id);1822 | ^ 1823 | != 0u1824../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1825 159 | if (acknowledged.erase(id)) streams.erase(id);1826 | ^ 1827 | {1828../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]1829 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {1830 | ^1831../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]1832 208 | auto terminal(uint64_t id, bool abort) -> bool1833 | ^1834../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]1835 50 | auto const id = frame.stream_id();1836 | ^1837../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]1838 68 | auto it = streams.find(id);1839 | ^1840../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1841 74 | && finishedIds.erase(id))1842 | ^ 1843 | ( != 0u)1844../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1845 74 | && finishedIds.erase(id))1846 | ^1847 | {1848 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};1849 | 1850../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]1851 109 | auto finished(uint64_t id) -> bool1852 | ^1853../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1854 111 | if (cancelledIds.erase(id)) return true;1855 | ^ 1856 | != 0u1857../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1858 111 | if (cancelledIds.erase(id)) return true;1859 | ^ 1860 | {1861../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]1862 112 | if (!streams.erase(id)) return false;1863 | ~^ 1864 | == 0u1865../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1866 112 | if (!streams.erase(id)) return false;1867 | ^ 1868 | {1869../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]1870 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {1871 | ^1872../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]1873 82 | auto it = sessions.find(std::string(workerId));1874 | ^1875../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]1876 92 | auto it = sessions.find(handle->workerId);1877 | ^1878../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]1879 107 | auto it = sessions.find(handle->workerId);1880 | ^1881../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]1882 130 | for (auto & [id, session] : sessions) {1883 | ^1884../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]1885 32 | [[nodiscard]] auto open(uint64_t id) -> bool1886 | ^1887../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]1888 51 | auto it = streams.find(frame.stream_id());1889 | ^1890../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1891 56 | if (!cancelled.contains(frame.stream_id())) return false;1892 | ^ 1893 | {1894../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1895 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;1896 | ^ 1897 | {1898../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]1899 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1900 | ^1901../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]1902 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool1903 | ^1904 | const &1905../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1906 104 | auto pending = [&] {1907 | ^1908 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>1909../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]1910 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1911 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~1912 | std::ranges::find_if queue1913../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1914 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });1915 | ^1916 | -> auto1917../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]1918 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });1919 | ^1920 | -> bool1921../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]1922 111 | auto it = pending();1923 | ^1924../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]1925 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool1926 | ^1927../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]1928 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);1929 | ^ 1930 | {1931../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]1932 168 | [[nodiscard]] auto finished(uint64_t id) -> bool1933 | ^1934../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]1935 171 | auto it = streams.find(id);1936 | ^1937../tests/reverse-roundtrip-test.cc:10:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]1938 10 | int main()1939 | ^1940/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here1941 67 | throw bad_array_new_length();1942 | ^1943/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here1944 101 | std::__throw_bad_array_new_length();1945 | ^1946/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here1947 112 | return {allocate(__n), __n};1948 | ^1949/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>>' calls function 'allocate_at_least' here1950 280 | return __alloc.allocate_at_least(__n);1951 | ^1952/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>>' calls function 'allocate_at_least<std::allocator<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>>' here1953 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);1954 | ^1955/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:330:25: note: frame #5: function '__split_buffer' calls function '__allocate_at_least<std::allocator<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>>' here1956 330 | auto __allocation = std::__allocate_at_least(__alloc_, __cap);1957 | ^1958/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__vector/vector.h:1128:47: note: frame #6: function '__emplace_back_slow_path<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>' calls function '__split_buffer' here1959 1128 | __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), this->__alloc_);1960 | ^1961/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__vector/vector.h:1150:13: note: frame #7: function 'emplace_back<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>' calls function '__emplace_back_slow_path<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>' here1962 1150 | __end = __emplace_back_slow_path(std::forward<_Args>(__args)...);1963 | ^1964/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__vector/vector.h:457:90: note: frame #8: function 'push_back' calls function 'emplace_back<std::shared_ptr<const nixgrpc::ReverseRegistry::Session>>' here1965 457 | _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x) { emplace_back(std::move(__x)); }1966 | ^1967../src/daemon/reverse-registry.hh:131:21: note: frame #9: function 'setActive' calls function 'push_back' here1968 131 | previous.push_back(std::move(session));1969 | ^1970../tests/reverse-roundtrip-test.cc:21:5: note: frame #10: function 'main' calls function 'setActive' here1971 21 | registry.setActive(true);1972 | ^1973../tests/reverse-roundtrip-test.cc:10:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]1974 10 | int main()1975 | ~~~ ^ 1976 | auto -> int1977../tests/reverse-roundtrip-test.cc:12:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]1978 4 | #include "reverse-capability.hh"1979 5 | #include "reverse-frames.hh"1980 6 | #include "reverse-inbound.hh"1981 7 | #include "reverse-registry.hh"1982 8 | #include "reverse-responses.hh"1983 9 | 1984 10 | int main()1985 11 | {1986 12 | using nixgrpc::Caller;1987 | ^1988../tests/reverse-roundtrip-test.cc:18:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors]1989 4 | #include "reverse-capability.hh"1990 5 | #include "reverse-frames.hh"1991 6 | #include "reverse-inbound.hh"1992 7 | #include "reverse-registry.hh"1993 8 | #include "reverse-responses.hh"1994 9 | 1995 10 | int main()1996 11 | {1997 12 | using nixgrpc::Caller;1998 13 | using nixgrpc::ReverseCapability;1999 14 | using nixgrpc::ReverseFrames;2000 15 | using nixgrpc::ReverseInbound;loading 9,091 hidden lines…
11092 | ^11093 | const 11094../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]11095 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11096 | ^11097../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning11098 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11099 | ^~~~~~~~~~~11100 | static_cast<const size_t>( )11101../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type11102 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;11103 | ^~~~11104 | static_cast<long>( )11105../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11106 49 | if (failed || bytes.empty() || !consume) return fail();11107 | ^ 11108 | {11109../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]11110 53 | buffer.append(bytes.data(), count);11111 | ~~~~~~^~~~11112../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11113 57 | for (unsigned i = 0; i < 4; ++i)11114 | ^11115 | {11116 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11117 | 11118../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]11119 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11120 | ^~~11121../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]11122 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);11123 | ^11124../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11125 59 | if (length == 0 || length > maxChunkBytes) return fail();11126 | ^ 11127 | {11128../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]11129 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))11130 | ^11131../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11132 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))11133 | ^11134 | {11135 66 | return fail();11136 | 11137../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]11138 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();11139 | ^11140../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11141 371 | auto const it = workerIds.find(std::string(addr));11142 | ^11143../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]11144 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience11145 | ^11146../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11147 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {11148 | ^11149 | -> bool11150../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]11151 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {11152 | ^11153../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]11154 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {11155 | ^11156../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]11157 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {11158 | ^11159../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]11160 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {11161 | ^11162../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]11163 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {11164 | ^11165../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]11166 44 | if (uid[i] != '-') {11167 | ^~~11168../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]11169 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {11170 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11171 | < || > && < || >11172../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]11173 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {11174 | ^~~11175../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]11176 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {11177 | ^~~11178../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]11179 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {11180 | ^~~11181../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]11182 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {11183 | ^~~11184../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]11185 96 | auto const & id = *result.identity;11186 | ^11187../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]11188 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime11189 | ^~~~~~~~~~~~11190../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]11191 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {11192 | ^~~~~~~~~~~~11193../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]11194 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;11195 | ^~~~~~~~~11196../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]11197 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};11198 | ^~~~~~~~~~~~11199../tests/oidc-test.cc:4:1: error: included header atomic is not used directly [misc-include-cleaner,-warnings-as-errors]11200 4 | #include <atomic>11201 | ^~~~~~~~~~~~~~~~~11202 5 | #include <chrono>11203../tests/oidc-test.cc:243:53: error: no header providing "nix::remote::NixRemote" is directly included [misc-include-cleaner,-warnings-as-errors]11204 41 | class BuildRouteService final : public nix::remote::NixRemote::Service11205 | ^11206../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]11207 245 | nixgrpc::ReverseGateway & gateway;11208 | ^11209../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]11210 246 | nixgrpc::Dispatcher & dispatcher;11211 | ^11212../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]11213 250 | std::string drvPath;11214 | ^11215../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]11216 251 | uint64_t assignId = 0;11217 | ^11218../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]11219 252 | std::string selectedPod;11220 | ^11221../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]11222 253 | bool relayEnabled = false;11223 | ^11224../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]11225 254 | bool buildRelayEnabled = false;11226 | ^11227../tests/oidc-test.cc:256:67: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors]11228 42 | BuildRouteService(nixgrpc::ReverseGateway & gateway, nixgrpc::ReverseRegistry & registry,11229 | ^11230../tests/oidc-test.cc:260:70: error: no header providing "nix::remote::StoreInfoRequest" is directly included [misc-include-cleaner,-warnings-as-errors]11231 41 | auto StoreInfo(grpc::ServerContext * context, const nix::remote::StoreInfoRequest * request,11232 | ^11233../tests/oidc-test.cc:261:33: error: no header providing "nix::remote::StoreInfoReply" is directly included [misc-include-cleaner,-warnings-as-errors]11234 261 | nix::remote::StoreInfoReply * reply) -> grpc::Status override11235 | ^11236../tests/oidc-test.cc:261:66: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors]11237 10 | nix::remote::StoreInfoReply * reply) -> grpc::Status override11238 | ^11239../tests/oidc-test.cc:264:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11240 264 | return relay.call(*context, [&](uint64_t id) {11241 | ^11242 | -> Result11243../tests/oidc-test.cc:264:54: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11244 264 | return relay.call(*context, [&](uint64_t id) {11245 | ^11246../tests/oidc-test.cc:266:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11247 266 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },11248 | ^11249 | -> std::optional<std::string>11250../tests/oidc-test.cc:268:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11251 268 | }, *request, [&](std::string_view data) { return reply->ParseFromArray(data.data(), static_cast<int>(data.size())); });11252 | ^11253 | -> bool11254../tests/oidc-test.cc:271:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11255 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },11256 | ^11257 | -> std::optional<std::string>11258../tests/oidc-test.cc:271:61: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11259 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); },11260 | ^11261../tests/oidc-test.cc:277:76: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors]11262 277 | auto BuildDerivation(grpc::ServerContext * context, const nix::remote::BuildDerivationRequest * request,11263 | ^11264../tests/oidc-test.cc:278:58: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors]11265 278 | grpc::ServerWriter<nix::remote::BuildDerivationChunk> * writer) -> grpc::Status override11266 | ^11267../tests/oidc-test.cc:280:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11268 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};11269 | ^ 11270 | {11271../tests/oidc-test.cc:280:47: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors]11272 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"};11273 | ^11274../tests/oidc-test.cc:282:44: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11275 282 | auto status = relay.call(*context, [&](uint64_t id) {11276 | ^11277 | -> Result11278../tests/oidc-test.cc:282:57: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11279 282 | auto status = relay.call(*context, [&](uint64_t id) {11280 | ^11281../tests/oidc-test.cc:284:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11282 284 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); },11283 | ^11284 | -> std::optional<std::string>11285../tests/oidc-test.cc:286:22: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11286 286 | }, *request, [&](std::string_view data) {11287 | ^11288 | -> bool11289../tests/oidc-test.cc:289:88: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11290 289 | chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET) return false;11291 | ^ 11292 | {11293../tests/oidc-test.cc:292:12: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11294 292 | }, [this, drv = request->drv_path(), assign = request->assign_id()] {11295 | ^11296 | -> bool11297../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]11298 457 | check(!verifier.verify(ecKey.sign(claims({{"sub", 42}}))).identity,11299 | ^11300../tests/oidc-test.cc:507:26: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11301 507 | projectedAudience["aud"] = {"grpc://worker-tunnel"};11302 | ^~~~~~~11303../tests/oidc-test.cc:513:20: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11304 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";11305 | ^~~~~~~~~~~~~~~~~11306../tests/oidc-test.cc:513:37: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11307 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";11308 | ^~~~~~~11309../tests/oidc-test.cc:513:44: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11310 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2";11311 | ^~~~~~~~11312../tests/oidc-test.cc:514:9: error: 'const auto replacementId' can be declared as 'const auto *const replacementId' [readability-qualified-auto,-warnings-as-errors]11313 514 | auto const replacementId = "pod:staging:12345678-1234-1234-1234-123456789abd";11314 | ^~~~~~~~~~11315 | const auto *const 11316../tests/oidc-test.cc:519:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11317 519 | otherAudience["aud"] = "grpc://cache";11318 | ^~~~~~~11319../tests/oidc-test.cc:522:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11320 522 | mixedAudience["aud"] = {"grpc://worker-tunnel", "grpc://cache"};11321 | ^~~~~~~11322../tests/oidc-test.cc:526:23: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11323 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production";11324 | ^~~~~~~~~~~~~~~~~11325../tests/oidc-test.cc:526:40: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11326 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production";11327 | ^~~~~~~~~~~~~11328../tests/oidc-test.cc:529:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11329 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";11330 | ^~~~~~~~~~~~~~~~~11331../tests/oidc-test.cc:529:33: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11332 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";11333 | ^~~~~~~~~~~~~~~~~~11334../tests/oidc-test.cc:529:51: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11335 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client";11336 | ^~~~~~~~11337../tests/oidc-test.cc:532:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11338 532 | noUid["kubernetes.io"]["pod"].erase("uid");11339 | ^~~~~~~~~~~~~~~~~11340../tests/oidc-test.cc:532:31: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11341 532 | noUid["kubernetes.io"]["pod"].erase("uid");11342 | ^~~~~~~11343../tests/oidc-test.cc:536:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11344 536 | noPod["kubernetes.io"].erase("pod");11345 | ^~~~~~~~~~~~~~~~~11346../tests/oidc-test.cc:539:13: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11347 539 | noSa["kubernetes.io"].erase("serviceaccount");11348 | ^~~~~~~~~~~~~~~~~11349../tests/oidc-test.cc:542:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11350 542 | expired["exp"] = now() - longAgo;11351 | ^~~~~~~11352../tests/oidc-test.cc:548:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11353 548 | longLived["exp"] = now() + 3600;11354 | ^~~~~~~11355../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]11356 548 | longLived["exp"] = now() + 3600;11357 | ^11358../tests/oidc-test.cc:551:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11359 551 | backdated["iat"] = now() - 3000;11360 | ^~~~~~~11361../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]11362 551 | backdated["iat"] = now() - 3000;11363 | ^11364../tests/oidc-test.cc:552:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11365 552 | backdated["exp"] = now() + 3000;11366 | ^~~~~~~11367../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]11368 552 | backdated["exp"] = now() + 3000;11369 | ^11370../tests/oidc-test.cc:555:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11371 555 | futureIat["iat"] = now() + 1200;11372 | ^~~~~~~11373../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]11374 555 | futureIat["iat"] = now() + 1200;11375 | ^11376../tests/oidc-test.cc:556:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11377 556 | futureIat["exp"] = now() + 1500;11378 | ^~~~~~~11379../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]11380 556 | futureIat["exp"] = now() + 1500;11381 | ^11382../tests/oidc-test.cc:564:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11383 564 | later["exp"] = now() + validFor + 60;11384 | ^~~~~~~11385../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]11386 564 | later["exp"] = now() + validFor + 60;11387 | ^11388../tests/oidc-test.cc:576:18: error: no header providing "nixgrpc::Auth" is directly included [misc-include-cleaner,-warnings-as-errors]11389 38 | nixgrpc::Auth registrationAuth;11390 | ^11391../tests/oidc-test.cc:579:15: error: no header providing "grpc::SslServerCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]11392 10 | grpc::SslServerCredentialsOptions tls;11393 | ^11394../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]11395 10 | tls.client_certificate_request = GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY;11396 | ^11397../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]11398 582 | tls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"), nix::readFile(dir + "/server.crt")});11399 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11400 | .private_key= .cert_chain=11401/nix/store/hm4j3zqs3jvbg3gjgw33lc322yjb07f4-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here11402 48 | struct PemKeyCertPair {11403 | ^11404../tests/oidc-test.cc:586:55: error: no header providing "grpc::SslServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]11405 586 | builder.AddListeningPort("127.0.0.1:0", grpc::SslServerCredentials(tls), &port);11406 | ^11407../tests/oidc-test.cc:587:55: error: no header providing "grpc::InsecureServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]11408 587 | builder.AddListeningPort("127.0.0.1:0", grpc::InsecureServerCredentials(), &insecurePort);11409 | ^11410../tests/oidc-test.cc:595:15: error: no header providing "grpc::SslCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors]11411 10 | grpc::SslCredentialsOptions roots;11412 | ^11413../tests/oidc-test.cc:600:87: error: no header providing "grpc::SslCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]11414 600 | auto channel = grpc::CreateChannel("localhost:" + std::to_string(port), grpc::SslCredentials(workerTls));11415 | ^11416../tests/oidc-test.cc:601:34: error: no header providing "nix::remote::ReverseSession" is directly included [misc-include-cleaner,-warnings-as-errors]11417 601 | auto stub = nix::remote::ReverseSession::NewStub(channel);11418 | ^11419../tests/oidc-test.cc:609:26: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11420 609 | nix::remote::ReverseWorkerMsg registration;11421 | ^11422../tests/oidc-test.cc:613:26: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11423 613 | nix::remote::ReverseFarmMsg ack;11424 | ^11425../tests/oidc-test.cc:618:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11426 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)11427 | ^11428 619 | {11429 | -> std::pair<std::unique_ptr<grpc::ClientReaderWriter<nix::remote::ReverseWorkerMsg, nix::remote::ReverseFarmMsg>>, unsigned long long>11430../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]11431 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)11432 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11433../tests/oidc-test.cc:618:70: note: the first parameter in the range is 'credential'11434 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)11435 | ^~~~~~~~~~11436../tests/oidc-test.cc:618:101: note: the last parameter in the range is 'claim'11437 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim)11438 | ^~~~~11439../tests/oidc-test.cc:630:13: error: variable 'accepted' of type 'bool' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11440 630 | bool accepted = stream->Read(&ack);11441 | ^11442 | const 11443../tests/oidc-test.cc:632:25: error: no header providing "std::pair" is directly included [misc-include-cleaner,-warnings-as-errors]11444 16 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};11445 | ^11446../tests/oidc-test.cc:632:35: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11447 632 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}};11448 | ^11449../tests/oidc-test.cc:659:88: error: no header providing "grpc::InsecureChannelCredentials" is directly included [misc-include-cleaner,-warnings-as-errors]11450 659 | grpc::CreateChannel("127.0.0.1:" + std::to_string(insecurePort), grpc::InsecureChannelCredentials()));11451 | ^11452../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]11453 749 | extra.set_stream_id(99);11454 | ^11455../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]11456 760 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11457 | ^11458../tests/oidc-test.cc:766:44: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11459 41 | auto capability = nixgrpc::ReverseCapability::mint(11460 | ^11461../tests/oidc-test.cc:768:30: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors]11462 768 | nixgrpc::Caller{.name = "read-client", .role = Role::readOnly,11463 | ^11464../tests/oidc-test.cc:770:30: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors]11465 770 | nix::remote::ReverseOpen start;11466 | ^11467../tests/oidc-test.cc:772:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11468 772 | if (capability) start.set_capability(*capability);11469 | ^ 11470 | {11471../tests/oidc-test.cc:773:100: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11472 773 | check(capability && transport.responses.open(1) && transport.outgoing.open(1, std::move(start)) &&11473 | ^11474../tests/oidc-test.cc:788:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11475 788 | if (secondCapability) secondStart.set_capability(*secondCapability);11476 | ^ 11477 | {11478../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]11479 828 | firstCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11480 | ^11481../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]11482 840 | secondCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11483 | ^11484../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]11485 853 | otherCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11486 | ^11487../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]11488 868 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11489 | ^11490../tests/oidc-test.cc:870:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11491 870 | soon["exp"] = now() + 2;11492 | ^~~~~~~11493../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]11494 880 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11495 | ^11496../tests/oidc-test.cc:882:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11497 882 | soon["exp"] = now() + 2;11498 | ^~~~~~~11499../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]11500 900 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11501 | ^11502../tests/oidc-test.cc:924:14: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors]11503 12 | std::optional<Verifier> noClientOidc;11504 | ^11505../tests/oidc-test.cc:931:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11506 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11507 | ^11508 | -> bool11509../tests/oidc-test.cc:931:80: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11510 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) {11511 | ^11512../tests/oidc-test.cc:934:18: error: no header providing "nixgrpc::IdleTracker" is directly included [misc-include-cleaner,-warnings-as-errors]11513 40 | nixgrpc::IdleTracker idle;11514 | ^11515../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]11516 941 | controlTls.client_certificate_request = GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;11517 | ^11518../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]11519 942 | controlTls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"),11520 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11521 | .private_key=11522 943 | nix::readFile(dir + "/server.crt")});11523 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11524 | .cert_chain=11525/nix/store/hm4j3zqs3jvbg3gjgw33lc322yjb07f4-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here11526 48 | struct PemKeyCertPair {11527 | ^11528../tests/oidc-test.cc:952:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11529 952 | if (!controlServer) return check.result();11530 | ^ 11531 | {11532../tests/oidc-test.cc:958:41: error: no header providing "nix::remote::Scheduler" is directly included [misc-include-cleaner,-warnings-as-errors]11533 958 | auto controlStub = nix::remote::Scheduler::NewStub(controlChannel);11534 | ^11535../tests/oidc-test.cc:963:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11536 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11537 | ^11538 | -> std::unique_ptr< ::grpc::ClientReaderWriter< ::nix::remote::WorkerMsgs, ::nix::remote::SchedCmds>>11539../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]11540 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11541 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11542../tests/oidc-test.cc:963:73: note: the first parameter in the range is 'claim'11543 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11544 | ^~~~~11545../tests/oidc-test.cc:963:97: note: the last parameter in the range is 'addr'11546 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) {11547 | ^~~~11548../tests/oidc-test.cc:965:26: error: no header providing "nix::remote::WorkerMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11549 965 | nix::remote::WorkerMsgs messages;11550 | ^11551../tests/oidc-test.cc:988:26: error: no header providing "nix::remote::SchedCmds" is directly included [misc-include-cleaner,-warnings-as-errors]11552 988 | nix::remote::SchedCmds commands;11553 | ^11554../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]11555 1033 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11556 | ^11557../tests/oidc-test.cc:1036:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11558 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11559 | ^11560 | -> bool11561../tests/oidc-test.cc:1036:74: error: no header providing "nix::remote::SchedMsg" is directly included [misc-include-cleaner,-warnings-as-errors]11562 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11563 | ^11564../tests/oidc-test.cc:1036:104: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11565 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {});11566 | ^11567 | -> void11568../tests/oidc-test.cc:1037:26: error: no header providing "nix::remote::ClientMsgs" is directly included [misc-include-cleaner,-warnings-as-errors]11569 1037 | nix::remote::ClientMsgs want;11570 | ^11571../tests/oidc-test.cc:1046:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11572 1046 | auto const id = commands.msgs(0).expect().assign_id();11573 | ^11574../tests/oidc-test.cc:1074:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11575 1074 | auto reauth = [](std::string tokenValue) {11576 | ^11577 | -> nix::remote::WorkerMsgs11578../tests/oidc-test.cc:1076:67: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]11579 1076 | messages.add_msgs()->mutable_reauth()->set_token(std::move(tokenValue));11580 | ^11581../tests/oidc-test.cc:1080:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11582 1080 | auto memberCount = [&] { return dispatcher.podConnected(workerId) ? size_t{1} : size_t{0}; };11583 | ^11584 | -> size_t11585../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]11586 1092 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11587 | ^11588../tests/oidc-test.cc:1094:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11589 1094 | soon["exp"] = now() + 2;11590 | ^~~~~~~11591../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]11592 1109 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15));11593 | ^11594../tests/oidc-test.cc:1111:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]11595 1111 | soon["exp"] = now() + 2;11596 | ^~~~~~~11597../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]11598 1116 | std::this_thread::sleep_for(std::chrono::milliseconds(20));11599 | ^11600../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]11601 1128 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11602 | ^11603../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]11604 1132 | dataCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11605 | ^11606../tests/oidc-test.cc:1147:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11607 1147 | auto client = dispatcher.connectClient([&](const nix::remote::SchedMsg &msg) {11608 | ^11609 | -> bool11610../tests/oidc-test.cc:1153:16: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11611 1153 | }, [] {});11612 | ^11613 | -> void11614../tests/oidc-test.cc:1165:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11615 1165 | auto const id = commands.msgs(0).expect().assign_id();11616 | ^11617../tests/oidc-test.cc:1177:17: error: variable 'routeReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11618 1177 | nix::remote::StoreInfoRequest routeReq;11619 | ^11620 | const 11621../tests/oidc-test.cc:1182:40: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11622 1182 | std::jthread responder([&] {11623 | ^11624 | -> void11625../tests/oidc-test.cc:1189:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11626 1189 | if (!selected) return;11627 | ^ 11628 | {11629../tests/oidc-test.cc:1194:55: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11630 1194 | if (requestFrame.half_close()) break;11631 | ^ 11632 | {11633../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]11634 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11635 | ^11636../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]11637 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11638 | ^11639../tests/oidc-test.cc:1208:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11640 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11641 | ^ 11642 | {11643../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]11644 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11645 | ^11646../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]11647 1217 | relayCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11648 | ^11649../tests/oidc-test.cc:1224:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11650 1224 | std::jthread buildResponder([&] {11651 | ^11652 | -> void11653../tests/oidc-test.cc:1226:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11654 1226 | if (!dataStream->Read(&frame)) return;11655 | ^ 11656 | {11657../tests/oidc-test.cc:1228:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11658 1228 | if (!selected) return;11659 | ^ 11660 | {11661../tests/oidc-test.cc:1234:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11662 1234 | if (frame.half_close()) break;11663 | ^ 11664 | {11665../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]11666 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11667 | ^11668../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]11669 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11670 | ^11671../tests/oidc-test.cc:1246:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11672 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11673 | ^ 11674 | {11675../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]11676 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast<char>((payload.size() >> shift) & 0xff));11677 | ^11678../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]11679 1257 | buildCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));11680 | ^11681../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]11682 1275 | replacementCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));11683 | ^11684../tests/oidc-test.cc:1297:13: error: variable 'cancelledReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11685 1297 | nix::remote::StoreInfoRequest cancelledReq;11686 | ^11687 | const 11688../tests/oidc-test.cc:1311:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11689 1311 | if (!status.ok()) std::cerr << "control Finish: " << status.error_message() << "\n";11690 | ^ 11691 | {11692>>> /nix/store/pn43pdiv5xl5sjvlm9mw7w61zxjr8lmn-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/src/daemon/main.cc11693../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]11694 12 | #include <chrono>11695 | 11696 13 | #include <chrono>11697 | ^~~~~~~~~~~~~~~~~11698../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors]11699 90 | std::chrono::system_clock::time_point credentialExpiresAt{};11700 | ^~11701../src/daemon/main.cc:358:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11702 358 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) {11703 | ^11704 | -> bool11705../src/daemon/main.cc:371:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]11706 15 | const std::function<bool()> & cancelled,11707 | ^11708../src/daemon/main.cc:382:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11709 382 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status;11710 | ^ 11711 | {11712../src/daemon/main.cc:386:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11713 386 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"};11714 | ^ 11715 | {11716../src/daemon/main.cc:387:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11717 387 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"};11718 | ^ 11719 | {11720../src/daemon/main.cc:388:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11721 388 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"};11722 | ^ 11723 | {11724../src/daemon/main.cc:391:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors]11725 391 | nix::StorePath drvPath(request.drv_path());11726 | ^11727 | const 11728../src/daemon/main.cc:395:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11729 395 | auto const sendLog = [&](nixgrpc::BuildEvent event) {11730 | ^11731 | -> void11732../src/daemon/main.cc:396:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11733 396 | if (!emit(nixgrpc::toChunk<nix::remote::BuildDerivationChunk>(std::move(event))))11734 | ^11735 | {11736 397 | throw nixgrpc::CancelledWait("reverse build response closed");11737 | 11738../src/daemon/main.cc:405:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11739 405 | auto const retireUnacknowledged = [&] {11740 | ^11741 | -> void11742../src/daemon/main.cc:406:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11743 406 | if (afterFinish) std::exchange(afterFinish, nullptr)();11744 | ^ 11745 | {11746../src/daemon/main.cc:418:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11747 418 | if (status.ok() && !emit(chunk))11748 | ^11749 | {11750 419 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"};11751 | 11752../src/daemon/main.cc:420:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11753 420 | if (!status.ok()) retireUnacknowledged();11754 | ^ 11755 | {11756../src/daemon/main.cc:425:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11757 425 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call,11758 | ^11759../src/daemon/main.cc:428:24: note: nesting level increased to 111760 428 | return guarded([&] -> grpc::Status {11761 | ^11762../src/daemon/main.cc:429:13: note: +2, including nesting penalty of 1, nesting level increased to 211763 429 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11764 | ^11765../src/daemon/main.cc:429:32: note: +111766 429 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11767 | ^11768../src/daemon/main.cc:432:13: note: +2, including nesting penalty of 1, nesting level increased to 211769 432 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs",11770 | ^11771../src/daemon/main.cc:434:31: note: nesting level increased to 211772 434 | auto const live = [&] {11773 | ^11774../src/daemon/main.cc:436:21: note: +111775 436 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId);11776 | ^11777../src/daemon/main.cc:438:13: note: +2, including nesting penalty of 1, nesting level increased to 211778 438 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11779 | ^11780../src/daemon/main.cc:440:13: note: +2, including nesting penalty of 1, nesting level increased to 211781 440 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first)11782 | ^11783../src/daemon/main.cc:441:17: note: +111784 441 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11785 | ^11786../src/daemon/main.cc:442:48: note: +2, including nesting penalty of 1, nesting level increased to 211787 442 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair;11788 | ^11789../src/daemon/main.cc:443:55: note: +2, including nesting penalty of 1, nesting level increased to 211790 443 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs;11791 | ^11792../src/daemon/main.cc:462:17: note: nesting level increased to 211793 462 | CheckedSource(nix::Source & inner, std::function<bool()> valid)11794 | ^11795../src/daemon/main.cc:468:17: note: nesting level increased to 211796 468 | auto read(char * data, size_t length) -> size_t override {11797 | ^11798../src/daemon/main.cc:469:21: note: +3, including nesting penalty of 2, nesting level increased to 311799 469 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11800 | ^11801../src/daemon/main.cc:475:21: note: +3, including nesting penalty of 2, nesting level increased to 311802 475 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11803 | ^11804../src/daemon/main.cc:453:19: note: nesting level increased to 211805 453 | class CheckedSource : public nix::Source {11806 | ^11807../src/daemon/main.cc:453:19: note: nesting level increased to 211808../src/daemon/main.cc:453:19: note: nesting level increased to 211809../src/daemon/main.cc:453:19: note: nesting level increased to 211810../src/daemon/main.cc:453:19: note: nesting level increased to 211811../src/daemon/main.cc:487:68: note: +2, including nesting penalty of 1, nesting level increased to 211812 487 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair,11813 | ^11814../src/daemon/main.cc:488:68: note: +2, including nesting penalty of 1, nesting level increased to 211815 488 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs,11816 | ^11817../src/daemon/main.cc:489:17: note: nesting level increased to 211818 489 | [&] { return !live(); }, imported,11819 | ^11820../src/daemon/main.cc:490:17: note: nesting level increased to 211821 490 | [&] {11822 | ^11823../src/daemon/main.cc:497:21: note: +3, including nesting penalty of 2, nesting level increased to 311824 497 | if (!call.pipe->endWithoutTrailingData() || !live())11825 | ^11826../src/daemon/main.cc:497:62: note: +111827 497 | if (!call.pipe->endWithoutTrailingData() || !live())11828 | ^11829../src/daemon/main.cc:501:56: note: nesting level increased to 211830 501 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11831 | ^11832../src/daemon/main.cc:502:13: note: +2, including nesting penalty of 1, nesting level increased to 211833 502 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11834 | ^11835../src/daemon/main.cc:429:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors]11836 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated,11837 | ^11838../src/daemon/main.cc:430:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11839 430 | call.delegated.drvPath, call.delegated.assignId))11840 | ^11841 | {11842 431 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};11843 | 11844../src/daemon/main.cc:433:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11845 433 | nixgrpc::Role::write); !status.ok()) return status;11846 | ^ 11847 | {11848../src/daemon/main.cc:434:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11849 434 | auto const live = [&] {11850 | ^11851 | -> bool11852../src/daemon/main.cc:438:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11853 438 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"};11854 | ^ 11855 | {11856../src/daemon/main.cc:441:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11857 441 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"};11858 | ^ 11859 | {11860../src/daemon/main.cc:445:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors]11861 89 | nixgrpc::ZstdReaderSource<nixgrpc::ReverseUploadPipe, nix::remote::AddMultipleChunk> source(11862 | ^11863../src/daemon/main.cc:454:31: error: member 'inner' of type 'nix::Source &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]11864 454 | nix::Source & inner;11865 | ^11866../src/daemon/main.cc:469:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11867 469 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11868 | ^ 11869 | {11870../src/daemon/main.cc:475:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11871 475 | if (!valid()) throw nix::Error("reverse upload assignment revoked");11872 | ^ 11873 | {11874../src/daemon/main.cc:489:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11875 489 | [&] { return !live(); }, imported,11876 | ^11877 | -> bool11878../src/daemon/main.cc:490:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11879 490 | [&] {11880 | ^11881 | -> void11882../src/daemon/main.cc:497:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11883 497 | if (!call.pipe->endWithoutTrailingData() || !live())11884 | ^11885 | {11886 498 | throw nix::Error("reverse upload incomplete or assignment changed");11887 | 11888../src/daemon/main.cc:501:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11889 501 | coord.cache.publish(*localStore, imported, [&] { return !live(); });11890 | ^11891 | -> bool11892../src/daemon/main.cc:502:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11893 502 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};11894 | ^ 11895 | {11896../src/daemon/main.cc:645:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11897 645 | if (beforeApply) beforeApply();11898 | ^ 11899 | {11900../src/daemon/main.cc:654:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11901 654 | if (beforeApply) beforeApply();11902 | ^ 11903 | {11904../src/daemon/main.cc:656:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11905 656 | if (beforeApply) beforeApply();11906 | ^ 11907 | {11908../src/daemon/main.cc:720:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11909 720 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder)11910 | ^11911 | {11912 721 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"};11913 | 11914../src/daemon/main.cc:723:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11915 723 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"};11916 | ^ 11917 | {11918../src/daemon/main.cc:726:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors]11919 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk()11920 | ^11921../src/daemon/main.cc:727:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11922 727 | || drv.empty() || assignment == 0)11923 | ^11924 | {11925 728 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"};11926 | 11927../src/daemon/main.cc:730:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11928 730 | if (caller.kind != nixgrpc::Caller::Kind::named)11929 | ^11930 | {11931 731 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"};11932 | 11933../src/daemon/main.cc:733:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11934 733 | !status.ok()) return status;11935 | ^ 11936 | {11937../src/daemon/main.cc:735:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11938 735 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"};11939 | ^ 11940 | {11941../src/daemon/main.cc:736:35: error: an exception may be thrown in function '(lambda at ../src/daemon/main.cc:736:35)' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]11942 736 | auto const assigned = [this, pod = *pod, drv, assignment] {11943 | ^11944/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here11945 67 | throw bad_array_new_length();11946 | ^11947/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here11948 101 | std::__throw_bad_array_new_length();11949 | ^11950/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here11951 112 | return {allocate(__n), __n};11952 | ^11953/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least' here11954 280 | return __alloc.allocate_at_least(__n);11955 | ^11956/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<char>>' calls function 'allocate_at_least<std::allocator<char>>' here11957 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);11958 | ^11959/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:2580:25: note: frame #5: function '__init_copy_ctor_external' calls function '__allocate_at_least<std::allocator<char>>' here11960 2580 | auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__sz) + 1);11961 | ^11962/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/string:1007:7: note: frame #6: function 'basic_string' calls function '__init_copy_ctor_external' here11963 1007 | __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());11964 | ^11965../src/daemon/main.cc:736:35: note: frame #7: function '(lambda at ../src/daemon/main.cc:736:35)' calls function 'basic_string' here11966 736 | auto const assigned = [this, pod = *pod, drv, assignment] {11967 | ^11968../src/daemon/main.cc:736:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11969 736 | auto const assigned = [this, pod = *pod, drv, assignment] {11970 | ^11971 | -> bool11972../src/daemon/main.cc:740:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11973 740 | [&](uint64_t id) {11974 | ^11975 | -> Result11976../src/daemon/main.cc:740:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]11977 740 | [&](uint64_t id) {11978 | ^11979../src/daemon/main.cc:742:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11980 742 | [this](std::string_view path, uint64_t assignId) {11981 | ^11982 | -> std::optional<std::string>11983../src/daemon/main.cc:745:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]11984 745 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); },11985 | ^11986 | -> bool11987../src/daemon/main.cc:1016:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]11988 1016 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"};11989 | ^ 11990 | {11991../src/daemon/main.cc:1114:37: error: implicit conversion 'std::string *' (aka 'basic_string<char> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]11992 1114 | if (!missing.empty() && missingInput) {11993 | ^ 11994 | ( != nullptr)11995../src/daemon/main.cc:1174:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]11996 1174 | auto BuildDerivation(11997 | ^11998../src/daemon/main.cc:1179:24: note: nesting level increased to 111999 1179 | return guarded([&] -> grpc::Status {12000 | ^12001../src/daemon/main.cc:1183:13: note: +2, including nesting penalty of 1, nesting level increased to 212002 1183 | if (request->protocol() != nixcompat::kBuildProtocolWire12003 | ^12004../src/daemon/main.cc:1184:17: note: +112005 1184 | || request->build_mode() > static_cast<uint32_t>(nix::bmCheck)) {12006 | ^12007../src/daemon/main.cc:1191:17: note: +2, including nesting penalty of 1, nesting level increased to 212008 1191 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt;12009 | ^12010../src/daemon/main.cc:1190:51: note: +112011 1190 | auto const selectedPod = reverseRelay && coord.dispatcher12012 | ^12013../src/daemon/main.cc:1192:13: note: +2, including nesting penalty of 1, nesting level increased to 212014 1192 | if (selectedPod) {12015 | ^12016../src/daemon/main.cc:1195:21: note: nesting level increased to 312017 1195 | [&](uint64_t id) {12018 | ^12019../src/daemon/main.cc:1197:29: note: nesting level increased to 412020 1197 | [this](std::string_view drv, uint64_t assignment) {12021 | ^12022../src/daemon/main.cc:1200:34: note: nesting level increased to 312023 1200 | }, *request, [&](std::string_view wire) {12024 | ^12025../src/daemon/main.cc:1202:25: note: +4, including nesting penalty of 3, nesting level increased to 412026 1202 | if (!chunk.ParseFromArray(wire.data(), static_cast<int>(wire.size()))12027 | ^12028../src/daemon/main.cc:1203:103: note: +112029 1203 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())12030 | ^12031../src/daemon/main.cc:1205:25: note: +4, including nesting penalty of 3, nesting level increased to 412032 1205 | if (!writer->Write(chunk)) return false;12033 | ^12034../src/daemon/main.cc:1206:25: note: +4, including nesting penalty of 3, nesting level increased to 412035 1206 | if (chunk.has_done()) receivedDone = true;12036 | ^12037../src/daemon/main.cc:1208:24: note: nesting level increased to 312038 1208 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),12039 | ^12040../src/daemon/main.cc:1211:24: note: nesting level increased to 312041 1211 | }, [&] { return receivedDone.load(); });12042 | ^12043../src/daemon/main.cc:1213:21: note: +3, including nesting penalty of 2, nesting level increased to 312044 1213 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status;12045 | ^12046../src/daemon/main.cc:1212:36: note: +112047 1212 | return status.ok() && !receivedDone.load()12048 | ^12049../src/daemon/main.cc:1219:13: note: +2, including nesting penalty of 1, nesting level increased to 212050 1219 | if (!coord.builder) {12051 | ^12052../src/daemon/main.cc:1224:38: note: nesting level increased to 212053 1224 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void {12054 | ^12055../src/daemon/main.cc:1238:13: note: +2, including nesting penalty of 1, nesting level increased to 212056 1238 | for (auto & [name, path] : staticOutputs(*localStore, drv)) {12057 | ^12058../src/daemon/main.cc:1246:13: note: +2, including nesting penalty of 1, nesting level increased to 212059 1246 | if (auto const status =12060 | ^12061../src/daemon/main.cc:1247:27: note: nesting level increased to 212062 1247 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,12063 | ^12064../src/daemon/main.cc:1252:17: note: +3, including nesting penalty of 2, nesting level increased to 312065 1252 | if (!missingInput.empty()) {12066 | ^12067../src/daemon/main.cc:1195:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12068 1195 | [&](uint64_t id) {12069 | ^12070 | -> Result12071../src/daemon/main.cc:1195:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12072 1195 | [&](uint64_t id) {12073 | ^12074../src/daemon/main.cc:1197:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12075 1197 | [this](std::string_view drv, uint64_t assignment) {12076 | ^12077 | -> std::optional<std::string>12078../src/daemon/main.cc:1200:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12079 1200 | }, *request, [&](std::string_view wire) {12080 | ^12081 | -> bool12082../src/daemon/main.cc:1203:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12083 1203 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load())12084 | ^12085 | {12086 1204 | return false;12087 | 12088../src/daemon/main.cc:1205:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12089 1205 | if (!writer->Write(chunk)) return false;12090 | ^ 12091 | {12092../src/daemon/main.cc:1206:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12093 1206 | if (chunk.has_done()) receivedDone = true;12094 | ^ 12095 | {12096../src/daemon/main.cc:1208:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12097 1208 | }, [this, drv = request->drv_path(), assignment = request->assign_id(),12098 | ^12099 1209 | pod = *selectedPod] {12100 | -> bool12101../src/daemon/main.cc:1211:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12102 1211 | }, [&] { return receivedDone.load(); });12103 | ^12104 | -> bool12105../src/daemon/main.cc:1247:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12106 1247 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits,12107 | ^12108 | -> bool12109../src/daemon/main.cc:1507:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12110 1507 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) {12111 | ^12112 | -> auto12113../src/daemon/main.cc:1510:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12114 1510 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) {12115 | ^12116 | -> auto12117../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12118 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result12119 | ^12120../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 112121 522 | if (!parsed) {12122 | ^12123../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 112124 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : "";12125 | ^12126../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 112127 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) {12128 | ^12129../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 212130 528 | if (provider.issuer != iss) {12131 | ^12132../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 212133 531 | if (!parsed->has_expires_at()) {12134 | ^12135../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 212136 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) {12137 | ^12138../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 312139 538 | if (!err) {12140 | ^12141../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 212142 542 | if (err) {12143 | ^12144../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 212145 547 | if (sub.empty() || sub.contains('\0')) {12146 | ^12147../src/daemon/oidc.hh:547:29: note: +112148 547 | if (sub.empty() || sub.contains('\0')) {12149 | ^12150../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 212151 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace");12152 | ^12153../src/daemon/oidc.hh:553:32: note: +112154 553 | namespaceClaim && namespaceClaim->is_string()) {12155 | ^12156../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 212157 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12158 | ^12159../src/daemon/oidc.hh:556:82: note: +112160 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12161 | ^12162../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 312163 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12164 | ^12165../src/daemon/oidc.hh:557:67: note: +112166 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12167 | ^12168../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 312169 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12170 | ^12171../src/daemon/oidc.hh:560:66: note: +112172 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12173 | ^12174../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 212175 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12176 | ^12177../src/daemon/oidc.hh:564:91: note: +112178 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12179 | ^12180../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 312181 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12182 | ^12183../src/daemon/oidc.hh:565:65: note: +112184 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12185 | ^12186../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 212187 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) {12188 | ^12189../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 312190 570 | if (aud->is_string()) {12191 | ^12192../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 312193 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {12194 | ^12195../src/daemon/oidc.hh:572:64: note: +112196 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) {12197 | ^12198../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 212199 577 | if (parsed->has_issued_at()) {12200 | ^12201../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 212202 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"};12203 | ^12204../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12205 553 | namespaceClaim && namespaceClaim->is_string()) {12206 | ^12207 | ( != nullptr)12208../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12209 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) {12210 | ^12211 | ( != nullptr)12212../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12213 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) {12214 | ^12215../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12216 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) {12217 | ^12218../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12219 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12220 | ^12221../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12222 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) {12223 | ^12224 | ( != nullptr)12225../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]12226 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) {12227 | ^12228../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]12229 45 | std::chrono::seconds reverseMaxTokenLifetime{600};12230 | ^12231../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12232 44 | if (RAND_bytes(reinterpret_cast<unsigned char *>(key.data()), static_cast<int>(key.size())) != 1)12233 | ^12234../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]12235 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 ||12236 | ^12237../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]12238 96 | result.push_back(static_cast<char>(size >> (i * 8)));12239 | ^12240../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]12241 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12242 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12243../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token'12244 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12245 | ^~~~~12246../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId'12247 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation,12248 | ^~~~~~~~12249../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]12250 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);12251 | ^~~12252../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]12253 168 | size |= static_cast<uint32_t>(static_cast<unsigned char>(token[i])) << (i * 8);12254 | ^12255../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]12256 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)12257 | ^12258../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]12259 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0)12260 | ^12261../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]12262 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 ||12263 | ^12264../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12265 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt;12266 | ^ 12267 | {12268../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]12269 250 | unsigned char mac[EVP_MAX_MD_SIZE];12270 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12271../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12272 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast<int>(key.size()),12273 | ~^12274 | (12275 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12276 | == nullptr)12277../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12278 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12279 | ^12280../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]12281 253 | reinterpret_cast<const unsigned char *>(data.data()), data.size(), mac, &length) ||12282 | ^12283../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]12284 258 | return std::string(reinterpret_cast<const char *>(mac), macBytes);12285 | ^12286../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]12287 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12288 | ^12289../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning12290 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12291 | ^~~~~~~~~12292 | static_cast<const size_t>( )12293../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type12294 23 | static constexpr size_t maxFrameBytes = 64 * 1024;12295 | ^~12296 | static_cast<long>( )12297../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]12298 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12299 | ^12300../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning12301 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12302 | ^~~~~~~~~~~~~~~12303 | static_cast<const size_t>( )12304../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type12305 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024;12306 | ^~~~~~~~12307 | static_cast<long>( )12308../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]12309 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool12310 | ^12311../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]12312 53 | auto data(uint64_t id, std::string_view bytes) -> bool12313 | ^12314../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]12315 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024);12316 | ^12317../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]12318 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool12319 | ^12320../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]12321 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool12322 | ^12323 | const &12324../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12325 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false;12326 | ^ 12327 | {12328../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12329 81 | if (size > limit) return false;12330 | ^ 12331 | {12332../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12333 83 | cv.wait(lock, stop, [&] {12334 | ^12335 | -> bool12336../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]12337 84 | auto it = streams.find(id);12338 | ^12339../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]12340 87 | auto const it = streams.find(id);12341 | ^12342../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12343 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false;12344 | ^ 12345 | {12346../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]12347 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); }12348 | ^12349../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]12350 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }12351 | ^12352../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]12353 96 | auto acknowledge(uint64_t id) -> bool12354 | ^12355../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12356 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false;12357 | ^ 12358 | {12359../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12360 105 | if (!enqueue(std::move(msg))) return false;12361 | ^ 12362 | {12363../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]12364 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool12365 | ^12366 | const &12367../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]12368 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); });12369 | ^12370 | -> bool12371../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]12372 145 | auto finished(uint64_t id) -> bool12373 | ^12374../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12375 148 | if (streams.contains(id) && acknowledged.contains(id)) return true;12376 | ^ 12377 | {12378../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12379 150 | if (removed) cv.notify_all();12380 | ^ 12381 | {12382../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]12383 156 | void acknowledgementSent(uint64_t id)12384 | ^12385../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12386 159 | if (acknowledged.erase(id)) streams.erase(id);12387 | ^ 12388 | != 0u12389../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12390 159 | if (acknowledged.erase(id)) streams.erase(id);12391 | ^ 12392 | {12393../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]12394 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) {12395 | ^12396../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]12397 208 | auto terminal(uint64_t id, bool abort) -> bool12398 | ^12399../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12400 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12401 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12402 | .status= .prepared=12403../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12404 41 | struct Result12405 | ^12406../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]12407 65 | Role minRole;12408 | ^12409../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12410 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}};12411 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12412 | .status= .prepared=12413../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12414 41 | struct Result12415 | ^12416../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12417 85 | return {status, {}};12418 | ^~~~~~~~~~~~12419 | .status=.prepared=12420../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12421 41 | struct Result12422 | ^12423../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12424 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}};12425 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12426 | .status= .prepared=12427../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12428 41 | struct Result12429 | ^12430../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12431 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};12432 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12433 | .status= .prepared=12434../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12435 41 | struct Result12436 | ^12437../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12438 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}};12439 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12440 | .status= .prepared=12441../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12442 41 | struct Result12443 | ^12444../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12445 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}};12446 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12447 | .status= .prepared=12448../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12449 41 | struct Result12450 | ^12451../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12452 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}};12453 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12454 | .status= .prepared=12455../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12456 41 | struct Result12457 | ^12458../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12459 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}};12460 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12461 | .status= .prepared=12462../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12463 41 | struct Result12464 | ^12465../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12466 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),12467 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12468 | .status= .prepared=12469 123 | std::string(drvPath), assignId}};12470 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12471../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12472 41 | struct Result12473 | ^12474../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors]12475 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open),12476 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12477 | .session= .open=12478 123 | std::string(drvPath), assignId}};12479 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12480 | .drvPath= .assignId=12481../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here12482 33 | struct Prepared12483 | ^12484../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12485 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12486 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12487 | .status= .prepared=12488../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12489 41 | struct Result12490 | ^12491../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12492 189 | return {status, {}};12493 | ^~~~~~~~~~~~12494 | .status=.prepared=12495../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12496 41 | struct Result12497 | ^12498../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12499 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}};12500 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12501 | .status= .prepared=12502../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12503 41 | struct Result12504 | ^12505../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12506 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}};12507 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12508 | .status= .prepared=12509../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12510 41 | struct Result12511 | ^12512../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12513 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}};12514 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12515 | .status= .prepared=12516../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12517 41 | struct Result12518 | ^12519../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12520 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}};12521 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12522 | .status= .prepared=12523../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12524 41 | struct Result12525 | ^12526../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12527 218 | return {status, {}};12528 | ^~~~~~~~~~~~12529 | .status=.prepared=12530../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12531 41 | struct Result12532 | ^12533../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12534 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}};12535 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12536 | .status= .prepared=12537../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12538 41 | struct Result12539 | ^12540../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors]12541 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}};12542 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~12543 | .status= .prepared=12544../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here12545 41 | struct Result12546 | ^12547../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]12548 233 | Auth &auth;12549 | ^12550../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]12551 234 | ReverseRegistry ®istry;12552 | ^12553../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12554 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional<Event>12555 | ^12556../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 112557 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12558 | ^12559../src/daemon/reverse-inbound.hh:45:79: note: +112560 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0)12561 | ^12562../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 212563 47 | rejection = closed ? "session closed" : "bad frame header";12564 | ^12565../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 112566 51 | if (frame.has_open())12567 | ^12568../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 212569 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12570 | ^12571../src/daemon/reverse-inbound.hh:53:30: note: +112572 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams)12573 | ^12574../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 312575 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams";12576 | ^12577../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 212578 59 | if (!caller)12579 | ^12580../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 112581 69 | if (it == streams.end())12582 | ^12583../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 212584 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()12585 | ^12586../src/daemon/reverse-inbound.hh:74:17: note: +112587 74 | && finishedIds.erase(id))12588 | ^12589../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 112590 79 | if (frame.has_data())12591 | ^12592../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 212593 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12594 | ^12595../src/daemon/reverse-inbound.hh:81:59: note: +112596 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes)12597 | ^12598../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 112599 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12600 | ^12601../src/daemon/reverse-inbound.hh:88:97: note: +112602 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second)12603 | ^12604../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 112605 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12606 | ^12607../src/daemon/reverse-inbound.hh:93:72: note: +112608 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel())12609 | ^12610../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 212611 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; }12612 | ^12613../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]12614 50 | auto const id = frame.stream_id();12615 | ^12616../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]12617 68 | auto it = streams.find(id);12618 | ^12619../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12620 74 | && finishedIds.erase(id))12621 | ^ 12622 | ( != 0u)12623../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12624 74 | && finishedIds.erase(id))12625 | ^12626 | {12627 75 | return Event{.kind = Event::Kind::cancel, .streamId = id};12628 | 12629../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]12630 109 | auto finished(uint64_t id) -> bool12631 | ^12632../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12633 111 | if (cancelledIds.erase(id)) return true;12634 | ^ 12635 | != 0u12636../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12637 111 | if (cancelledIds.erase(id)) return true;12638 | ^ 12639 | {12640../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]12641 112 | if (!streams.erase(id)) return false;12642 | ~^ 12643 | == 0u12644../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12645 112 | if (!streams.erase(id)) return false;12646 | ^ 12647 | {12648../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]12649 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) {12650 | ^12651../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]12652 82 | auto it = sessions.find(std::string(workerId));12653 | ^12654../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]12655 92 | auto it = sessions.find(handle->workerId);12656 | ^12657../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]12658 107 | auto it = sessions.find(handle->workerId);12659 | ^12660../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]12661 130 | for (auto & [id, session] : sessions) {12662 | ^12663../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]12664 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select,12665 | ^12666../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 112667 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12668 | ^12669../src/daemon/reverse-relay.hh:49:21: note: +112670 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12671 | ^12672../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 112673 56 | if (!selection.status.ok()) return selection.status;12674 | ^12675../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 112676 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12677 | ^12678../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 112679 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12680 | ^12681../src/daemon/reverse-relay.hh:59:22: note: +112682 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12683 | ^12684../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 112685 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12686 | ^12687../src/daemon/reverse-relay.hh:60:27: note: +112688 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12689 | ^12690../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 112691 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12692 | ^12693../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 112694 64 | if (!selection.status.ok()) return selection.status;12695 | ^12696../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 112697 65 | if (!selection.prepared || selection.prepared->session != session)12698 | ^12699../src/daemon/reverse-relay.hh:65:33: note: +112700 65 | if (!selection.prepared || selection.prepared->session != session)12701 | ^12702../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 112703 67 | if (request.ByteSizeLong() > maxRequestBytes)12704 | ^12705../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 112706 70 | if (bytes.size() > maxRequestBytes)12707 | ^12708../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 112709 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12710 | ^12711../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 112712 75 | if (!status.ok()) return status;12713 | ^12714../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 112715 81 | ~Release() {12716 | ^12717../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 212718 84 | if (!completed) (void) transport.outgoing.cancel(id);12719 | ^12720../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 112721 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12722 | ^12723../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 112724 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) {12725 | ^12726../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 212727 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12728 | ^12729../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 212730 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12731 | ^12732../src/daemon/reverse-relay.hh:100:44: note: +112733 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12734 | ^12735../src/daemon/reverse-relay.hh:100:62: note: +112736 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12737 | ^12738../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 212739 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12740 | ^12741../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 112742 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12743 | ^12744../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 112745 111 | std::jthread monitor([&](std::stop_token stop) {12746 | ^12747../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 212748 113 | while (!stop.stop_requested()) {12749 | ^12750../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 312751 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)12752 | ^12753../src/daemon/reverse-relay.hh:115:22: note: +112754 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12755 | ^12756../src/daemon/reverse-relay.hh:115:60: note: +112757 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12758 | ^12759../src/daemon/reverse-relay.hh:115:80: note: +112760 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) {12761 | ^12762../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 312763 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });12764 | ^12765../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 112766 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) {12767 | ^12768../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 212769 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12770 | ^12771../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 212772 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12773 | ^12774../src/daemon/reverse-relay.hh:127:44: note: +112775 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12776 | ^12777../src/daemon/reverse-relay.hh:127:82: note: +112778 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12779 | ^12780../src/daemon/reverse-relay.hh:127:102: note: +112781 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))12782 | ^12783../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 312784 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};12785 | ^12786../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 212787 130 | if (frame.has_finish()) {12788 | ^12789../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 312790 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12791 | ^12792../src/daemon/reverse-relay.hh:131:55: note: +112793 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12794 | ^12795../src/daemon/reverse-relay.hh:131:75: note: +112796 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12797 | ^12798../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 312799 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12800 | ^12801../src/daemon/reverse-relay.hh:133:38: note: +112802 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};12803 | ^12804../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 312805 134 | if (resultReceived && resultReceived()) {12806 | ^12807../src/daemon/reverse-relay.hh:134:36: note: +112808 134 | if (resultReceived && resultReceived()) {12809 | ^12810../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 412811 135 | if (beforeAck) beforeAck();12812 | ^12813../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 412814 136 | if (!transport.outgoing.acknowledge(id))12815 | ^12816../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 212817 143 | while (true) {12818 | ^12819../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 312820 144 | if (!expected) {12821 | ^12822../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 412823 145 | if (pending.size() < 4) break;12824 | ^12825../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 412826 147 | for (unsigned i = 0; i != 4; ++i)12827 | ^12828../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 412829 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12830 | ^12831../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 312832 153 | if (pending.size() < *expected) break;12833 | ^12834../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 312835 154 | if (!receive(std::string_view(pending).substr(0, *expected)))12836 | ^12837../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 212838 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};12839 | ^12840../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 112841 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12842 | ^12843../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 112844 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};12845 | ^12846../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 112847 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12848 | ^12849../src/daemon/reverse-relay.hh:163:47: note: +112850 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12851 | ^12852../src/daemon/reverse-relay.hh:163:67: note: +112853 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))12854 | ^12855../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12856 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"};12857 | ^ 12858 | {12859../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12860 56 | if (!selection.status.ok()) return selection.status;12861 | ^ 12862 | {12863../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12864 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"};12865 | ^ 12866 | {12867../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12868 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"};12869 | ^ 12870 | {12871../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12872 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};12873 | ^ 12874 | {12875../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]12876 61 | auto const id = session->transport->nextStreamId.fetch_add(1);12877 | ^12878../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12879 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};12880 | ^ 12881 | {12882../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12883 64 | if (!selection.status.ok()) return selection.status;12884 | ^ 12885 | {12886../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12887 65 | if (!selection.prepared || selection.prepared->session != session)12888 | ^12889 | {12890 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"};12891 | 12892../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12893 67 | if (request.ByteSizeLong() > maxRequestBytes)12894 | ^12895 | {12896 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12897 | 12898../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12899 70 | if (bytes.size() > maxRequestBytes)12900 | ^12901 | {12902 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"};12903 | 12904../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12905 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12906 | ^ 12907 | {12908../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12909 75 | if (!status.ok()) return status;12910 | ^ 12911 | {12912../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]12913 77 | struct Release {12914 | ^12915../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]12916 77 | struct Release {12917 | ^12918 78 | ReverseTransport & transport;12919 79 | uint64_t id;12920 | 12921 | {}12922../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]12923 78 | ReverseTransport & transport;12924 | ^12925../src/daemon/reverse-relay.hh:81:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]12926 81 | ~Release() {12927 | ^12928/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here12929 67 | throw bad_array_new_length();12930 | ^12931/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here12932 101 | std::__throw_bad_array_new_length();12933 | ^12934/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here12935 112 | return {allocate(__n), __n};12936 | ^12937/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least' here12938 280 | return __alloc.allocate_at_least(__n);12939 | ^12940/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here12941 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);12942 | ^12943/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:330:25: note: frame #5: function '__split_buffer' calls function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here12944 330 | auto __allocation = std::__allocate_at_least(__alloc_, __cap);12945 | ^12946/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:465:47: note: frame #6: function 'emplace_back<nix::remote::ReverseFarmMsg *&>' calls function '__split_buffer' here12947 465 | __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc_);12948 | ^12949/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:2178:5: note: frame #7: function '__add_back_capacity' calls function 'emplace_back<nix::remote::ReverseFarmMsg *&>' here12950 2178 | __map_.emplace_back(__pt);12951 | ^12952/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:1605:5: note: frame #8: function 'push_back' calls function '__add_back_capacity' here12953 1605 | __add_back_capacity();12954 | ^12955../src/daemon/reverse-frames.hh:199:9: note: frame #9: function 'enqueue' calls function 'push_back' here12956 199 | queue.push_back(std::move(msg));12957 | ^12958../src/daemon/reverse-frames.hh:234:14: note: frame #10: function 'terminal' calls function 'enqueue' here12959 234 | if (!enqueue(std::move(msg))) {12960 | ^12961../src/daemon/reverse-frames.hh:94:47: note: frame #11: function 'cancel' calls function 'terminal' here12962 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }12963 | ^12964../src/daemon/reverse-relay.hh:84:40: note: frame #12: function '~Release' calls function 'cancel' here12965 84 | if (!completed) (void) transport.outgoing.cancel(id);12966 | ^12967../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12968 84 | if (!completed) (void) transport.outgoing.cancel(id);12969 | ^ 12970 | {12971../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12972 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12973 | ^ 12974 | {12975../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12976 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12977 | ^12978../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]12979 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast<char>((size >> (8 * i)) & 0xff));12980 | ^12981../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12982 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};12983 | ^ 12984 | {12985../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12986 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned()))12987 | ^12988 | {12989 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"};12990 | 12991../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12992 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes)))12993 | ^12994 | {12995 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"};12996 | 12997../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]12998 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"};12999 | ^ 13000 | {13001../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13002 111 | std::jthread monitor([&](std::stop_token stop) {13003 | ^13004 | const 13005../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13006 111 | std::jthread monitor([&](std::stop_token stop) {13007 | ^13008 | -> auto13009../src/daemon/reverse-relay.hh:111:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13010 111 | std::jthread monitor([&](std::stop_token stop) {13011 | ^13012 | const &13013../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13014 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13015 | ^13016../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13017 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13018 | ^13019 | -> auto13020../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13021 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};13022 | ^ 13023 | {13024../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13025 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())))13026 | ^13027 | {13028 128 | return {grpc::StatusCode::UNAVAILABLE,13029 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"};13030 | 13031../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13032 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))13033 | ^13034 | {13035 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};13036 | 13037../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13038 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"};13039 | ^ 13040 | {13041../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13042 135 | if (beforeAck) beforeAck();13043 | ^ 13044 | {13045../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13046 136 | if (!transport.outgoing.acknowledge(id))13047 | ^13048 | {13049 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"};13050 | 13051../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13052 145 | if (pending.size() < 4) break;13053 | ^ 13054 | {13055../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13056 147 | for (unsigned i = 0; i != 4; ++i)13057 | ^13058 | {13059 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13060 | 13061../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13062 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13063 | ^~~13064../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13065 148 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending[i])) << (8 * i);13066 | ^13067../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13068 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};13069 | ^ 13070 | {13071../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13072 153 | if (pending.size() < *expected) break;13073 | ^ 13074 | {13075../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13076 154 | if (!receive(std::string_view(pending).substr(0, *expected)))13077 | ^13078 | {13079 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"};13080 | 13081../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13082 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"};13083 | ^ 13084 | {13085../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13086 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"};13087 | ^ 13088 | {13089../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13090 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"};13091 | ^ 13092 | {13093../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13094 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))13095 | ^13096 | {13097 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"};13098 | 13099../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13100 169 | ReverseGateway & gateway;13101 | ^13102../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13103 170 | ReverseRegistry & registry;13104 | ^13105../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13106 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool13107 | ^13108../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 113109 52 | if (!event) { rejection = inbound.lastRejection(); return false; }13110 | ^13111../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 113112 54 | switch (event->kind) {13113 | ^13114../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 213115 56 | if (!event->caller) { rejection = "open without caller"; return false; }13116 | ^13117../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 213118 59 | if (frame.open().method() == "UploadBuildInputs") {13119 | ^13120../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 313121 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {13122 | ^13123../src/daemon/reverse-request.hh:61:30: note: +113124 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) {13125 | ^13126../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 313127 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {13128 | ^13129../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 213130 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; }13131 | ^13132../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 213133 77 | if (auto it = uploads.find(id); it != uploads.end())13134 | ^13135../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 213136 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 413137 | ^13138../src/daemon/reverse-request.hh:82:17: note: +113139 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; }13140 | ^13141../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 213142 84 | if (!pending.length && pending.wire.size() >= 4) {13143 | ^13144../src/daemon/reverse-request.hh:84:33: note: +113145 84 | if (!pending.length && pending.wire.size() >= 4) {13146 | ^13147../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 313148 86 | for (unsigned i = 0; i != 4; ++i)13149 | ^13150../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 313151 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; }13152 | ^13153../src/daemon/reverse-request.hh:91:36: note: +113154 91 | return !pending.length || pending.wire.size() <= static_cast<size_t>(*pending.length) + 4;13155 | ^13156../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 213157 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13158 | ^13159../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 213160 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {13161 | ^13162../src/daemon/reverse-request.hh:96:60: note: +113163 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) {13164 | ^13165../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 213166 108 | if (auto it = uploads.find(id); it != uploads.end()) {13167 | ^13168../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 213169 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13170 | ^13171../src/daemon/reverse-request.hh:112:29: note: +113172 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13173 | ^13174../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 213175 114 | if (ready && ready->id == id) ready.reset();13176 | ^13177../src/daemon/reverse-request.hh:114:23: note: +113178 114 | if (ready && ready->id == id) ready.reset();13179 | ^13180../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13181 48 | std::scoped_lock lock(mutex);13182 | ^13183 | const 13184../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13185 53 | auto const id = event->streamId;13186 | ^13187../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13188 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] {13189 | ^13190 | -> bool13191../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13192 77 | if (auto it = uploads.find(id); it != uploads.end())13193 | ^13194../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13195 77 | if (auto it = uploads.find(id); it != uploads.end())13196 | ^13197 | {13198 78 | return it->second->feed(frame.data().data());13199 | 13200../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13201 86 | for (unsigned i = 0; i != 4; ++i)13202 | ^13203 | {13204 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13205 | 13206../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors]13207 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13208 | ^~~13209../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13210 87 | length |= static_cast<uint32_t>(static_cast<unsigned char>(pending.wire[i])) << (8 * i);13211 | ^13212../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13213 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13214 | ^13215../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13216 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish();13217 | ^ 13218 | {13219../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13220 95 | auto it = requests.find(id);13221 | ^13222../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13223 108 | if (auto it = uploads.find(id); it != uploads.end()) {13224 | ^13225../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13226 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset();13227 | ^ 13228 | {13229../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13230 114 | if (ready && ready->id == id) ready.reset();13231 | ^ 13232 | {13233../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13234 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; }13235 | ^13236 | const 13237../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13238 123 | [[nodiscard]] auto takeReady() -> std::optional<Ready> { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); }13239 | ^13240 | const 13241../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13242 124 | [[nodiscard]] auto takeUploadReady() -> std::optional<Upload> { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); }13243 | ^13244 | const 13245../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13246 130 | std::scoped_lock lock(mutex);13247 | ^13248 | const 13249../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13250 131 | for (auto & [id, pipe] : uploads) pipe->cancel();13251 | ^13252../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13253 131 | for (auto & [id, pipe] : uploads) pipe->cancel();13254 | ^ 13255 | {13256../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13257 141 | [[nodiscard]] auto finished(uint64_t id) -> bool {13258 | ^13259../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13260 142 | std::scoped_lock lock(mutex);13261 | ^13262 | const 13263../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13264 148 | std::scoped_lock lock(mutex);13265 | ^13266 | const 13267../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13268 149 | for (auto & [id, pipe] : uploads) pipe->cancel();13269 | ^13270../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13271 149 | for (auto & [id, pipe] : uploads) pipe->cancel();13272 | ^ 13273 | {13274../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13275 32 | [[nodiscard]] auto open(uint64_t id) -> bool13276 | ^13277../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13278 51 | auto it = streams.find(frame.stream_id());13279 | ^13280../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13281 56 | if (!cancelled.contains(frame.stream_id())) return false;13282 | ^ 13283 | {13284../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13285 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes;13286 | ^ 13287 | {13288../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13289 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool13290 | ^13291../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13292 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool13293 | ^13294 | const &13295../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13296 104 | auto pending = [&] {13297 | ^13298 | -> std::__deque_iterator<nix::remote::ReverseWorkerMsg, nix::remote::ReverseWorkerMsg *, nix::remote::ReverseWorkerMsg &, nix::remote::ReverseWorkerMsg **, long>13299../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors]13300 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });13301 | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~13302 | std::ranges::find_if queue13303../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13304 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; });13305 | ^13306 | -> auto13307../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13308 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); });13309 | ^13310 | -> bool13311../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13312 111 | auto it = pending();13313 | ^13314../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13315 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool13316 | ^13317../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13318 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id);13319 | ^ 13320 | {13321../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13322 168 | [[nodiscard]] auto finished(uint64_t id) -> bool13323 | ^13324../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13325 171 | auto it = streams.find(id);13326 | ^13327../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]13328 42 | if (context) {13329 | ^ 13330 | != nullptr13331../src/daemon/reverse-session.hh:54:22: error: member 'identity' of type 'WorkerIdentity &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13332 54 | WorkerIdentity & identity;13333 | ^13334../src/daemon/reverse-session.hh:55:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13335 55 | ReverseRegistry & registry;13336 | ^13337../src/daemon/reverse-session.hh:56:12: error: member 'workerAuth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13338 56 | Auth & workerAuth;13339 | ^13340../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13341 66 | auto Register(13342 | ^13343../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 113344 75 | if (!auth) {13345 | ^13346../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 113347 79 | if (transports.size() != 1 ||13348 | ^13349../src/daemon/reverse-session.hh:79:36: note: +113350 79 | if (transports.size() != 1 ||13351 | ^13352../src/daemon/reverse-session.hh:80:94: note: +113353 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" &&13354 | ^13355../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 113356 90 | if (caller.kind != Caller::Kind::named) {13357 | ^13358../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 113359 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) {13360 | ^13361../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 113362 100 | if (first == last || std::next(first) != last) {13363 | ^13364../src/daemon/reverse-session.hh:100:27: note: +113365 100 | if (first == last || std::next(first) != last) {13366 | ^13367../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 113368 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {13369 | ^13370../src/daemon/reverse-session.hh:105:40: note: +113371 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) {13372 | ^13373../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 113374 111 | if (!stream->Read(&msg)) {13375 | ^13376../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 113377 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET13378 | ^13379../src/daemon/reverse-session.hh:115:13: note: +113380 115 | || !msg.credential().empty()) {13381 | ^13382../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113383 118 | if (msg.protocol() != reverseProtocolVersion) {13384 | ^13385../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 113386 122 | if (!bound) {13387 | ^13388../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 113389 128 | if (!sessionKey) {13390 | ^13391../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 113392 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },13393 | ^13394../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 113395 136 | if (!handle) {13396 | ^13397../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 113398 144 | ~Cleanup()13399 | ^13400../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 113401 139 | struct Cleanup13402 | ^13403../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 113404../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 113405 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13406 | ^13407../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 213408 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {13409 | ^13410../src/daemon/reverse-session.hh:160:43: note: +113411 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) {13412 | ^13413../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 313414 161 | cv.wait_until(lock, stop, deadline, [] { return false; });13415 | ^13416../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 213417 163 | if (!stop.stop_requested()) {13418 | ^13419../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 113420 171 | if (!registry.current(*handle) || !stream->Write(ack)) {13421 | ^13422../src/daemon/reverse-session.hh:171:40: note: +113423 171 | if (!registry.current(*handle) || !stream->Write(ack)) {13424 | ^13425../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 113426 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13427 | ^13428../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 213429 179 | while (transport->outgoing.waitTake(frame, stop)) {13430 | ^13431../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 313432 180 | if (!registry.current(*handle) || !stream->Write(frame)) {13433 | ^13434../src/daemon/reverse-session.hh:180:48: note: +113435 180 | if (!registry.current(*handle) || !stream->Write(frame)) {13436 | ^13437../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 313438 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());13439 | ^13440../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 113441 187 | while (stream->Read(&msg)) {13442 | ^13443../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 213444 188 | if (!msg.credential().empty()) {13445 | ^13446../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 313447 191 | ? identity.renew(msg.credential(), bound->workerId)13448 | ^13449../src/daemon/reverse-session.hh:190:52: note: +113450 190 | && msg.worker_id().empty() && registry.current(*handle)13451 | ^13452../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 313453 193 | if (!renewed) {13454 | ^13455../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 213456 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {13457 | ^13458../src/daemon/reverse-session.hh:205:44: note: +113459 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) {13460 | ^13461../src/daemon/reverse-session.hh:104:9: error: variable 'value' of type 'std::string_view' (aka 'basic_string_view<char>') can be declared 'const' [misc-const-correctness,-warnings-as-errors]13462 104 | std::string_view value(first->second.data(), first->second.size());13463 | ^13464 | const 13465../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13466 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); },13467 | ^13468 | -> void13469../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13470 139 | struct Cleanup13471 | ^13472../src/daemon/reverse-session.hh:139:16: error: class 'Cleanup' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]13473 139 | struct Cleanup13474 | ^13475../src/daemon/reverse-session.hh:141:31: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13476 141 | ReverseRegistry & registry;13477 | ^13478../src/daemon/reverse-session.hh:144:13: error: an exception may be thrown in function '~Cleanup' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]13479 144 | ~Cleanup()13480 | ^13481/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:74:3: note: frame #0: unhandled exception of type 'bad_function_call' may be thrown in function '__throw_bad_function_call' here13482 74 | throw bad_function_call();13483 | ^13484/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:273:7: note: frame #1: function 'operator()' calls function '__throw_bad_function_call' here13485 273 | std::__throw_bad_function_call();13486 | ^13487/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__functional/function.h:772:10: note: frame #2: function 'operator()' calls function 'operator()' here13488 772 | return __f_(std::forward<_ArgTypes>(__arg)...);13489 | ^13490../src/daemon/reverse-registry.hh:118:32: note: frame #3: function 'disconnected' calls function 'operator()' here13491 118 | removed->cancel();13492 | ^13493../src/daemon/reverse-session.hh:147:17: note: frame #4: function '~Cleanup' calls function 'disconnected' here13494 147 | registry.disconnected(handle, false);13495 | ^13496../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors]13497 149 | } cleanup{registry, *handle, cancellation};13498 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~13499 | .registry=.handle= .cancellation=13500../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here13501 139 | struct Cleanup13502 | ^13503../src/daemon/reverse-session.hh:156:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13504 156 | std::condition_variable_any cv;13505 | ^13506../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13507 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13508 | ^13509 | const 13510../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13511 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13512 | ^13513 | -> void13514../src/daemon/reverse-session.hh:158:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13515 158 | std::jthread expiry([&, cancellation](std::stop_token stop) {13516 | ^13517 | const &13518../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13519 161 | cv.wait_until(lock, stop, deadline, [] { return false; });13520 | ^13521 | -> bool13522../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13523 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13524 | ^13525 | const 13526../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13527 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13528 | ^13529 | -> void13530../src/daemon/reverse-session.hh:177:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13531 177 | std::jthread writer([&, cancellation](std::stop_token stop) {13532 | ^13533 | const &13534../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13535 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id());13536 | ^ 13537 | {13538../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13539 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13540 | ^13541../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]13542 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13543 | ^13544 | -> bool13545../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]13546 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) {13547 | ^13548../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13549 33 | if (assigned && !assigned()) return false;13550 | ^ 13551 | {13552../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13553 35 | std::scoped_lock lock(mutex);13554 | ^13555 | const 13556../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13557 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false;13558 | ^ 13559 | {13560../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13561 42 | if (!ok) cancel();13562 | ^ 13563 | {13564../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13565 49 | std::scoped_lock lock(mutex);13566 | ^13567 | const 13568../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13569 68 | if (closed) return false;13570 | ^ 13571 | {13572../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13573 79 | if (ended || !chunks.empty()) break;13574 | ^ 13575 | {13576../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13577 80 | cv.wait_for(lock, std::chrono::milliseconds(25));13578 | ^13579../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13580 82 | if (chunks.empty()) return false;13581 | ^ 13582 | {13583../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13584 92 | std::scoped_lock lock(mutex);13585 | ^13586 | const 13587../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors]13588 103 | cv.wait_for(lock, std::chrono::milliseconds(25));13589 | ^13590../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13591 113 | if (!ended || closed || !chunks.empty()) return false;13592 | ^ 13593 | {13594../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13595 120 | std::scoped_lock lock(mutex);13596 | ^13597 | const 13598../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock<std::mutex>' can be declared 'const' [misc-const-correctness,-warnings-as-errors]13599 129 | std::scoped_lock lock(mutex);13600 | ^13601 | const 13602../src/daemon/reverse-upload-relay.hh:33:24: error: function 'call' has cognitive complexity of 53 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]13603 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned,13604 | ^13605../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 113606 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes13607 | ^13608../src/daemon/reverse-upload-relay.hh:37:63: note: +113609 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13610 | ^13611../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 113612 40 | if (!selection.status.ok()) return selection.status;13613 | ^13614../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 113615 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13616 | ^13617../src/daemon/reverse-upload-relay.hh:41:65: note: +113618 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13619 | ^13620../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 113621 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13622 | ^13623../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 113624 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13625 | ^13626../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 113627 48 | if (!selection.status.ok()) return selection.status;13628 | ^13629../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 113630 49 | if (!selection.prepared || selection.prepared->session != session)13631 | ^13632../src/daemon/reverse-upload-relay.hh:49:33: note: +113633 49 | if (!selection.prepared || selection.prepared->session != session)13634 | ^13635../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 113636 53 | if (!delegated || !ReverseUpload::first(*delegated, first)13637 | ^13638../src/daemon/reverse-upload-relay.hh:55:13: note: +113639 55 | || selection.prepared->assignId != first.assign_id())13640 | ^13641../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 113642 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13643 | ^13644../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 113645 60 | if (!status.ok()) return status;13646 | ^13647../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 113648 65 | ~Release() {13649 | ^13650../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 213651 66 | if (!completed) (void) transport.outgoing.cancel(id);13652 | ^13653../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 113654 76 | std::jthread monitor([&](std::stop_token stop) {13655 | ^13656../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 213657 78 | while (!stop.stop_requested()) {13658 | ^13659../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 313660 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session)13661 | ^13662../src/daemon/reverse-upload-relay.hh:80:21: note: +113663 80 | || !assigned()) {13664 | ^13665../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 313666 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13667 | ^13668../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 113669 90 | auto const live = [&] {13670 | ^13671../src/daemon/reverse-upload-relay.hh:91:98: note: +113672 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned();13673 | ^13674../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 113675 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool {13676 | ^13677../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 213678 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13679 | ^13680../src/daemon/reverse-upload-relay.hh:95:27: note: +113681 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13682 | ^13683../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 213684 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13685 | ^13686../src/daemon/reverse-upload-relay.hh:97:30: note: +113687 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13688 | ^13689../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 213690 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13691 | ^13692../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 213693 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13694 | ^13695../src/daemon/reverse-upload-relay.hh:100:25: note: +113696 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13697 | ^13698../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 213699 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13700 | ^13701../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 313702 102 | if (!live() || !transport.outgoing.waitData(id,13703 | ^13704../src/daemon/reverse-upload-relay.hh:102:29: note: +113705 102 | if (!live() || !transport.outgoing.waitData(id,13706 | ^13707../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 113708 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13709 | ^13710../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 113711 108 | while (read(next)) {13712 | ^13713../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 213714 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13715 | ^13716../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 213717 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13718 | ^13719../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 113720 113 | if (!live() || !transport.outgoing.halfClose(id))13721 | ^13722../src/daemon/reverse-upload-relay.hh:113:21: note: +113723 113 | if (!live() || !transport.outgoing.halfClose(id))13724 | ^13725../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 113726 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13727 | ^13728../src/daemon/reverse-upload-relay.hh:116:75: note: +113729 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13730 | ^13731../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 113732 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13733 | ^13734../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 113735 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13736 | ^13737../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 113738 120 | if (!transport.responses.finished(id))13739 | ^13740../src/daemon/reverse-upload-relay.hh:34:84: error: the parameter 'first' of type 'nix::remote::UploadBuildInputsChunk' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]13741 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status13742 | ^13743 | const &13744../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13745 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0)13746 | ^13747 | {13748 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"};13749 | 13750../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13751 40 | if (!selection.status.ok()) return selection.status;13752 | ^ 13753 | {13754../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13755 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport)13756 | ^13757 | {13758 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"};13759 | 13760../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13761 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13762 | ^ 13763 | {13764../src/daemon/reverse-upload-relay.hh:45:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]13765 45 | auto const id = session->transport->nextStreamId.fetch_add(1);13766 | ^13767../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13768 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"};13769 | ^ 13770 | {13771../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13772 48 | if (!selection.status.ok()) return selection.status;13773 | ^ 13774 | {13775../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13776 49 | if (!selection.prepared || selection.prepared->session != session)13777 | ^13778 | {13779 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"};13780 | 13781../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13782 55 | || selection.prepared->assignId != first.assign_id())13783 | ^13784 | {13785 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"};13786 | 13787../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13788 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"};13789 | ^ 13790 | {13791../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13792 60 | if (!status.ok()) return status;13793 | ^ 13794 | {13795../src/daemon/reverse-upload-relay.hh:61:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors]13796 61 | struct Release {13797 | ^13798../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]13799 61 | struct Release {13800 | ^13801 62 | ReverseTransport & transport;13802 63 | uint64_t id;13803 | 13804 | {}13805../src/daemon/reverse-upload-relay.hh:62:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]13806 62 | ReverseTransport & transport;13807 | ^13808../src/daemon/reverse-upload-relay.hh:65:13: error: an exception may be thrown in function '~Release' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]13809 65 | ~Release() {13810 | ^13811/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__new/exceptions.h:67:3: note: frame #0: unhandled exception of type 'bad_array_new_length' may be thrown in function '__throw_bad_array_new_length' here13812 67 | throw bad_array_new_length();13813 | ^13814/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:101:7: note: frame #1: function 'allocate' calls function '__throw_bad_array_new_length' here13815 101 | std::__throw_bad_array_new_length();13816 | ^13817/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator.h:112:13: note: frame #2: function 'allocate_at_least' calls function 'allocate' here13818 112 | return {allocate(__n), __n};13819 | ^13820/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocator_traits.h:280:14: note: frame #3: function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least' here13821 280 | return __alloc.allocate_at_least(__n);13822 | ^13823/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__memory/allocate_at_least.h:26:10: note: frame #4: function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' calls function 'allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here13824 26 | return std::allocator_traits<_Alloc>::allocate_at_least(__alloc, __n);13825 | ^13826/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:330:25: note: frame #5: function '__split_buffer' calls function '__allocate_at_least<std::allocator<nix::remote::ReverseFarmMsg *>>' here13827 330 | auto __allocation = std::__allocate_at_least(__alloc_, __cap);13828 | ^13829/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/__split_buffer:465:47: note: frame #6: function 'emplace_back<nix::remote::ReverseFarmMsg *&>' calls function '__split_buffer' here13830 465 | __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc_);13831 | ^13832/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:2178:5: note: frame #7: function '__add_back_capacity' calls function 'emplace_back<nix::remote::ReverseFarmMsg *&>' here13833 2178 | __map_.emplace_back(__pt);13834 | ^13835/nix/store/x1x1gm4vkysqvi93wndbzskipgqy0nc0-libcxx-21.1.6+apple-sdk-26.5/include/c++/v1/deque:1605:5: note: frame #8: function 'push_back' calls function '__add_back_capacity' here13836 1605 | __add_back_capacity();13837 | ^13838../src/daemon/reverse-frames.hh:199:9: note: frame #9: function 'enqueue' calls function 'push_back' here13839 199 | queue.push_back(std::move(msg));13840 | ^13841../src/daemon/reverse-frames.hh:234:14: note: frame #10: function 'terminal' calls function 'enqueue' here13842 234 | if (!enqueue(std::move(msg))) {13843 | ^13844../src/daemon/reverse-frames.hh:94:47: note: frame #11: function 'cancel' calls function 'terminal' here13845 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); }13846 | ^13847../src/daemon/reverse-upload-relay.hh:66:40: note: frame #12: function '~Release' calls function 'cancel' here13848 66 | if (!completed) (void) transport.outgoing.cancel(id);13849 | ^13850../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13851 66 | if (!completed) (void) transport.outgoing.cancel(id);13852 | ^ 13853 | {13854../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors]13855 70 | } release{transport, id};13856 | ^~~~~~~~~~~~~~~13857 | .transport=.id=13858../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here13859 61 | struct Release {13860 | ^13861../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]13862 75 | std::condition_variable_any cv;13863 | ^13864../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]13865 76 | std::jthread monitor([&](std::stop_token stop) {13866 | ^13867 | const 13868../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]13869 76 | std::jthread monitor([&](std::stop_token stop) {13870 | ^13871 | -> void13872../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]13873 76 | std::jthread monitor([&](std::stop_token stop) {13874 | ^13875 | const &13876../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]13877 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13878 | ^13879../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]13880 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; });13881 | ^13882 | -> bool13883../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]13884 90 | auto const live = [&] {13885 | ^13886 | -> bool13887../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13888 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false;13889 | ^ 13890 | {13891../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13892 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false;13893 | ^ 13894 | {13895../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13896 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13897 | ^ 13898 | {13899../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]13900 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13901 | ^~~13902../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]13903 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13904 | ^13905../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]13906 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast<char>((wire.size() >> (8 * i)) & 0xff);13907 | ^13908../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13909 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false;13910 | ^ 13911 | {13912../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13913 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes)13914 | ^13915 | {13916 102 | if (!live() || !transport.outgoing.waitData(id,13917 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13918 | 13919../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13920 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false;13921 | ^ 13922 | {13923../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13924 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13925 | ^ 13926 | {13927../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13928 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"};13929 | ^ 13930 | {13931../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13932 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"};13933 | ^ 13934 | {13935../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13936 113 | if (!live() || !transport.outgoing.halfClose(id))13937 | ^13938 | {13939 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"};13940 | 13941../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13942 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live())13943 | ^13944 | {13945 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"};13946 | 13947../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13948 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"};13949 | ^ 13950 | {13951../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13952 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"};13953 | ^ 13954 | {13955../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13956 120 | if (!transport.responses.finished(id))13957 | ^13958 | {13959 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"};13960 | 13961../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]13962 127 | ReverseGateway & gateway;13963 | ^13964../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]13965 128 | ReverseRegistry & registry;13966 | ^13967../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]13968 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13969 | ^13970../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning13971 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13972 | ^~~~~~~~~~~13973 | static_cast<const size_t>( )13974../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type13975 22 | static constexpr size_t maxChunkBytes = 1024 * 1024;13976 | ^~~~13977 | static_cast<long>( )13978../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13979 49 | if (failed || bytes.empty() || !consume) return fail();13980 | ^ 13981 | {13982../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]13983 53 | buffer.append(bytes.data(), count);13984 | ~~~~~~^~~~13985../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13986 57 | for (unsigned i = 0; i < 4; ++i)13987 | ^13988 | {13989 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13990 | 13991../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]13992 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13993 | ^~~13994../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]13995 58 | length |= static_cast<uint32_t>(static_cast<unsigned char>(buffer[i])) << (8 * i);13996 | ^13997../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]13998 59 | if (length == 0 || length > maxChunkBytes) return fail();13999 | ^ 14000 | {14001../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors]14002 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast<int>(*expected))14003 | ^14004../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14005 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame)))14006 | ^14007 | {14008 66 | return fail();14009 | 14010../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]14011 323 | lastAssignId = (static_cast<uint64_t>(entropy()) << 32) | entropy();14012 | ^14013../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]14014 371 | auto const it = workerIds.find(std::string(addr));14015 | ^14016../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]14017 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience14018 | ^14019../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors]14020 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {14021 | ^14022 | -> bool14023../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]14024 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) {14025 | ^14026../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]14027 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14028 | ^14029../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]14030 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14031 | ^14032../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]14033 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14034 | ^14035../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]14036 43 | if (i == 8 || i == 13 || i == 18 || i == 23) {14037 | ^14038../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]14039 44 | if (uid[i] != '-') {14040 | ^~~14041../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]14042 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14043 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~14044 | < || > && < || >14045../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]14046 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14047 | ^~~14048../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]14049 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14050 | ^~~14051../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]14052 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14053 | ^~~14054../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]14055 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) {14056 | ^~~14057../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]14058 96 | auto const & id = *result.identity;14059 | ^14060../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14061 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime14062 | ^~~~~~~~~~~~14063../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14064 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) {14065 | ^~~~~~~~~~~~14066../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14067 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid;14068 | ^~~~~~~~~14069../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]14070 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt};14071 | ^~~~~~~~~~~~14072../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]14073 327 | char extra;14074 | ^ 14075 | = 014076../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14077 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame");14078 | ^ 14079 | {14080../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14081 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data");14082 | ^ 14083 | {14084../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]14085 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data");14086 | ^ 14087 | {14088Errors encountered while running clang-tidy14089FAILED: [code=1] meson-internal__clang-tidy 14090/nix/store/sn59lgid7r01w49nyz81hcp1rjmpby3m-meson-1.12.1/bin/meson --internal clangtidy /private/var/tb/6/scratch/88fd9d11b83d940e/build/source /private/var/tb/6/scratch/88fd9d11b83d940e/build/source/build --color always14091ninja: build stopped: subcommand failed.