Skip to content

Consolidation step 1 of 8: the proxy client loses its internal header [androidbuild] [iosbuild]#40

Merged
ptesavol merged 2 commits into
mainfrom
consolidate/c1-proxyclient
Jul 4, 2026
Merged

Consolidation step 1 of 8: the proxy client loses its internal header [androidbuild] [iosbuild]#40
ptesavol merged 2 commits into
mainfrom
consolidate/c1-proxyclient

Conversation

@ptesavol

@ptesavol ptesavol commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

This is the first step of the module consolidation, which you decided to start immediately (2026-07-04). Consolidation means moving all of the library code out of the internal header files and deleting those header files; only third-party libraries, generated protocol-buffer code and the public C header remain as ordinary includes.

Why the order changed: consumers first, libraries last

The old plan suggested starting with the smallest leaf library. That is impossible: a library's header files can only be deleted once no other package's header files still include them, and during the transition the downstream packages' headers do exactly that. So consolidation walks the dependency chain from the top instead. The full order (one pull request each) is now recorded in MODERNIZATION.md:

  1. the proxy client (this pull request)
  2. the trackerless-network package
  3. the DHT package (the largest)
  4. the remote-procedure-call package
  5. the utilities package
  6. the logger
  7. the JSON package
  8. the event emitter, plus final build-time measurements

What this pull request does

  • The internal header LibProxyClientApi.hpp (673 lines) is merged into streamrproxyclient.cpp, and the implementation now imports the four sibling modules (streamr.dht, streamr.logger, streamr.trackerlessnetwork, streamr.utils) instead of textually including their headers. The public C header streamrproxyclient.h — the permanent public interface — is untouched, so nothing changes for users of the shared library.
  • The build system change is two lines: the package now includes the shared module-support file and asks for module scanning on the implementation file.
  • The Android toolchain check became a hard error for too-old toolchains (Android NDK older than r27): the previous behaviour — falling back to building from the internal headers — can no longer exist once the headers are deleted, so an old toolchain now fails immediately at configure time with a clear message instead of failing later with a confusing one.
  • Two narrowly-targeted suppression comments for the bugprone-exception-escape checker, which cannot see through imported module interfaces and therefore wrongly assumes functions may throw (a pattern already known from the test files).

About the accepted linting cost

Good news: the code-analysis step passes completely on this package — the consolidated file did not even trigger the known clangd bug, so nothing had to be excluded from checking here. The selective-disabling permission you gave will likely be needed in the later, larger steps.

Verification

  • Full monorepo build in the release configuration: green.
  • All 15 proxy client tests pass, including the carbon-copy wrapper test.
  • The standalone single-package build (the workflow used for publishing packages separately) also compiles the imported modules correctly in its own build directory.
  • Package lint: green.
  • The Android and iOS builds run on this pull request via the title keywords, proving the shipping artifacts build with the import-only implementation.

🤖 Generated with Claude Code

First step of the module consolidation (owner decision 2026-07-04:
consolidate now; linting may be disabled selectively where the known
clangd bug produces false errors). Order is consumers-first: a
library's headers can only be deleted once no other package's headers
still include them, so consolidation walks the dependency chain from
the top; the proxy client is the topmost consumer and the smallest.

- LibProxyClientApi.hpp (673 lines) merged into streamrproxyclient.cpp,
  which now imports the four sibling modules (streamr.dht,
  streamr.logger, streamr.trackerlessnetwork, streamr.utils) instead of
  textually including their headers. Third-party libraries, the
  standard library and the public C API header remain textual includes.
- streamr_enable_imports(streamrproxyclient) so the implementation is
  scanned for module dependencies.
- StreamrModules.cmake (canonical + synced copies): the Android NDK
  version floor is now a hard configure-time error instead of a textual
  fall-back - the fall-back required the internal headers that
  consolidation deletes.
- Two NOLINT(bugprone-exception-escape) suppressions: the checker
  cannot see through imported module interfaces (known pattern from the
  import-using test files).
- MODERNIZATION.md: the owner decision, the revised order and the C-1
  record.

Verified: Release build green, proxyclient tests 15/15, standalone
package build green (synthesized module compilation in the consumer
build dir), package lint green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

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.

The NOT CMAKE_CROSSCOMPILING guard (added when Android modules were
enabled) is not enough on iOS: the iOS package builds keep the host
CMAKE_SYSTEM_NAME by design (Homebrew compiler, only the SDK/sysroot
is swapped), so CMake does not consider them cross-compiling and the
host-only protoc plugin was configured against the arm64-ios vcpkg
tree, which provides no protobuf::libprotoc. Restore the explicit IOS
condition (set by toolchains/ios.toolchain.cmake) alongside the
cross-compiling check. First iOS run since that commit caught it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

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.

@ptesavol ptesavol merged commit 24c56b9 into main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant