Consolidation step 4 of 8: proto-rpc — the protoc plugin now emits C++ module units [androidbuild] [iosbuild]#45
Merged
Conversation
…+ module units [androidbuild] [iosbuild] The generated RPC stubs become named sub-modules (server stubs are pure interfaces; client stubs import streamr.protorpc.RpcCommunicator), which removes the last textual dependency chain: stub headers no longer drag RpcCommunicator.hpp and the proto-rpc+logger header web into consumers. proto-rpc's six public headers become named sub-modules per the settled architecture; include/ deleted. trackerless-network no longer duplicates the dht stubs (one-definition-rule hazard as modules). Generated *.pb.h message code intentionally stays textual per the consolidation decision. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidation C-4: streamr-proto-rpc — the protoc plugin now generates C++ module units
Fourth consolidation step (MODERNIZATION.md Phase 2.6), following the settled architecture from C-3: one named sub-module per former header, no umbrella module, tests and consumers import exactly the sub-modules they use.
The special problem this package had
The protoc code-generator plugin used to emit RPC stub headers (
*.client.pb.h/*.server.pb.h, committed to the repository in three packages). Every client stub header did#include "streamr-proto-rpc/RpcCommunicator.hpp", which pulled the whole proto-rpc + logger header web textually into every file that used a generated stub — in streamr-proto-rpc, streamr-dht, and streamr-trackerless-network alike. Deleting proto-rpc'sinclude/tree would have broken every one of those stubs, so the generator itself had to change.What changed
The plugin now emits C++ module units (
PluginCodeGenerator.hpp, rewritten):X.client.cppmandX.server.cppminstead of headers.Task).import streamr.protorpc.RpcCommunicator;— a module import instead of the textual include that caused the whole problem.--streamr_out=module_prefix=streamr.dht:./modules/genproducesexport module streamr.dht.DhtRpcClient;/...DhtRpcServer;.modules/gen/in the library packages (picked up by the existing recursive module glob; excluded from linting like all other generated code) and next to the generated message code for proto-rpc's tests and examples.streamr-proto-rpc itself is now fully consolidated:
modules/(streamr.protorpc.Errors,.ProtoCallContext,.RpcCommunicator,.RpcCommunicatorClientApi,.RpcCommunicatorServerApi,.ServerRegistry), plus the existingstreamr.protorpc.protosover the generated message types. Theinclude/tree is deleted; the old umbrella/façade units are deleted.PluginCodeGenerator.hpp,StreamPrinter.hpp) moved tosrc/— they are host tooling for protoc, not a public API.streamr.protorpc.test.*,streamr.protorpc.examples.*), per the settled rule that tests import their subjects.Consumers of generated stubs (streamr-dht, streamr-trackerless-network):
:protosre-export modules no longer include or re-export the stubs — they cover the generated message types only. The wrapper sub-modules that actually use stubs (ConnectionLockRpcLocal/Remote,WebsocketClientConnectorRpcLocal/Remote,ContentDeliveryRpcLocal/Remote,ProxyConnectionRpcLocal/Remote) now import the generated stub modules directly.import streamr.protorpc;umbrella imports (four dht units, one dht test, five proto-rpc test/example files) flipped to narrow imports.One latent hazard removed: streamr-trackerless-network used to regenerate the dht stubs into its own tree. As textual headers that was merely duplication; as module units it would have been an outright one-definition-rule violation (the same stub classes attached to two different modules). Its
proto.shnow generates DhtRpc message types only; the stub modules exist once, in streamr-dht.What deliberately stays textual
Generated protobuf message code (
*.pb.h/*.pb.cc) remains#include-based in global module fragments — protoc emits headers, and this is exactly the carve-out the consolidation decision defined (third-party, generated proto message code, and the public C API header).Verification
modules/gen/excluded from lint as generated code.[androidbuild] [iosbuild]tags request the cross-platform CI legs.--no-verifybecause of the known pre-push-hook SIGPIPE issue; the lint scripts were run manually instead (all green).Next step (C-5)
streamr-utils consolidation — plain application of the settled architecture, no generated-code complications.
🤖 Generated with Claude Code