Hello Nicolas, On Sat, 2 Nov 2019 18:28:09 +0100 Nicolas Iooss <nicolas.iooss@xxxxxxx> wrote: > When selinux module is imported from a Python script, the content of > __init__.py is compiled into bytecode and the result is saved into a > file if it is allowed. For example, when root runs with Python 3.7 a > script that uses "import selinux" on a system where SELinux is in > permissive mode, this file may be created: > > /usr/lib/python3.7/site-packages/selinux/__pycache__/__init__.cpython-37.pyc > > Prevent this file from being dynamically created by creating it when > libselinux is installed, using "python -m compileall". > > Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> As far as I know, this not typically done by "setup.py install", and this is generally left to distributions. In the context of Buildroot [1], we do the byte-compilation all at once at the very end of the build of all packages. Having individual packages do their own byte-compilation would be annoying. If you would like to have this byte-compilation done by the SELinux Makefile, could you make it optional (even if you decide to enable it by default) ? Thanks! Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com