chore: vendor logos-delivery bindings and wire the workspace

libchat's hand-written FFI to liblogosdelivery is replaced by the upstream
`waku-bindings` crate. It is unpublished and its build script compiles the
native library from Nim sources in its own submodule, so it is consumed from
a checkout under vendor/ as its README prescribes, pinned as a submodule.

The macOS link frameworks and the chronicles log-level define ride in this
crate's .cargo/config.toml: a path dependency's config is not inherited, and
the native node's logging is compile-time only (its runtime logLevel is a
no-op), so without the define the library floods stdout and no TUI on top is
readable. The vendor directory is excluded from the workspace so its Nim
build is not dragged into `--workspace` builds, fmt or clippy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ai43sF2rymPFMG9iki9fwL
This commit is contained in:
Ivan FB 2026-07-18 17:29:51 +02:00
parent 37ae88bfa7
commit 1123c7fa70
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
5 changed files with 1342 additions and 141 deletions

View File

@ -5,3 +5,27 @@
# "was built for newer macOS version" linker warnings.
# This is caused by nimble and cargo defaulting to different targets.
MACOSX_DEPLOYMENT_TARGET = { value = "15.0", force = false }
# Compile the native node's logging out, as the old Nix package did with
# `chroniclesLogLevel = "FATAL"`. This is not a preference — it is the only
# control there is. liblogosdelivery's static build sets no
# `chronicles_runtime_filtering=on`, so the `logLevel` a node is configured with
# reaches `topics_registry.setLogLevel` and does nothing; and the nimble file's
# `buildLibrary` drops the `params` its static branch is handed, so even the
# compile-time level it means to pass never lands. Without this the library logs
# TRACE-level chatter to stdout and no TUI on top of it is readable.
#
# It rides on NIM_PARAMS because that is what nimble's `getNimParams()` reads;
# make re-exports it, so cargo -> build.rs -> make -> nimble carries it through.
NIM_PARAMS = { value = "-d:chronicles_log_level=FATAL", force = false }
# liblogosdelivery pulls in Go-derived and BoringSSL objects that reference these
# system frameworks. waku-bindings carries the same flags in its own
# .cargo/config.toml, but cargo reads that file only for the workspace being
# built — a path dependency's config is ignored — so the consumer has to repeat
# them or the link fails on macOS.
[target.'cfg(target_os = "macos")']
rustflags = [
"-C",
"link-args=-framework CoreFoundation -framework Security -framework CoreServices -lresolv",
]

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "vendor/logos-delivery-rust-bindings"]
path = vendor/logos-delivery-rust-bindings
url = https://github.com/logos-messaging/logos-delivery-rust-bindings
branch = chore/collapse-waku-sys

1438
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
resolver = "3"
members = [
"bin/channel-chat",
"bin/chat-cli",
"core/account",
"core/conversations",
@ -16,9 +17,15 @@ members = [
"crates/generic-chat",
"extensions/components",
"extensions/embedded-logos-delivery",
"extensions/logos-delivery-rust",
]
# A path dependency living inside the workspace directory is otherwise pulled in
# as a member automatically, which would put the vendored bindings — and the
# whole Nim build behind them — into `--workspace` builds, `cargo fmt --all` and
# clippy. Excluding the directory keeps it a plain path dependency: only the
# crates that actually depend on it build it.
exclude = ["vendor/logos-delivery-rust-bindings"]
default-members = [
"core/account",
"core/conversations",
@ -40,12 +47,17 @@ crypto = { path = "core/crypto" }
embedded-logos-delivery = { path = "extensions/embedded-logos-delivery" }
libchat = { path = "core/conversations" }
logos-chat = { path = "crates/logos-chat" }
logos-delivery = { path = "extensions/logos-delivery-rust"}
logos-generic-chat = { path = "crates/generic-chat" }
shared-traits = { path = "core/shared-traits" }
storage = { path = "core/storage" }
# The upstream logos-delivery bindings. Unpublished, and its build.rs builds the
# native library out of its own `vendor/` submodule, so it is consumed from the
# checkout under vendor/ rather than from a registry — as its README prescribes.
waku-bindings = { path = "vendor/logos-delivery-rust-bindings/waku-bindings" }
# External Workspace dependency declarations (sorted)
base64 = "0.22"
blake2 = "0.10"
crossbeam-channel = "0.5"

@ -0,0 +1 @@
Subproject commit b48946a64a6700d3b7dfb70f817861402ca14b4e