Skip to content

Conversation

@sidt4
Copy link
Contributor

@sidt4 sidt4 commented Aug 24, 2025

Please refer commit log.

All changes tested on latest Solus GNOME.

Fixes: #771

@sidt4
Copy link
Contributor Author

sidt4 commented Aug 24, 2025

Tested on top of 69cd3a1.

This MR will work with python backends which use the old or the new details_full API, hence backward compatible as shown below.

Without download_bytes argument:

/usr/share/PackageKit/helpers/eopkg/eopkgBackend.py:

    self.details(pkg_id, pkg.summary, ",".join(pkg.license), group, description, homepage, size)
sid@solus-gnome ~ $ pkcon get-details 0ad-data
Resolving                               [=========================]         
Getting details                         [=========================]         
Querying                                [=========================]         
Finished                                [=========================]         
Package description
  package:       0ad-data-0.27.0-11.x86_64
  summary:       Cross-platform, 3D and historically-based real-time strategy game (data files)
  license:       GPL-2.0-or-later,CCPL
  group:         games
  download size: unknown
  size:          3.5 GB (3,526,938,164 bytes)
  url:           https://play0ad.com
  description:   Cross-platform, 3D and historically-based real-time strategy game (data files)
sid@solus-gnome ~ $ 

With download_bytes argument:

/usr/share/PackageKit/helpers/eopkg/eopkgBackend.py:

    self.details(pkg_id, pkg.summary, ",".join(pkg.license), group, description, homepage, size, dl_size)
sid@solus-gnome ~ $ pkcon get-details 0ad-data
Resolving                               [=========================]         
Getting details                         [=========================]         
Querying                                [=========================]         
Finished                                [=========================]         
Package description
  package:       0ad-data-0.27.0-11.x86_64
  summary:       Cross-platform, 3D and historically-based real-time strategy game (data files)
  license:       GPL-2.0-or-later,CCPL
  group:         games
  download size: 1.4 GB (1,368,603,575 bytes)
  size:          3.5 GB (3,526,938,164 bytes)
  url:           https://play0ad.com
  description:   Cross-platform, 3D and historically-based real-time strategy game (data files)

@sidt4 sidt4 force-pushed the spawn-backend-get-detail-fixes branch from 357af83 to a398001 Compare August 24, 2025 19:10
@sidt4 sidt4 mentioned this pull request Aug 24, 2025
sidt4 added 3 commits August 25, 2025 11:20
…e is reported properly

This is needed for download size reporting to work in PK clients which
use the 'download-size' property (introduced in 3741c68) in
'get-details' response. 'download-size' property is available only
when the PK backend uses 'pk_backend_job_details_full()', not
otherwise.

Fixes: PackageKit#771

Part of: PackageKit#781
1073741824 (1 GiB) size check was added in 2007 commit 6f06e1b. 1
GiB package sizes are very much possible in 2025. From a quick check,
Debian has ~10 packages and Solus a few.

We now allow the maximum size supported by "gulong" on the platform,
beyond which there is nothing much we can do without breaking the
API. We don't do any size restriction checks for non-spawned
backends, so there is no point doing it here.

Fixes the following issue as seen in Solus GNOME:

$ pkcon get-details 0ad-data
Resolving                               [=========================]
Getting details                         [=========================]
Querying                                [=========================]
Starting                                [=========================]
Finished                                [=========================]

PackageKit logs with error:
---------------------------

08:36:22	PackageKit          sending 'get-details	0ad-data;0.27.0-11;x86_64;Solus'
08:36:22	PackageKit          failed to parse: details	0ad-data;0.27.0-11;x86_64;Solus	Cross-platform, 3D and historically-based real-time strategy game (data files)	GPL-2.0-or-later,CCPL	games	Cross-platform, 3D and historically-based real-time strategy game (data files)	https://play0ad.com	3526938164	1368603575: package size cannot be that large

With this commit:
-----------------

$ pkcon get-details 0ad-data
Resolving                               [=========================]
Getting details                         [=========================]
Querying                                [=========================]
Finished                                [=========================]
Package description
  package:       0ad-data-0.27.0-11.x86_64
  summary:       Cross-platform, 3D and historically-based real-time strategy game (data files)
  license:       GPL-2.0-or-later,CCPL
  group:         games
  download size: 1.4 GB (1,368,603,575 bytes)
  size:          3.5 GB (3,526,938,164 bytes)
  url:           https://play0ad.com
  description:   Cross-platform, 3D and historically-based real-time strategy game (data files)
@sidt4 sidt4 force-pushed the spawn-backend-get-detail-fixes branch from a398001 to 2525f50 Compare August 25, 2025 10:39
@sidt4 sidt4 changed the title pk-backend-spawn: Use 'pk_backend_job_details_full()' pk-backend-spawn: Support 'pk_backend_job_details_full()' Aug 25, 2025
@arrowd
Copy link
Contributor

arrowd commented Aug 31, 2025

FWIW, this looks good to me.

@joebonrichie
Copy link
Contributor

joebonrichie commented Oct 31, 2025

Partially superseded by 736585f

@ximion
Copy link
Member

ximion commented Nov 1, 2025

Right. To be honest, I really had thought we would be able to get rid of spawned backends (at least the generic support) - but now that we're getting another one, I guess that's not the case and we should make sure the current code works.

@joebonrichie
Copy link
Contributor

Yeah the way spawned backends is architectured isn't my favourite tbh. If i gained a bunch of time it'll be interesting to experiment with other approaches. Cython may work. I know ikey was also experimenting with a varlink approach at some point. /offtopic

Anyway w.r.t the rest of the existing spawned backends do we just want to emit 2**64 - 1 (G_MAXUINT64) for the download-size property? It'll then correctly report as 'Unknown' in pkcon get-details for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'download-size' is not hooked up to UI or spawned python backends

4 participants