Bug 7587 - %ghost entries incorrect for Python 3
Summary: %ghost entries incorrect for Python 3
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.13.0
Assignee: Pierre Ossman
Keywords: nikle_tester, prosaic
Depends on:
Blocks: 4586 7586
  Show dependency treegraph
Reported: 2020-11-10 09:39 CET by Pierre Ossman
Modified: 2020-11-30 14:06 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Description Pierre Ossman cendio 2020-11-10 09:39:25 CET
Python 3.2, and later 3.5, has changed how the cache of compiled Python files work:


We need to update our %ghost entries in our RPMs to deal with this.

Debian still lacks %ghost support (bug 7586), but we might want to look how it handles this situation.
Comment 1 Pierre Ossman cendio 2020-11-23 16:26:15 CET
A major problem with the new approach is that there is a potentially unknown part of the cache filenames. Even if we assume it's just CPython there is still a version number that could be anything. And %ghost doesn't allow globbing, so we can't have it grab everything.

Debian handles this by globbing in their prerm scripts. However this fails to handle "rpm -qf" or "rpm -ql".

I suppose we'll have to guess how many versions of CPython might be released before a particular version of ThinLinc is obsolete. At minimum we would need to include the three years that a ThinLinc release is supported.

Python has decided on one major release a year, so that would be a minimum of three future versions:


A major downside to this approach is a lot of spam in "rpm -ql" for a package as all %ghost entries are included there.
Comment 2 Pierre Ossman cendio 2020-11-24 09:43:48 CET
To keep the number of entries down somewhat we could at least omit the optimised versions. We don't currently include those (for Python 2), and I'm not sure under what circumstances customers might actually be forcing Python to optimise things.
Comment 10 Pierre Ossman cendio 2020-11-25 10:14:50 CET
Done. Tester should check that "rpm -qf" works, and old files are removed on install and upgrade.
Comment 11 Niko Lehto cendio 2020-11-30 14:06:25 CET
Tested installation/uninstallation and upgrades with nighlty build 6672:
* Installation
  - pyc files all belong to a package (rpm -qf)
* Uninstallation
  - All pyc files are removed
* Upgrading (Check that all pyc files belong to correct package version)
  - 4.12 -> nightly 6672
  - nightly 6669 -> 6672 (both containing these relevant changes)

Looks good!

Note You need to log in before you can comment on or make changes to this bug.