Repository navigation
Switch dependency handling to session-deps (backport from client) - #179
Merged
mpretty-cyro merged 12 commits intoOct 6, 2026
Merged
Conversation
Replace the libsodium-internal, zstd and simdutf submodules and cmake/StaticBuild.cmake with cmake/session-deps, and bump session-router to 2b91e9ab4 (libquic c0b9cf6). xed25519::pubkey() used libsodium-internal's fe25519 internals; it now uses a TweetNaCl subset (src/xed25519-tweetnacl.cpp). session-deps builds nettle 4, so digest calls go through nettle-compat.hpp. zstd moves 1.5.2 -> 1.5.7, which changes compressed output; test vectors updated. USE_LTO becomes the single LTO switch for session-deps and session-router.
…ssion-router to afb98f9
…e_mtu_discovery libquic 1.9 deprecates opt::disable_mtu_discovery as exactly this value; behaviour is unchanged.
session-deps' system-library targets (e.g. protobuf-lite) are not in any export set, so export(TARGETS protos) fails to generate when building against system libraries. Nothing consumes libsessionTargets.cmake; client removed these as well.
libquic 1.11.0 relies on session-deps' patched ngtcp2 1.25.0 recipe (6b37832, d74f5b1). That change kept session_deps_version at 1.28, the same as 58c5a08, and with equal versions the first copy loaded wins: ours, at the top level. So anything older here would quietly build libquic against the unpatched ngtcp2. Also picked up from dae3b07 (what client pins): 9051cd2 passes the macOS deployment target to the CMake-built deps on native builds (zstd and simdutf were being built for the SDK's own macOS version, 15.0 on a current Xcode, rather than our 10.15), and cc67e32 builds CMake deps as Release by default.
session_network.cpp called SessionRouter::make() unconditionally while session_router_router.cpp is only compiled with ENABLE_NETWORKING_SROUTER, so an OFF build produced a static library with an undefined reference that only showed up when something linked it (which is why the mingw CI build, a static library alone, never noticed). Gate the session-router code on a compile definition, as client does, and throw if the session_router router is requested from a build without it. No client on this branch routes through session-router, so default the option off rather than making every networking build carry it.
libsession takes libquic from session-router's submodule even with ENABLE_NETWORKING_SROUTER off, so this is what moves it from a pre-1.9.0 snapshot (c1835882) to 1.11.0. Since then libquic has fixed a use-after-free in Endpoint::drop_connection (1.9.1), stopped using a connection that ngtcp2 has rejected and stopped requesting chunks from a closing stream (1.10.1), no longer treats writing to a closing or draining connection as an error (1.10.2), and in 1.11.0 does its own PMTU probing, drops packets on EMSGSIZE/ENOBUFS rather than closing the connection, and migrates rather than closes a connection when the host's source address changes.
session-deps' gnutls recipe never passed on the Security and CoreFoundation frameworks that gnutls's own gnutls.pc lists on darwin, so a static macOS link of anything using libquic failed on gnutls's system-trust symbols unless something else happened to add them. With session-router off by default here, nothing else does.
session-deps' meson cross file setup died on utils/macos.sh's x86_64 build (CMAKE_SYSTEM_NAME=Darwin with no SDK_NAME) before any dependency was asked for, breaking the static macOS build.
Backports client's QUIC payload cap (b46b88f), MTU part only: a size cap in the C++ options, Config, the C API (session_network_config.quic_max_udp_payload) and QuicTransport. quic_disable_mtu_discovery stays as a supported alias for a 1200 cap rather than being deprecated. Values under 1200 are rejected when the option is set instead of when libquic builds the endpoint.
jagerman
approved these changes
Oct 6, 2026
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.
Backport of the session-deps dependency migration from
clienttodev, so a release can carry a newer libQuic. Build-system focused; none of the otherclientwork (session-sqlite, mnemonics, schema, PFS, device linking) comes with it.Three commits, kept separate so the networking one can be reviewed on its own:
libsodium-internal,zstdandsimdutfsubmodules andcmake/StaticBuild.cmakewithcmake/session-deps(pinned to the same commitclientuses), and bumpssession-routerto2b91e9ab4.xed25519::pubkey()used libsodium-internal'sfe25519internals; it now uses a TweetNaCl subset (src/xed25519-tweetnacl.cpp). It matches the referencey = (u-1)/(u+1) mod pon 20,012 inputs including edge cases. The C API is unchanged (clientalso changedsession_xed25519_pubkeyto return void; that is not needed here and is not included).src/nettle-compat.hpp(fromclient).USE_LTObecomes the single LTO switch for session-deps and session-router; without it session-router's LTO probe fails underutils/ios.sh.ENABLE_NETWORKINGis kept (clientremoved it).session_router_routerto session-router's tunnel claims, and bump session-router toafb98f9(libquic 1.9.0).establish_udp()now returns a claim that closes the tunnel when destroyed; the old code discarded it, so fixing only the callback signature would compile and silently close every tunnel. The claims are held in a mutex-guarded map (the failure callback runs on session-router's thread). Not ported fromclient: striking a node with no relay contact on first contact; the failure reason is only logged.max_udp_payload::minimum()instead of the deprecateddisable_mtu_discovery. Same behaviour (libquic defines the old one as exactly this value).Behaviour changes to know about
test_compression.cppupdated, same asclient). This can affect config deduplication at the swarm between clients on different versions.Tested
devitself does not link on macOS without hand-added CoreFoundation/Security frameworks; this does.test_quic_transport.cpp:48aborts intermittently ("Resource deadlock avoided") on currentdevtoo (1 run in 8).utils/ios.sh: build. No tests are possible for the static library.ENABLE_NETWORKING=OFF(Desktop/Android config) the library builds;testAlldoes not, identically on currentdev(the tests includeoxen/quic.hppunconditionally).Not tested: Linux x86_64, Windows/mingw, iOS x86_64 simulator, shared-library mode, Android on a Linux host, any device.
Wrapper impact
libsodium::sodium-internal→sessiondep::libsodiumin its CMake (draft PR: Link libsodium through session-deps libsession-util-android#54). On a macOS host, session-deps builds libsodium with the hostarand gets an empty archive; settingAR/RANLIBto the NDK's llvm tools works around it.SDKROOTmust now be exported (libsodium is built with autotools even with networking off).Looking ahead to libquic 1.11.0: libsession compiles unchanged against libquic's current
dev(1.10.2), but the macOS link then needs-framework CoreFoundation -framework Securityfor gnutls system-trust symbols, which has to be fixed in libquic, session-deps or here.