Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914968 - app-admin/syslog-ng-4.8.1 - does not byte compile python modules
Summary: app-admin/syslog-ng-4.8.1 - does not byte compile python modules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Tomáš Mózes
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-09-30 10:12 UTC by Daniel Pielmeier
Modified: 2025-01-09 11:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Pielmeier gentoo-dev 2023-09-30 10:12:41 UTC
syslog-ng python modules are byte compiled at runtime and thus outside of the control of the package manager and will remain as cruft after removing syslog-ng.

E.g. python modules in this directories will be byte compiled when fist running syslog-ng:
/usr/lib64/syslog-ng/python/syslogng
/usr/lib64/syslog-ng/python/syslogng/modules/hypr

There are more python modules around but maybe they are not used.

The ebuild calls python_optimize [1] to byte compile modules. This however only works if the modules are installed to standard locations. If this is not the case the paths to the modules have to be specified. 

python_optimize "${ED}"/usr/lib64/syslog-ng/python

[1] https://projects.gentoo.org/python/guide/helper.html#byte-compiling-python-modules
Comment 1 Daniel Pielmeier gentoo-dev 2024-11-30 21:02:23 UTC
Ping!
Comment 2 Tomáš Mózes 2024-12-03 13:18:12 UTC
Thank you Daniel for the description and the proposed fix, it's in the new revision, just tried installing with USE=python and them removing the package, the directories are now gone.
Comment 3 Larry the Git Cow gentoo-dev 2024-12-08 18:58:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5e5f715f0e579b36d2b91e16de704ee41e2481c

commit a5e5f715f0e579b36d2b91e16de704ee41e2481c
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2024-12-03 13:12:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-08 18:57:56 +0000

    app-admin/syslog-ng: fix python byte compile, stop spurious kmsg logs
    
    Patch taken from:
    https://github.com/syslog-ng/syslog-ng/pull/5168
    https://github.com/syslog-ng/syslog-ng/issues/5159
    
    Closes: https://bugs.gentoo.org/945490
    Closes: https://bugs.gentoo.org/914968
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/39576
    Signed-off-by: Sam James <sam@gentoo.org>

 .../syslog-ng-4.8.1-kmsg-invalid-argument.patch    |  53 ++++++
 app-admin/syslog-ng/syslog-ng-4.8.1-r1.ebuild      | 195 +++++++++++++++++++++
 2 files changed, 248 insertions(+)
Comment 4 Daniel Pielmeier gentoo-dev 2024-12-08 20:42:58 UTC
Thanks for taking care of this!