Skip to contentSkip to conversation

oe-buildenv-internal: add BitBake's library to PYTHONPATH

PATCH New Ross Burton 1 participant 1 message May 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 scripts/oe-buildenv-internal | 4 ++++
 1 file changed, 4 insertions(+)
scripts/oe-buildenv-internal +4 -0
index ba0a9b44d6f..e0d920f2fc2 100755
@@ -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
Signature · 1 line
2.25.1