From: Ross Burton Date: Tue, 4 May 2021 12:57:40 +0000 (+0100) Subject: oe-buildenv-internal: add BitBake's library to PYTHONPATH X-Git-Tag: 2021-04.1-hardknott~23 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=c65fe0a000c1170d346ffcddf7c65fad53a55b36;p=openembedded-core.git oe-buildenv-internal: add BitBake's library to PYTHONPATH There are many Python scripts in oe-core that want to use Tinfoil, and right now they have to know where they are to work out where BitBake is likely to be. This is suboptimal as BitBake could be somewhere else, so this approach doesn't scale to other layers at all. Solve this by adding BITBAKEDIR/lib to PYTHONPATH in oe-buildenv-internal, so that Python has BitBake on its search path once the build system is configured. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit a48178f6d00e7f97a09f42d5a164204e9dcffa9f) Signed-off-by: Anuj Mittal --- diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal index ba0a9b44d6..e0d920f2fc 100755 --- a/scripts/oe-buildenv-internal +++ b/scripts/oe-buildenv-internal @@ -88,6 +88,10 @@ if [ ! -d "$BITBAKEDIR" ]; then return 1 fi +# Add BitBake's library to PYTHONPATH +PYTHONPATH=$BITBAKEDIR/lib:$PYTHONPATH +export PYTHONPATH + # Make sure our paths are at the beginning of $PATH for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do # Remove any existences of $newpath from $PATH