]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-buildenv-internal: add BitBake's library to PYTHONPATH
authorRoss Burton <ross@burtonini.com>
Tue, 4 May 2021 12:57:40 +0000 (13:57 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Fri, 7 May 2021 00:46:18 +0000 (08:46 +0800)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a48178f6d00e7f97a09f42d5a164204e9dcffa9f)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
scripts/oe-buildenv-internal

index ba0a9b44d6f820292b05dee067602e0c7c144b26..e0d920f2fc26b1830a84738ae2334e3f300ab382 100755 (executable)
@@ -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