]> code.ossystems Code Review - openembedded-core.git/commit
bitbake.conf: Prevent pyc file generation in pseudo context
authorPaul Barker <pbarker@konsulko.com>
Wed, 16 Dec 2020 18:16:16 +0000 (18:16 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 20 Dec 2020 00:03:01 +0000 (00:03 +0000)
commit73d538f20743017a44cea4c20dbe09a0327cfc71
tree2ce07b61ade0d1945a481668cceed93de937cbe1
parent55618cbd58d6784a82e773f323723be6f722232f
bitbake.conf: Prevent pyc file generation in pseudo context

This also effectively reverts commit b6d30c21b0:
    bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta

The contents of ${COREBASE}/meta were ignored as pyc files could be
generated for the contents of the lib subdirectory if python modules
were imported within a pseudo context. However this doesn't protect us
from pyc files being generated in the lib directories for other layers.
It's far better to tell python not to produce pyc files when running
under pseudo (by setting the PYTHONDONTWRITEBYTECODE variable) as this
will cover any location where pyc files could possibly be created. This
variable is set in FAKEROOTBASEENV so that it applies to the
bitbake-worker instance for fakeroot tasks, preventing pyc files from
being generated for imports in python tasks themselves.

Also add a test case to ensure that pyc files are not created in tasks
which are executed under pseudo.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-selftest/lib/pseudo_pyc_test1.py [new file with mode: 0644]
meta-selftest/lib/pseudo_pyc_test2.py [new file with mode: 0644]
meta-selftest/recipes-test/pseudo-pyc-test/pseudo-pyc-test.bb [new file with mode: 0644]
meta/conf/bitbake.conf
meta/lib/oeqa/selftest/cases/pseudo.py [new file with mode: 0644]