feat: consume concrete deps via LIDL (no dep plugin build) + publish lidl output#110
Conversation
Building/packaging a module no longer builds its (universal) dependency
modules — only `#run` (the standalone app) still bundles dep plugins.
- mkLogosModule: new packages.<sys>.lidl output — a cheap codegen-only
derivation that runs `logos-cpp-generator --header-to-lidl` over the universal
impl header (no Qt/plugin compile), publishing the module's interface LIDL.
- mkLogosModule: per-dependency classification. A dep that exposes a `lidl`
output (or has a dependency_overrides entry) is LIDL-based → passed to the
backend as `staticDeps` (generated via --dep, no dep plugin build). Deps
without a `lidl` output take the TRANSITIONAL header-copy fallback
(`legacyHeaderDepNames` → resolvedModuleDeps), identical to today; isolated
and banner-commented for removal once all modules publish LIDL.
- parseMetadata: normalize `dependencies` to name strings (accept object
entries) and add optional `dependency_overrides` ({ file, input?, impl_class? })
to force a specific LIDL/header source per dep.
- buildCppPlugin (QML C++ backend): same classification + staticDeps threading,
so UI modules also stop building their universal deps.
Requires logos-cpp-sdk#77 (--header-to-lidl / --dep) and logos-plugin-qt#9
(staticDeps → --dep). A follow-up flake.lock bump pins those once merged
(mirrors the interface-deps plugin-core bump, #109); local builds use
`ws ... --auto-local`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the module build pipeline so that building a module no longer builds/bundles its universal concrete dependency modules. Instead, dependencies can be consumed via a cheap published LIDL contract (packages.<sys>.lidl), and consumers generate typed modules().<dep> bindings from that contract; only standalone app runs still build/bundle dependency plugins.
Changes:
- Normalize
metadata.jsonconcretedependenciesto a list of name strings, and add optionaldependency_overridesto force a dependency’s LIDL/header source. - Classify concrete deps into LIDL-based (
staticDeps→ passed as--depinputs to codegen, no dep plugin build) vs TRANSITIONAL header-copy fallback (legacyHeaderDepNames→ builds deps, same as today). - Publish a new per-module
lidlpackage output for universal modules by runninglogos-cpp-generator --header-to-lidlon the universal impl header.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/parseMetadata.nix |
Normalizes dependencies entries and introduces dependency_overrides parsing/validation. |
lib/mkLogosModule.nix |
Implements concrete-dep classification, threads staticDeps, and publishes a lidl package output. |
lib/buildCppPlugin.nix |
Mirrors the same dep classification for QML C++ backend builds and threads staticDeps into backend builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…a tests - depLidlOf now explicitly guards `packages`/`<system>` so a raw-derivation dependency input returns null (→ transitional header-copy fallback) rather than risking a throw. Applied in mkLogosModule.nix and buildCppPlugin.nix. - test-parse-metadata.nix: cover `dependencies` object-entry normalization and `dependency_overrides` parsing/validation (file required; .h needs impl_class). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed the Copilot review (commit 971be95):
🤖 Generated with Claude Code |
… backends Pin the merged --header-to-lidl/--dep generator (logos-cpp-sdk#77) and the staticDeps-aware Qt backend (logos-plugin-qt#9) so this module builder's LIDL dependency consumption works against published inputs (not just --auto-local). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Bumped the flake inputs now that the upstream PRs are merged (commit 1360c78):
So this PR now consumes the published backends (no 🤖 Generated with Claude Code |
Consume concrete dependencies via LIDL — no dep plugin build
The core of the feature: building (and packaging) a module no longer builds its universal dependency modules. Each module publishes a cheap LIDL contract; consumers generate the typed
modules().<dep>bindings from it. The only thing that still builds/bundles dep plugins is the standalone app run (apps.default/#run), which must — it loads them.This PR
mkLogosModule.nix— newpackages.<sys>.lidloutput: a cheaprunCommandthat runslogos-cpp-generator --header-to-lidlover the universal impl header (no Qt/plugin compile). Per-dependency classification: a dep exposing alidloutput (or adependency_overridesentry) is LIDL-based → threaded to the backend asstaticDeps(generated via--dep, no dep plugin build); otherwise it takes the TRANSITIONAL header-copy fallback (legacyHeaderDepNames), identical to today.parseMetadata.nix—dependenciesnormalized to name strings (accepts object entries); new optionaldependency_overrides({ file, input?, impl_class? }) to force a dep's LIDL/header source.buildCppPlugin.nix— same classification +staticDepsthreading for QML C++-backend (UI) modules.The header-copy fallback is isolated and banner-commented (
# TRANSITIONAL … Remove once all modules expose packages.<sys>.lidl) so it can be deleted as a localized change once modules migrate.Cross-repo chain (merge order)
--header-to-lidl+--dep--depflagsVerification (all with
--auto-local)test_context_module_cpp, the universal deptest_basic_module_cpp's closure contains only…-lidl.drv— no-module-lib/-headers-std; the legacy deptest_basic_modulebuilds via the fallback (as intended).lidloutput is cheap: no module-plugin compile in its build closure (just the generator).test_context_module_cpp's cross-module calls and the typed event round-trip (subscribeToBasicCppEvents→triggerTestEvent→getLastTestEventData) through the LIDL-generated wrapper. (The 1 failure is a pre-existing flaky SIGSEGV intest_ipc_new_api_module → test_extlib_module, a legacy/fallback path untouched by this change.)ws test logos-module-builder --auto-localpasses (incl.test-parse-metadata, QML + framework integration).🤖 Generated with Claude Code