From 3aefbc55b59488c04efa18cb2335af855bc19f7e Mon Sep 17 00:00:00 2001 From: Dario Lipicar Date: Sun, 14 Jun 2026 00:55:13 -0300 Subject: [PATCH] feat(universal): route core universal modules through the cdylib mechanism (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit apiStyle for `interface: "universal"` core modules becomes "lp" (was "std"): they now build as header-first cdylibs — Qt-free impl + the common module-impl C ABI export seam + uniform Qt glue, with outbound modules(). calls hitting logos-protocol's lp_* C ABI directly. An unchanged universal module recompiles Qt-free in its impl/wrapper TUs and still loads via the same Qt plugin (load + call ABI preserved). UI universal backends (type: ui_qml) derive a Qt SimpleSource and cannot be Qt-free, so they stay on the std surface. Everything else (legacy) stays qt. Pairs with logos-module-builder modulePreConfigure.universalCodegen, which now derives the LIDL from the impl header and runs the cdylib backend. Co-authored-by: Claude Opus 4.8 (1M context) --- lib/buildPlugin.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/buildPlugin.nix b/lib/buildPlugin.nix index 692290b..e1fbe1c 100644 --- a/lib/buildPlugin.nix +++ b/lib/buildPlugin.nix @@ -25,12 +25,15 @@ # dep already ships pre-built header variants (`.headers-qt` and # `.headers-std` — see mkLogosModule.nix's `buildHeaders` calls), # so we just copy from the right one. No codegen at consume time. - # cdylib modules get the Qt-free outbound surface: the generated - # LogosModules umbrella + dep wrappers call the logos-protocol C ABI - # (lp_*) directly, so the module's own TUs never include Qt. universal - # modules keep the std surface (Qt bridged inside the generated .cpp); - # everything else stays Qt-typed. + # cdylib AND core universal modules get the Qt-free outbound surface: the + # generated LogosModules umbrella + dep wrappers call the logos-protocol C + # ABI (lp_*) directly, so the module's own TUs never include Qt (universal + # is now a header-first cdylib — see modulePreConfigure.universalCodegen). + # UI universal backends (type: ui_qml) inherently derive a Qt SimpleSource, + # so they stay on the std surface (Qt bridged inside the generated .cpp); + # everything else (legacy / handcrafted Qt) stays Qt-typed. apiStyle = if config.interface == "cdylib" then "lp" + else if config.interface == "universal" && (config.type or "core") != "ui_qml" then "lp" else if config.interface == "universal" then "std" else "qt";