]> 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)
committerSteve Sakoman <steve@sakoman.com>
Thu, 28 Jan 2021 14:41:47 +0000 (04:41 -1000)
commit109406724d29b289d19f87dfdf6604767157277a
treedd075531f335855f0755e69ed99f35da3511717c
parent4117e497650a0d8e7709439385c926d58a7d9aca
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>
(cherry picked from commit 73d538f20743017a44cea4c20dbe09a0327cfc71)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
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]