Files
Dario LipicarandClaude Opus 5 6bf15008d0 refactor: generate the view-plugin glue, and drop the module-builder pin (#69)
* refactor(plugin): generate the view-plugin glue instead of hand-writing it

package_manager_ui becomes a universal view plugin: metadata.json declares
`interface: "universal"` plus the `codegen` block naming the .rep and the
backend class/header, and logos-qt-generator --backend ui now emits the
PluginInterface and the *Plugin (Q_PLUGIN_METADATA, name/version,
ViewPluginBase, initLogos) that were previously carried by hand in
src/package_manager_ui_{interface.h,plugin.h,plugin.cpp}. Those three files
are deleted; the generated pair is byte-for-byte equivalent in contract —
same PackageManagerUiPlugin class, same "org.logos.PackageManagerUiInterface"
IID, same name()/version(), same PackageManagerUiViewPluginBase.

This is a view, not a module, so the backend stays QT-TYPED: it still derives
PackageManagerUiSimpleSource and every .rep slot keeps its QString/QVariant
signature. The .rep is untouched. The only backend change is where its
LogosAPI comes from — the generated glue owns it and hands the backend a
typed LogosModules through LogosUiPluginContext, so:

  * the ctor drops its LogosAPI* parameter (the glue default-constructs the
    backend) and loses the `new LogosAPI("core", this)` fallback, which under
    the generated glue would have fired on every load and talked to the
    modules under the wrong identity;
  * the constructor's singleShot kick-off moves to onContextReady(), which
    fires exactly when modules() becomes live — the ctor no longer races the
    framework's dependency wiring;
  * the 17 `LogosModules logos(m_logosAPI)` temporaries become
    `LogosModules& logos = modules()`, and clientReady() reads its LogosAPI
    off modules().api behind isContextReady(). Every call below those lines
    is unchanged.

Verified: `lm methods --json` and `lm metadata --json` on the built plugin are
byte-identical before/after; the exported-symbol table differs only by the new
onContextReady() (+thunk) and the ctor signature, with all 18 .rep slots
present in both; the replica-factory dylib's symbol table is identical. The
repo's only check, integration-test, is 23 passed / 0 failed both before and
after, and the run arms the same 10 event subscriptions and issues the same
six async dependency calls in the same counts.

Rebase note (replayed onto master 39a5fa5): master's #67 "tell a dropped
install reply apart from a failed install" landed two NEW call sites in
installLocalPackage that still built a LogosModules from the m_logosAPI member
this commit removes. git auto-merged PackageManagerBackend.cpp without a
conflict marker, so the breakage was silent until compile — `no member named
'm_logosAPI'`, plus a vexing-parse cascade where `LogosModules logos(...)` was
read as a function declaration and collided with vendor semver's `namespace
logos`. Both sites now use this commit's own idiom, the one already applied at
the other sixteen: `LogosModules& logos = modules();` and
`LogosModules& logos = self->modules();`. Nothing from #67 was dropped.

Verified after the replay: `nix build .#default` and `.#lgx` succeed, and the
repo's only check, integration-test, is 24 passed / 0 failed (23 before #67
added one).

* chore(deps): rev-pin logos-module-builder to the pushed B4 stack

The view-plugin glue this module now relies on is emitted by
logos-qt-generator --backend ui, which lives on logos-module-builder's
feat/sdk-codegen-b4-qt-host-repoint branch (c60d4a9), not on its master. The
url was bare, so `nix flake update` would relock to master and drop the
generator — hence the rev in the url and not only in the lock.

Through that one pin the B3/B4 stack arrives at the revisions those levels
pushed: logos-protocol c8bab12, logos-cpp-sdk a04b278, logos-qt-sdk 8a06b87,
logos-plugin-qt/-core cc24fa1, logos-view-module-runtime 5510acd,
logos-standalone-app 39f4f2b, logos-test-framework c382ab1. The pin this
replaces (9d3b7cc) is an ancestor of c60d4a9, so it is a fast-forward.
package_manager, package_downloader and logos-package are left where master
put them.

Green on this lock: `.#default`, `.#lgx`, and the repo's only check
`.#integration-test` at 24 passed / 0 failed. Unlike the sibling ui repos in
this bump, nothing here trips the newer logos-package icon contract — master
already moved the icon to a 256x256 src/icons/modules.png.

* chore(deps): retire the logos-module-builder rev pin

c932e1c pinned logos-module-builder at c60d4a9 (tip of
feat/sdk-codegen-b4-qt-host-repoint) because this module's generated
view-plugin glue is emitted by `logos-qt-generator --backend ui`, and
neither that generator backend nor the builder's `uiCodegen` hand-off
existed on the builder's master.

logos-module-builder#203 merged the B4 stack. Master (8cd62c7) carries
lib/modulePreConfigure.nix's `uiCodegen` byte-identical to the pinned
rev's, and carries no rev pins of its own, so it locks logos-cpp-sdk
(95d7b3a), logos-qt-sdk (19c844f), logos-plugin-qt (9b2c64e) and
logos-protocol (f4407ff) at their merged masters — the same generation
the Qt host runtime this plugin is loaded by comes from.

#203 was squash-merged, so `merge-base --is-ancestor c60d4a9 master` is
correctly false; the check that matters is that master's files carry
`uiCodegen`, `--backend ui` and logos_ui_plugin_context.h.

Relocked with an explicit `nix flake lock --update-input
logos-module-builder`; a bare `nix flake lock` would have left the lock
on c60d4a9 while flake.nix read "master". Verified: the locked rev moved
c60d4a9 -> 8cd62c7. The pin had also forced a duplicate SDK closure into
the lock — node count drops 12924 -> 9751, back in line with master's
9722.

Verified on aarch64-darwin:
  nix build .#default          -> /nix/store/raqxbzb...-logos-package_manager_ui-module
  nix build .#integration-test -> 24 passed, 0 failed
  nix build .#lgx              -> /nix/store/is4paj1...-logos-package_manager_ui-module-lgx-1.0.0

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 11:19:08 -03:00

40 lines
858 B
JSON

{
"name": "package_manager_ui",
"display_name": "Package Manager",
"version": "1.0.0",
"type": "ui_qml",
"interface": "universal",
"category": "ui",
"description": "Package Manager UI plugin for managing plugins and packages",
"main": "package_manager_ui_plugin",
"icon": "src/icons/modules.png",
"view": "qml/PackageManager.qml",
"dependencies": [
"package_manager",
"package_downloader"
],
"codegen": {
"rep": "src/package_manager_ui.rep",
"backend_class": "PackageManagerBackend",
"backend_header": "PackageManagerBackend.h"
},
"nix": {
"packages": {
"build": [],
"runtime": [
"qt6.qtdeclarative",
"zstd"
]
},
"external_libraries": [
{
"name": "lgx"
}
],
"cmake": {
"find_packages": [],
"extra_sources": []
}
}
}