From 4a45d22e9e641454b28df4f2bbdf2b138953941d Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Sun, 23 Aug 2026 16:30:19 +0100 Subject: [PATCH] feat: let Nimble dependents build liblogosdelivery (#4137) * feat: let Nimble dependents build liblogosdelivery Nimble installs only a package's namesake directory, so a dependent got logos_delivery/ alone: enough to compile Nim against this package, not enough to build the C library, whose entry point and headers live in library/. installDirs ships that, and migrations/, which the postgres driver reaches by relative import. The build recipe moves into library/build_lib.nims so it ships too, and a dependent builds the library the same way we do instead of copying a flag list. buildLibrary now delegates to it. The move is behaviour-preserving: buildLibrary's `params` was never referenced by either exec string, so the chronicles and warning flags the platform tasks pass have always been discarded, and they still are. Making them honest would move shipped artifacts from INFO to TRACE logging, which is a separate decision. cBindingsDir is derived from the library directory rather than the cwd, so the generated header lands beside the liblogosdelivery.h that includes it wherever the package is checked out. Needed by status-go, which consumes logos-delivery through Nimble (status-im/status-app#19907, logos-messaging/pm#380). * feat: let Nimble dependents build liblogosdelivery Nimble installs only a package's namesake directory, so a dependent received logos_delivery/ alone: enough to compile Nim against this package, not enough to build the C library, whose entry point and headers live in library/. tools/ is needed too, because logos_delivery imports tools/confutils. The single host-platform task saves every consumer dispatching on the OS itself; the per-platform tasks stay for callers that want a specific one. --- logos_delivery.nimble | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/logos_delivery.nimble b/logos_delivery.nimble index 7bd3402e7..ccc05f75a 100644 --- a/logos_delivery.nimble +++ b/logos_delivery.nimble @@ -8,7 +8,10 @@ version = "0.38.1" author = "Status Research & Development GmbH" description = "Logos-delivery, Private P2P Messaging for Resource-Restricted Devices" license = "MIT or Apache License 2.0" -skipDirs = @["tests", "examples", "tools", "apps", "simulations", "metrics"] +skipDirs = @["tests", "examples", "apps", "simulations", "metrics"] + +# Nimble installs only the namesake directory; dependents need these too. +installDirs = @["library", "migrations", "tools"] const RequiredNimVersion = "2.2.4" ## This is the nim compiler version that we are working on. Other versions may behave differently. @@ -509,6 +512,14 @@ let chroniclesParams = ## Liblogosdelivery build tasks +task liblogosdelivery, "Build liblogosdelivery for the host platform": + when defined(windows): + buildLibDynamicWindows("liblogosdelivery", "library") + elif defined(macosx): + buildLibDynamicMac("liblogosdelivery", "library") + else: + buildLibDynamicLinux("liblogosdelivery", "library") + task liblogosdeliveryDynamicWindows, "Generate bindings": buildLibDynamicWindows("liblogosdelivery", "library")