Nix backend: get_packages / search / resolve return empty (desc function pointers not wired) #1

Open
opened 2026-11-26 15:14:33 -06:00 by OpenWebUI · 0 comments
Member

Summary

The Discover PackageKit backend re-enablement (overlay adding packagekit-qt to kdePackages.discover) is complete and deployed, and the daemon loads the nix backend correctly. However, package enumeration through the fork's Nix backend returns no results. The PackageKit daemon logs an assertion failure on every list/search/resolve query:

pk_backend_get_packages: assertion 'backend->desc->get_packages != NULL' failed
pk_backend_search_details: assertion 'backend->desc->search_details != NULL' failed
pk_backend_resolve: assertion 'backend->desc->resolve != NULL' failed

In the Discover GUI this surfaces as an "Update Issue: There was an issue during the update or installation process" dialog on the Updates page, and empty results on search/list pages.

Confirmed working

  • nixpkgs ships Discover with the PackageKit backend disabled via excludeDependencies = [ "packagekit-qt" ] in pkgs/kde/plasma/discover/default.nix. Our nixpkgs.overlays in pk-managed.nix re-adds packagekit-qt to kdePackages.discover.buildInputs, producing a Discover that contains packagekit-backend.so (proven build: discover-6.8.2).
  • The fork package ships lib/packagekit-backend/libpk_backend_nix.so plus bin/pkgcli (note: no pkcon).
  • pkgcli backend against the live daemon reports:
    • Backend: nix
    • Description: Nix - the purely functional package manager
    • Roles: cancel;get-details;get-packages;get-updates;install-packages;refresh-cache;remove-packages;resolve;search-details;search-name;update-packages;get-old-transactions
  • /etc/PackageKit/PackageKit.conf has DefaultBackend=nix and managed-helper set to pk-nix-managed-helper.
  • Discover launches (bin/plasma-discover), renders, and connects to the daemon over D-Bus.

The gap

Even though pkgcli backend advertises the get-packages/resolve/search-* roles, the running packagekitd asserts that backend->desc->get_packages, search_details, and resolve are NULL. So the PkBackendDesc that libpk_backend_nix.so provides is not wiring those function pointers, despite the backend binary containing the worker symbols (nix_get_updates_thread, nix_search_thread, nix_install_thread, nix_remove_thread, nix_refresh_thread, nix_get_user_profile, nix_run_managed_helper). Net effect: queries hit the assertion and return zero packages.

Repro

With the system on DefaultBackend=nix and the daemon active:

pkgcli backend                  # shows Backend: nix, roles listed (OK)
pkgcli --filter installed list  # returns 0
pkgcli resolve firefox          # returns nothing; daemon logs resolve assertion

Journal: journalctl -u packagekit shows the backend->desc->* != NULL assertions.

Suspected cause / next step

In the Nix backend source (pk_backend_nix.cc), the PkBackendDesc returned by backend_get_description() (or set in pk_backend_create) needs setGetPackages, setResolve, setSearchDetails/setSearchName, etc. to point at the existing nix_*_thread dispatchers (each should call pk_backend_run_job like the other backends do). Verify the description object actually invokes these setters; the role strings baked into the .so may come from a different code path than the runtime desc struct.

Scope note

This is the fork backend implementation, not the Discover packaging. The packaging fix (the packagekit-qt overlay in pk-managed.nix) is correct and verified; this issue tracks only the fork's Nix backend serving package queries.

Environment

  • Discover: discover-6.8.2 (with packagekit-backend.so and flatpak-backend.so both present)
  • packagekit fork: packagekit-1.4.0-pk-option1 (provides pkgcli, libpk_backend_nix.so, pk-nix-managed-helper)
  • Deployed via nixos-config flake.lock bump of the packagekit input + rebuild.yml switch (run succeeded)
## Summary The Discover PackageKit backend re-enablement (overlay adding `packagekit-qt` to `kdePackages.discover`) is complete and deployed, and the daemon loads the `nix` backend correctly. However, package **enumeration** through the fork's Nix backend returns no results. The PackageKit daemon logs an assertion failure on every list/search/resolve query: ``` pk_backend_get_packages: assertion 'backend->desc->get_packages != NULL' failed pk_backend_search_details: assertion 'backend->desc->search_details != NULL' failed pk_backend_resolve: assertion 'backend->desc->resolve != NULL' failed ``` In the Discover GUI this surfaces as an "Update Issue: There was an issue during the update or installation process" dialog on the Updates page, and empty results on search/list pages. ## Confirmed working - nixpkgs ships Discover with the PackageKit backend disabled via `excludeDependencies = [ "packagekit-qt" ]` in `pkgs/kde/plasma/discover/default.nix`. Our `nixpkgs.overlays` in `pk-managed.nix` re-adds `packagekit-qt` to `kdePackages.discover.buildInputs`, producing a Discover that contains `packagekit-backend.so` (proven build: `discover-6.8.2`). - The fork package ships `lib/packagekit-backend/libpk_backend_nix.so` plus `bin/pkgcli` (note: no `pkcon`). - `pkgcli backend` against the live daemon reports: - `Backend: nix` - `Description: Nix - the purely functional package manager` - `Roles: cancel;get-details;get-packages;get-updates;install-packages;refresh-cache;remove-packages;resolve;search-details;search-name;update-packages;get-old-transactions` - `/etc/PackageKit/PackageKit.conf` has `DefaultBackend=nix` and `managed-helper` set to `pk-nix-managed-helper`. - Discover launches (`bin/plasma-discover`), renders, and connects to the daemon over D-Bus. ## The gap Even though `pkgcli backend` advertises the `get-packages`/`resolve`/`search-*` roles, the running `packagekitd` asserts that `backend->desc->get_packages`, `search_details`, and `resolve` are NULL. So the `PkBackendDesc` that `libpk_backend_nix.so` provides is not wiring those function pointers, despite the backend binary containing the worker symbols (`nix_get_updates_thread`, `nix_search_thread`, `nix_install_thread`, `nix_remove_thread`, `nix_refresh_thread`, `nix_get_user_profile`, `nix_run_managed_helper`). Net effect: queries hit the assertion and return zero packages. ## Repro With the system on `DefaultBackend=nix` and the daemon active: ``` pkgcli backend # shows Backend: nix, roles listed (OK) pkgcli --filter installed list # returns 0 pkgcli resolve firefox # returns nothing; daemon logs resolve assertion ``` Journal: `journalctl -u packagekit` shows the `backend->desc->* != NULL` assertions. ## Suspected cause / next step In the Nix backend source (`pk_backend_nix.cc`), the `PkBackendDesc` returned by `backend_get_description()` (or set in `pk_backend_create`) needs `setGetPackages`, `setResolve`, `setSearchDetails`/`setSearchName`, etc. to point at the existing `nix_*_thread` dispatchers (each should call `pk_backend_run_job` like the other backends do). Verify the description object actually invokes these setters; the role strings baked into the `.so` may come from a different code path than the runtime `desc` struct. ## Scope note This is the fork backend implementation, **not** the Discover packaging. The packaging fix (the `packagekit-qt` overlay in `pk-managed.nix`) is correct and verified; this issue tracks only the fork's Nix backend serving package queries. ## Environment - Discover: `discover-6.8.2` (with `packagekit-backend.so` and `flatpak-backend.so` both present) - packagekit fork: `packagekit-1.4.0-pk-option1` (provides `pkgcli`, `libpk_backend_nix.so`, `pk-nix-managed-helper`) - Deployed via nixos-config `flake.lock` bump of the packagekit input + `rebuild.yml` `switch` (run succeeded)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Public/packagekit-flake#1
No description provided.