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
30 changes: 29 additions & 1 deletion MODERNIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,35 @@ exactly that. So consolidation walks the dependency chain from the top:
standalone chain (utils 49/49 → proto-rpc 26/26 → dht 83/83 →
trackerless-network → proxyclient 15/15), lint green in all five
touched packages (utils module units now clangd-tidy-linted).
6. C-6 streamr-logger
6. **C-6 streamr-logger** ✅ — the 11 headers (4 public + 7 detail/)
became named sub-modules (`streamr.logger.X`, tree-mirroring
`modules/detail/` for the internals); façade and include/ tree
deleted; all 43 repo-wide `import streamr.logger;` consumers flipped
to narrow imports (virtually all of them just
`streamr.logger.SLogger`), plus one proxyclient test that still
included SLogger.hpp textually. streamr-json usage inside the logger
units stays a TEXTUAL global-module-fragment include until C-7
consolidates that package. Two new mechanical findings for the
remaining steps: (i) namespace-scope `static constexpr` constants
have internal linkage and cannot be exported — they become
`inline constexpr` when a header moves into module purview (the
detail color constants); (ii) a purview declaration of a C symbol
silently gets module attachment and no longer matches the libc
symbol at link time (`extern char** environ;` in FollyLoggerImpl —
undefined symbol `environ@streamr.logger.FollyLoggerImpl`); such
declarations belong in the global module fragment.
Verified: whole-tree build, 309/309 tests (per-test timeouts),
standalone chain (logger 63/63 → utils 49/49 → proto-rpc 26/26 →
dht 83/83 → trackerless-network → proxyclient 15/15), lint green in
all six touched packages (logger module units now
clangd-tidy-linted). One more clangd-tidy exclusion added after the
linux-arm64 CI leg failed: proto-rpc's RpcCommunicatorTest.cpp trips
the known preamble/BMI std-type unification failure class on the
Linux clangd build (spurious std::string-vs-std::string mismatch on
every gtest assertion) while the macOS clangd of the same major
version accepts it — owner-approved selective disabling, compiler
coverage unaffected (fourth exclusion overall; revisit each clangd
release).
7. C-7 streamr-json
8. C-8 streamr-eventemitter (+ final bench.sh metrics and memo closure)

Expand Down
2 changes: 1 addition & 1 deletion packages/streamr-dht/modules/connection/Connection.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module;
export module streamr.dht.Connection;

import streamr.eventemitter;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.Branded;
import streamr.utils.Uuid;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module;
export module streamr.dht.ConnectionLockRpcLocal;

import streamr.dht.DhtRpcServer;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.ConnectionLockStates;
import streamr.dht.DhtCallContext;
import streamr.dht.Identifiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module;
export module streamr.dht.ConnectionLockRpcRemote;

import streamr.dht.DhtRpcClient;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.ConnectionLockStates;
import streamr.dht.DhtCallContext;
import streamr.dht.Identifiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export module streamr.dht.ConnectionManager;

import streamr.protorpc.RpcCommunicator;
import streamr.dht.ConnectionLockStates;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.waitForEvent;
import streamr.dht.ConnectionLockRpcLocal;
import streamr.dht.ConnectionLockRpcRemote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module;
export module streamr.dht.ConnectorFacade;

import streamr.dht.Identifiers;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.protorpc.RpcCommunicator;
import streamr.dht.IPendingConnection;
import streamr.dht.ListeningRpcCommunicator;
Expand Down
2 changes: 1 addition & 1 deletion packages/streamr-dht/modules/connection/Handshaker.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module;
export module streamr.dht.Handshaker;

import streamr.eventemitter;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.EnableSharedFromThis;
import streamr.utils.Uuid;
import streamr.dht.Connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module;

export module streamr.dht.IncomingHandshaker;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.eventemitter;
import streamr.dht.Connection;
import streamr.dht.Handshaker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module;
export module streamr.dht.OutgoingHandshaker;

import streamr.dht.IPendingConnection;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.eventemitter;
import streamr.dht.Connection;
import streamr.dht.Handshaker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export module streamr.dht.PendingConnection;

import streamr.utils.AbortController;
import streamr.utils.AbortableTimers;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.Connection;
import streamr.dht.IPendingConnection;
import streamr.dht.Identifiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module;
export module streamr.dht.ConnectedEndpointState;

import streamr.eventemitter;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.Connection;
import streamr.dht.EndpointState;
import streamr.dht.EndpointStateInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module;

export module streamr.dht.ConnectingEndpointState;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.Connection;
import streamr.dht.IPendingConnection;
import streamr.eventemitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module;

export module streamr.dht.DisconnectedEndpointState;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.Connection;
import streamr.dht.EndpointState;
import streamr.dht.EndpointStateInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module;
export module streamr.dht.Endpoint;

import streamr.eventemitter;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.EnableSharedFromThis;
import streamr.dht.ConnectedEndpointState;
import streamr.dht.ConnectingEndpointState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module;

export module streamr.dht.EndpointState;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.EnableSharedFromThis;
import streamr.dht.Connection;
import streamr.dht.IPendingConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module;

export module streamr.dht.InitialEndpointState;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.Connection;
import streamr.dht.EndpointState;
import streamr.dht.EndpointStateInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module;
export module streamr.dht.WebsocketClientConnection;

import streamr.dht.Connection;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.waitForEvent;
import streamr.dht.WebsocketConnection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export module streamr.dht.WebsocketClientConnector;

import streamr.dht.Handshaker;
import streamr.dht.Connection;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.AbortController;
import streamr.dht.Connectivity;
import streamr.dht.IPendingConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export module streamr.dht.WebsocketClientConnectorRpcRemote;

import streamr.dht.DhtRpcClient;
import streamr.protorpc.RpcCommunicator;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.DhtCallContext;
import streamr.dht.Identifiers;
import streamr.dht.RpcRemote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module;

export module streamr.dht.WebsocketConnection;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.EnableSharedFromThis;
import streamr.dht.Connection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export module streamr.dht.WebsocketServer;
import streamr.eventemitter;
import streamr.dht.Connection;
import streamr.dht.WebsocketConnection;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.Uuid;
import streamr.dht.CertificateHelper;
import streamr.dht.Errors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export module streamr.dht.WebsocketServerConnection;

import streamr.dht.Connection;
import streamr.eventemitter;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.dht.WebsocketConnection;

// Hoisted from the former header (file scope, NOT exported);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module;
export module streamr.dht.WebsocketServerConnector;

import streamr.dht.WebsocketServerConnection;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.AbortController;
import streamr.utils.Ipv4Helper;
import streamr.utils.Uuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module;

export module streamr.dht.RoutingRpcCommunicator;

import streamr.logger;
import streamr.logger.SLogger;
import streamr.protorpc.RpcCommunicator;
import streamr.protorpc.protos;
import streamr.utils.Uuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import streamr.dht.Identifiers;
import streamr.dht.PortRange;
import streamr.dht.Transport;
import streamr.dht.protos;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.utils.collect;
import streamr.utils.waitForCondition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import streamr.dht.Transport;
import streamr.dht.WebsocketClientConnection;
import streamr.dht.WebsocketServer;
import streamr.dht.WebsocketServerConnection;
import streamr.logger;
import streamr.logger.SLogger;

using streamr::dht::connection::connectionevents::Connected;
using streamr::dht::connection::connectionevents::Data;
Expand Down
2 changes: 1 addition & 1 deletion packages/streamr-dht/test/unit/CertificateHelperTest.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

import streamr.dht.CertificateHelper;
import streamr.logger;
import streamr.logger.SLogger;

using streamr::dht::helpers::CertificateHelper;
using streamr::logger::SLogger;
Expand Down
2 changes: 1 addition & 1 deletion packages/streamr-dht/test/unit/ConnectionManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import streamr.dht.FakeTransport;
import streamr.dht.PortRange;
import streamr.dht.Transport;
import streamr.dht.protos;
import streamr.logger;
import streamr.logger.SLogger;

using ::dht::ConnectivityResponse;
using ::dht::Message;
Expand Down
3 changes: 3 additions & 0 deletions packages/streamr-libstreamrproxyclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ if (NOT IOS)
find_package(folly CONFIG REQUIRED)

add_executable(streamr-streamrproxyclient-test-integration test/integration/StreamrProxyClientTest.cpp)
# The test imports streamr.logger.SLogger (the former textual include
# died with the logger consolidation, MODERNIZATION.md Phase 2.6).
streamr_enable_imports(streamr-streamrproxyclient-test-integration)
target_link_directories(streamr-streamrproxyclient-test-integration PUBLIC ${SHAREDLIB_OUTPUT_DIRECTORY})

target_include_directories(streamr-streamrproxyclient-test-integration PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import streamr.dht.ConnectorFacade;
import streamr.dht.FakeTransport;
import streamr.dht.Identifiers;
import streamr.dht.protos;
import streamr.logger;
import streamr.logger.SLogger;
import streamr.trackerlessnetwork.ProxyClient;
import streamr.utils.BinaryUtils;
import streamr.utils.EthereumAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <iostream>
#include <string>
#include <gtest/gtest.h>
#include "streamr-logger/SLogger.hpp"
import streamr.logger.SLogger;

using streamr::logger::SLogger;

Expand Down
19 changes: 8 additions & 11 deletions packages/streamr-logger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# project() because it inspects the compiler id.
include(${CMAKE_CURRENT_SOURCE_DIR}/StreamrModules.cmake)

# Module façade (MODERNIZATION.md Part 2): the package is now a STATIC
# library whose module interface units re-export the public headers.
# #include consumers are unaffected; import consumers get the BMIs.
# detail/ headers stay internal (no partitions).
# CONSOLIDATED (MODERNIZATION.md Phase 2.6): one named sub-module per
# former header (settled architecture: no umbrella; consumers and tests
# import the individual sub-modules — external consumers virtually always
# just streamr.logger.SLogger). The include/ tree is gone; the module
# interface units are the source of truth.
file(GLOB_RECURSE STREAMR_LOGGER_MODULE_UNITS CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/modules/*.cppm)
streamr_add_module_library(streamr-logger
FILES
modules/streamr.logger.cppm
modules/streamr.logger-all.cppm)
FILES ${STREAMR_LOGGER_MODULE_UNITS})
set_property(TARGET streamr-logger PROPERTY CXX_STANDARD 26)

add_library(streamr::streamr-logger ALIAS streamr-logger)
Expand Down Expand Up @@ -73,10 +74,6 @@ if(NOT IOS AND STREAMR_MODULES_SUPPORTED)
set_property(TEST env_category_wrongly_written_as_fatal_and_info_log_test PROPERTY ENVIRONMENT "LOG_LEVEL=\"\"")
endif()

target_include_directories(
streamr-logger PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

# PUBLIC (was INTERFACE): the module interface units compile against folly
# and streamr-json in their global module fragments.
target_link_libraries(streamr-logger PUBLIC Folly::folly PUBLIC streamr::streamr-json)
Expand Down

This file was deleted.

9 changes: 6 additions & 3 deletions packages/streamr-logger/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ clangd-tidy -p ./build $FILES
echo "Running clang-format --dry-run on $FILES"
../../run-clang-format.py $FILES

# Module interface units: format check only. clangd-tidy is not run on
# .cppm files (headers remain the fully linted source of truth during the
# façade migration; clangd modules support is still experimental).
# CONSOLIDATED (MODERNIZATION.md Phase 2.6): the include/ tree is gone —
# the code lives in the module interface units, which are linted with
# clangd-tidy as the source of truth.
MODULE_FILES=$(find ./modules -type f -name "*.cppm" 2>/dev/null | xargs echo)
if [ -n "$MODULE_FILES" ]; then
echo "Running clangd-tidy on $MODULE_FILES"
clangd-tidy -p ./build $MODULE_FILES

echo "Running clang-format --dry-run on $MODULE_FILES"
../../run-clang-format.py $MODULE_FILES
fi
Loading
Loading