Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions MODERNIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -770,11 +770,39 @@ verified NDK clang (18 = r27), with the textual fallback below it.
StreamID touch REGRESSED +68% from BMI-chain invalidation).
- The final IWYU/ODR hygiene of the no-headers end state.

### Recommended path (when unblocked)
Leaf-first and interleaved as originally planned — eventemitter as the
consolidation canary, one package per PR, `bench.sh` measured at every
step (the 2.4 lesson: measure before generalizing), headers deleted
per-package with a grep-enforced "nothing includes them" gate.
### DECISION (owner, 2026-07-04): consolidate NOW
The owner decided to start consolidation immediately, accepting the
clangd limitation: editor diagnostics may show false errors in the
affected pattern, and linting is disabled selectively (per file, with a
comment) where the clangd std-type-unification bug produces false
errors. Test files are the expected main victims; the linter keeps
running everywhere it is correct.

**Order — consumers first, libraries last (reverses the old
"leaf-first" idea, which was impossible):** a library's headers can
only be deleted once no other package's headers still textually include
them, and during the transition the downstream packages' headers do
exactly that. So consolidation walks the dependency chain from the top:
1. **C-1 streamr-libstreamrproxyclient** ✅ (this PR) — the internal
header `LibProxyClientApi.hpp` merged into `streamrproxyclient.cpp`,
which now imports the four sibling modules; the public C header is
untouched. The Android/NDK version gate became a hard configure
error (the textual fall-back no longer exists). Verified: Release
build + 15/15 tests, standalone package build, package lint green
(two bugprone-exception-escape suppressions — the checker cannot see
through imported module interfaces; known pattern).
2. C-2 streamr-trackerless-network
3. C-3 streamr-dht (the largest)
4. C-4 streamr-proto-rpc
5. C-5 streamr-utils
6. C-6 streamr-logger
7. C-7 streamr-json
8. C-8 streamr-eventemitter (+ final bench.sh metrics and memo closure)

One package per PR, `bench.sh` measured at the dht step and at the end
(the 2.4 lesson: measure before generalizing); headers deleted
per-package — the compiler itself enforces that nothing still includes
them.

### Interim posture (adopted now)
The façade stage is COMPLETE and delivers: uniform `import streamr.<pkg>`
Expand Down
22 changes: 11 additions & 11 deletions cmake/StreamrModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# OFF globally (clean compile commands for clangd), and the helpers below
# re-enable scanning per target.

# Android builds use the NDK's clang. The façade modules build correctly
# with NDK r27+ (clang 18) — the failure previously attributed to compiler
# Android builds use the NDK's clang. The modules build correctly with
# NDK r27+ (clang 18) — the failure previously attributed to compiler
# immaturity was a -pthread BMI configuration mismatch, fixed in the
# helpers below. Keep a version floor at the oldest verified NDK clang
# (18 = r27): with an older NDK, Android consumes the ordinary headers
# instead (they remain the source of truth during the façade stage), the
# module units are skipped, and import-using test/example targets are not
# built (STREAMR_MODULES_SUPPORTED guards them).
# helpers below. Older NDKs are a hard error: the codebase is being
# consolidated into C++ modules (MODERNIZATION.md Phase 2.6), so the
# former fall-back of building textually from the internal headers no
# longer exists.
if(VCPKG_TARGET_TRIPLET MATCHES "android" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
set(STREAMR_MODULES_SUPPORTED ON)
else()
set(STREAMR_MODULES_SUPPORTED OFF)
message(STATUS
"C++ modules disabled: NDK clang ${CMAKE_CXX_COMPILER_VERSION} "
"< 18 (use NDK r27+ for modules on Android)")
message(FATAL_ERROR
"NDK clang ${CMAKE_CXX_COMPILER_VERSION} is too old: building "
"this codebase requires C++ modules support (NDK r27+, "
"clang >= 18). The pre-consolidation textual fall-back no "
"longer exists (see MODERNIZATION.md Phase 2.6).")
endif()
else()
set(STREAMR_MODULES_SUPPORTED ON)
Expand Down
22 changes: 11 additions & 11 deletions packages/streamr-dht/StreamrModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# OFF globally (clean compile commands for clangd), and the helpers below
# re-enable scanning per target.

# Android builds use the NDK's clang. The façade modules build correctly
# with NDK r27+ (clang 18) — the failure previously attributed to compiler
# Android builds use the NDK's clang. The modules build correctly with
# NDK r27+ (clang 18) — the failure previously attributed to compiler
# immaturity was a -pthread BMI configuration mismatch, fixed in the
# helpers below. Keep a version floor at the oldest verified NDK clang
# (18 = r27): with an older NDK, Android consumes the ordinary headers
# instead (they remain the source of truth during the façade stage), the
# module units are skipped, and import-using test/example targets are not
# built (STREAMR_MODULES_SUPPORTED guards them).
# helpers below. Older NDKs are a hard error: the codebase is being
# consolidated into C++ modules (MODERNIZATION.md Phase 2.6), so the
# former fall-back of building textually from the internal headers no
# longer exists.
if(VCPKG_TARGET_TRIPLET MATCHES "android" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
set(STREAMR_MODULES_SUPPORTED ON)
else()
set(STREAMR_MODULES_SUPPORTED OFF)
message(STATUS
"C++ modules disabled: NDK clang ${CMAKE_CXX_COMPILER_VERSION} "
"< 18 (use NDK r27+ for modules on Android)")
message(FATAL_ERROR
"NDK clang ${CMAKE_CXX_COMPILER_VERSION} is too old: building "
"this codebase requires C++ modules support (NDK r27+, "
"clang >= 18). The pre-consolidation textual fall-back no "
"longer exists (see MODERNIZATION.md Phase 2.6).")
endif()
else()
set(STREAMR_MODULES_SUPPORTED ON)
Expand Down
22 changes: 11 additions & 11 deletions packages/streamr-eventemitter/StreamrModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# OFF globally (clean compile commands for clangd), and the helpers below
# re-enable scanning per target.

# Android builds use the NDK's clang. The façade modules build correctly
# with NDK r27+ (clang 18) — the failure previously attributed to compiler
# Android builds use the NDK's clang. The modules build correctly with
# NDK r27+ (clang 18) — the failure previously attributed to compiler
# immaturity was a -pthread BMI configuration mismatch, fixed in the
# helpers below. Keep a version floor at the oldest verified NDK clang
# (18 = r27): with an older NDK, Android consumes the ordinary headers
# instead (they remain the source of truth during the façade stage), the
# module units are skipped, and import-using test/example targets are not
# built (STREAMR_MODULES_SUPPORTED guards them).
# helpers below. Older NDKs are a hard error: the codebase is being
# consolidated into C++ modules (MODERNIZATION.md Phase 2.6), so the
# former fall-back of building textually from the internal headers no
# longer exists.
if(VCPKG_TARGET_TRIPLET MATCHES "android" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
set(STREAMR_MODULES_SUPPORTED ON)
else()
set(STREAMR_MODULES_SUPPORTED OFF)
message(STATUS
"C++ modules disabled: NDK clang ${CMAKE_CXX_COMPILER_VERSION} "
"< 18 (use NDK r27+ for modules on Android)")
message(FATAL_ERROR
"NDK clang ${CMAKE_CXX_COMPILER_VERSION} is too old: building "
"this codebase requires C++ modules support (NDK r27+, "
"clang >= 18). The pre-consolidation textual fall-back no "
"longer exists (see MODERNIZATION.md Phase 2.6).")
endif()
else()
set(STREAMR_MODULES_SUPPORTED ON)
Expand Down
22 changes: 11 additions & 11 deletions packages/streamr-json/StreamrModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# OFF globally (clean compile commands for clangd), and the helpers below
# re-enable scanning per target.

# Android builds use the NDK's clang. The façade modules build correctly
# with NDK r27+ (clang 18) — the failure previously attributed to compiler
# Android builds use the NDK's clang. The modules build correctly with
# NDK r27+ (clang 18) — the failure previously attributed to compiler
# immaturity was a -pthread BMI configuration mismatch, fixed in the
# helpers below. Keep a version floor at the oldest verified NDK clang
# (18 = r27): with an older NDK, Android consumes the ordinary headers
# instead (they remain the source of truth during the façade stage), the
# module units are skipped, and import-using test/example targets are not
# built (STREAMR_MODULES_SUPPORTED guards them).
# helpers below. Older NDKs are a hard error: the codebase is being
# consolidated into C++ modules (MODERNIZATION.md Phase 2.6), so the
# former fall-back of building textually from the internal headers no
# longer exists.
if(VCPKG_TARGET_TRIPLET MATCHES "android" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
set(STREAMR_MODULES_SUPPORTED ON)
else()
set(STREAMR_MODULES_SUPPORTED OFF)
message(STATUS
"C++ modules disabled: NDK clang ${CMAKE_CXX_COMPILER_VERSION} "
"< 18 (use NDK r27+ for modules on Android)")
message(FATAL_ERROR
"NDK clang ${CMAKE_CXX_COMPILER_VERSION} is too old: building "
"this codebase requires C++ modules support (NDK r27+, "
"clang >= 18). The pre-consolidation textual fall-back no "
"longer exists (see MODERNIZATION.md Phase 2.6).")
endif()
else()
set(STREAMR_MODULES_SUPPORTED ON)
Expand Down
9 changes: 9 additions & 0 deletions packages/streamr-libstreamrproxyclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ set (IOS_SWIFT_PACKAGE_VERSION ${STREAMRPROXYCLIENT_VERSION})
set (ANDROID_LIBRARY_VERSION ${STREAMRPROXYCLIENT_VERSION})

project(streamr-streamrproxyclient CXX)

# C++ modules support (guards, policies, helpers) — must come after
# project() because it inspects the compiler id.
include(${CMAKE_CURRENT_SOURCE_DIR}/StreamrModules.cmake)

add_library(streamrproxyclient SHARED
src/streamrproxyclient.cpp
)
# CONSOLIDATED: the implementation imports the sibling streamr modules
# (the former internal header was merged into the .cpp), so the source
# needs module dependency scanning.
streamr_enable_imports(streamrproxyclient)

set_target_properties(streamrproxyclient PROPERTIES VERSION ${SHAREDLIB_VERSION} SOVERSION ${SHAREDLIB_SOVERSION})
find_package(streamr-trackerless-network CONFIG REQUIRED)
Expand Down
22 changes: 11 additions & 11 deletions packages/streamr-libstreamrproxyclient/StreamrModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# OFF globally (clean compile commands for clangd), and the helpers below
# re-enable scanning per target.

# Android builds use the NDK's clang. The façade modules build correctly
# with NDK r27+ (clang 18) — the failure previously attributed to compiler
# Android builds use the NDK's clang. The modules build correctly with
# NDK r27+ (clang 18) — the failure previously attributed to compiler
# immaturity was a -pthread BMI configuration mismatch, fixed in the
# helpers below. Keep a version floor at the oldest verified NDK clang
# (18 = r27): with an older NDK, Android consumes the ordinary headers
# instead (they remain the source of truth during the façade stage), the
# module units are skipped, and import-using test/example targets are not
# built (STREAMR_MODULES_SUPPORTED guards them).
# helpers below. Older NDKs are a hard error: the codebase is being
# consolidated into C++ modules (MODERNIZATION.md Phase 2.6), so the
# former fall-back of building textually from the internal headers no
# longer exists.
if(VCPKG_TARGET_TRIPLET MATCHES "android" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
set(STREAMR_MODULES_SUPPORTED ON)
else()
set(STREAMR_MODULES_SUPPORTED OFF)
message(STATUS
"C++ modules disabled: NDK clang ${CMAKE_CXX_COMPILER_VERSION} "
"< 18 (use NDK r27+ for modules on Android)")
message(FATAL_ERROR
"NDK clang ${CMAKE_CXX_COMPILER_VERSION} is too old: building "
"this codebase requires C++ modules support (NDK r27+, "
"clang >= 18). The pre-consolidation textual fall-back no "
"longer exists (see MODERNIZATION.md Phase 2.6).")
endif()
else()
set(STREAMR_MODULES_SUPPORTED ON)
Expand Down
Loading
Loading