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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vcpkg_installed
*.cache*
*~
/dist/
.vscode
.trunk
setenvs.sh
Expand Down
63 changes: 39 additions & 24 deletions MODERNIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,46 @@ Android NDK r28+.
`iostest.sh` green — the compiler's output must stay compatible with the
device's fixed libc++ runtime**.

## Phase 1.3 — vcpkg baseline bump + dependency wave (highest-risk phase)
- Bump vcpkg submodule to latest tag; add `"builtin-baseline"` to root
`vcpkg.json` (enables per-port `"overrides"` for pinning/rollback; verify
`merge-dependencies.sh` preserves the key). Document the bump procedure.
- **Overlay ports**: delete `overlayports/magic-enum/` (byte-identical to
upstream) and `overlayports/fmt/` (Phase 1.2 stopgap). Rebuild
`overlayports/folly/` from the new upstream port with **zero patches**,
re-adding only what provably fails. Rebase `overlayports/usrsctp/` and
`overlayports/libdatachannel/` (or drop, if upstream 0.24 works). Drop the
`CMAKE_POLICY_VERSION_MINIMUM` and `VCPKG_OSX_SYSROOT` stopgaps if the new
baseline handles CMake 4 itself.
- **Protobuf 25→33** (major): fix the codegen plugin against new libprotoc
(expect `absl::string_view`/`io::Printer` churn); fix `packages/*/proto.sh`
(hardcoded `arm64-osx` protoc path; drop
`--experimental_allow_proto3_optional`); regenerate + commit all checked-in
generated proto sources. Note abseil static libs now flow into the
XCFramework `libtool` glob — verify symbol completeness in the iOS test
app.
- Fix API churn fallout (boost, libdatachannel 0.24, openssl 3.6). Remove
`-fpermissive` from `packages/streamr-proto-rpc/CMakeLists.txt` (GCC-only
flag; meaningless once all-clang).
- CI cache keys: include the vcpkg submodule SHA (currently keyed only on
`vcpkg.json`, which misses submodule bumps).
## Phase 1.3 — vcpkg baseline bump + dependency wave (PR pending)
Baseline: vcpkg tag **2026.06.24** (`builtin-baseline` now pinned in
`vcpkg.json`; the jq-based merge-dependencies.sh preserves the key — and
because the cache keys hash `vcpkg.json`, baseline bumps bust CI caches
automatically). Port versions: protobuf 6.33.4, folly 2026.02.23, boost
1.91, openssl 3.6.3, libdatachannel 0.24.5, fmt 12.2, secp256k1 0.7.1.
- **All five old overlays deleted**; the CMake-4 stopgaps
(`CMAKE_POLICY_VERSION_MINIMUM`, `VCPKG_OSX_SYSROOT`) removed — the new
vcpkg scripts/ports handle CMake 4 themselves. Three minimal overlays
returned, each with a JUSTIFICATION.md:
- **folly**: missing `<exception>` include in `result/rich_error_code.h`
(libc++ 22 hard error), and `-DFOLLY_NO_EXCEPTION_TRACER=ON` — folly
2026's exception tracer interposes `__cxa_throw` and now activates on
macOS (the 2024 tracer was glibc-only), breaking
`std::current_exception()` process-wide and aborting every coro error
path. Found via minimal repro after 18 error-path tests aborted.
- **secp256k1**: enable the recovery module (upstream default-off;
SigningUtils needs `secp256k1_recovery.h`). The separate
`secp256k1_precomputed` archive no longer exists (merged into the main
lib in 0.7) — its find_library is now optional.
- **usrsctp**: the two pre-2026 iOS patches (no `<net/route.h>` /
`<ifaddrs.h>` in the iPhoneOS SDK) — verified still required.
- **Protobuf 25→33**: all checked-in generated code regenerated (protoc
33.4); codegen plugin ported to the `absl::string_view` descriptor API;
`proto.sh` scripts detect the protoc triplet dir and drop the removed
`--experimental_allow_proto3_optional` flag. `DebugString()`-based test
assertions replaced with field comparisons (6.33 prefixes a
`goo.gle/debugproto` marker; the format was never stable).
- **folly 2026 API migration**: the seven `scheduleOn(exec)` call sites →
`co_withExecutor(exec, task)` (deprecated, warnings-as-errors in lint).
- magic-enum 0.9.8 headers moved under `magic_enum/`; libdatachannel 0.24
target renamed to `LibDataChannel::LibDataChannel`; `protobuf::libprotoc`
removed from library targets (only the host codegen plugin needs it — the
new port doesn't export it for cross triplets); `-fpermissive` removed.
- **Verified**: macOS full build + 307/307 tests + full lint; iOS
cross-build green with XCFramework at `platform=iOS, minos=13.0` and no
post-deployment-target runtime symbols.
- **Gate**: build/test green macOS + Linux; regenerated proto diff reviewed;
folly overlay patch count documented (target 0–2).
folly overlay patch count documented (achieved: 1 patch + 1 configure
option).

**Lesson from 1.2 (feeds the Part 2 install-flow rework):** switching target
triplets (host↔iOS↔Android) in the SAME package build dirs silently produces
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ The Streamr Native SDK monorepo has two GIT submodules at its root:
#### Configuration files
| File | Description |
|--------------|-----------------------------------------------------------------------------|
| `.vcpkg.json` | Vcpkg dependencies of the whole monorepo. **This file is automatically generated by the `install.sh` script and should not be edited manually.** |
| `.vcpkg.json` | Vcpkg dependencies of the whole monorepo. **The `dependencies` array is automatically generated by the `install.sh` script and should not be edited manually.** The `builtin-baseline` key pins the vcpkg ports snapshot; to bump it: update the `vcpkg` submodule to the desired release tag, set `builtin-baseline` to that tag's commit SHA, rebuild everything on all platforms, and revisit every directory under `overlayports/` (each documents in its JUSTIFICATION.md why it exists — delete overlays the new baseline obsoletes). |
| `.clang-tidy` | Configuration file for the clangd-tidy high-level linter. |
| `.clang-format` | Configuration file for the clang-format low-level linter. |
| `.clangd` | Configuration file for the clangd plugin of Cursor/VSCode. Controls syntax highlighting, code completion, etc. |
Expand Down
3 changes: 2 additions & 1 deletion install-prerequisities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ else
# between macOS and Linux or the format check flip-flops.
sudo apt-get install -y build-essential cmake ninja-build jq \
clang-22 lld-22 clang-tools-22 clangd-22 libc++-22-dev libc++abi-22-dev \
clang-format-22
clang-format-22 \
autoconf autoconf-archive automake libtool
sudo rm -f /usr/bin/clang-format
sudo rm -f /usr/bin/clangd
sudo ln -s /usr/bin/clang-format-22 /usr/bin/clang-format
Expand Down
11 changes: 11 additions & 0 deletions overlayports/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overlay ports

Reset at the 2026.06 vcpkg baseline bump: the previous overlays (folly,
usrsctp, libdatachannel, magic-enum, fmt) existed to patch ports at the old
2024 baseline and were all obsoleted by upstream. Each overlay present here
documents its own reason in a JUSTIFICATION.md.

Policy: add a port here only with a written justification in the port
directory (what fails without it, and the upstream issue/PR if one exists).
Prefer a `"builtin-baseline"`/`"overrides"` pin in `vcpkg.json` for version
problems; overlays are for patches that upstream does not carry.
15 changes: 0 additions & 15 deletions overlayports/fmt/fix-cstdlib-include.patch

This file was deleted.

30 changes: 0 additions & 30 deletions overlayports/fmt/portfile.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions overlayports/fmt/usage

This file was deleted.

17 changes: 0 additions & 17 deletions overlayports/fmt/vcpkg.json

This file was deleted.

17 changes: 17 additions & 0 deletions overlayports/folly/JUSTIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Why this overlay exists

Baseline: vcpkg 2026.06.24 (folly 2026.02.23.00). Identical to the upstream
port except one added patch:

- `fix-missing-exception-include.patch`: folly/result/rich_error_code.h uses
`std::exception_ptr` without including `<exception>`; libc++ 22's strict
transitive includes make this a hard compile error. Remove when a folly
version with the fix reaches the pinned baseline.

- `-DFOLLY_NO_EXCEPTION_TRACER=ON` (configure option): folly 2026.02's
exception tracer interposes `__cxa_throw` and, unlike in 2024-era folly
(whose tracer was glibc-only and compiled to empty objects on libc++),
activates on macOS — breaking `std::current_exception()` process-wide
(returns null inside catch blocks), which aborts every folly::coro error
path ("Cannot use throw_exception with an empty folly::exception_wrapper").
Verified with a minimal repro. The SDK does not use the tracer.
13 changes: 0 additions & 13 deletions overlayports/folly/disable-cxa-init-primary-exception.patch

This file was deleted.

13 changes: 0 additions & 13 deletions overlayports/folly/disable-groupvarint.patch

This file was deleted.

34 changes: 0 additions & 34 deletions overlayports/folly/disable-non-underscore-posix-names.patch

This file was deleted.

13 changes: 0 additions & 13 deletions overlayports/folly/fix-android-remainder.patch

This file was deleted.

13 changes: 0 additions & 13 deletions overlayports/folly/fix-cursor.patch

This file was deleted.

Loading
Loading