Repository navigation
Modernization Phase 2.2: modules — streamr-logger + streamr-utils (folly GMF, coro canary) [iosbuild] - #30
Merged
Merged
Conversation
…canary) (iosbuild) - streamr-logger: 4 partitions + primary; folly logging machinery in the global module fragment compiles cleanly. detail/ headers stay internal; the detail-testing test keeps its #include alongside import. - streamr-utils: 21 partitions + primary; the folly::coro coroutine canary (waitForEvent, waitForCondition, collect, toCoroTask) passed with zero compiler workarounds under Clang 22. - streamr_add_module_library() now sets target_compile_features(PUBLIC cxx_std_26): consumer build trees synthesize BMI-compiling targets from the export and require the standard in the exported usage requirements. - 7 namespace-scope constexpr header constants -> inline constexpr (internal linkage cannot be exported; correct C++17 idiom regardless). - 20 test files + 2 examples flipped to import (+small include-what-you-use pass). - clangd-modules root cause documented: preamble/BMI std-type unification fails where std types cross the module boundary; one test file excluded from clangd-tidy (first use of the planned fallback). exception-escape on main() in import-using files fixed with function-try-blocks. Verified: logger 63/63, utils 49/49 via import; proto-rpc/dht downstream builds unchanged; root tree 307/307; full lint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The phase the plan budgeted risk for: folly enters the global module fragment, and streamr-utils is the folly::coro coroutine canary. Both cleared with margin.
What's migrated
:Logger,:LoggerImpl,:SLogger,:StreamrLogLevel) + primary unit. folly's logging machinery compiles in the GMF without incident.detail/headers get no partitions (internal API); the detail-testingLoggerEnvTestkeeps its detail#includealongsideimport streamr.logger— mixing is the designed property of the façade.waitForEvent,waitForCondition,collect,toCoroTask— folly::coro Tasks in exported signatures) passed with zero compiler workarounds under Clang 22. The per-header opt-out budget went unused.import; logger 63/63, utils 49/49 tests green through modules.Mechanisms discovered (now part of the scaffolding/docs)
target_compile_features(… PUBLIC cxx_std_26)is required on exported module targets — when another build tree consumes the export, CMake synthesizes a BMI-compiling target on the consumer side and hard-errors unless the standard is an exported usage requirement. Added tostreamr_add_module_library(); surfaced the moment logger consumed json's export.constexprconstants have internal linkage and can't be re-exported — 7 header constants becameinline constexpr(the correct C++17 idiom regardless of modules).toEthereumAddressOrENSNameTest.cpp, whose whole API is std types inBrandedwrappers) needed the planned lint-exclusion fallback — first and only use; the compiler still typechecks it on every build. Also:bugprone-exception-escapenow correctly fires onmain()in import-using files (clangd sees deeper through BMIs) — real findings, fixed with function-try-blocks.Verification
importfind_package+#include)[iosbuild])Honest bench note: no incremental-rebuild improvement is expected yet — dht/trackerless-network still
#includeSLogger/utils headers. The measured win (the 48-TU/62–70 s SLogger.hpp baseline) arrives when those packages flip in 2.4/2.5 and their test TUs load BMIs instead of re-parsing the header stack.Next
Phase 2.3: streamr-proto-rpc — the first
:protospartition (overProtoRpc.pb.h) and the RpcCommunicator template stack.🤖 Generated with Claude Code