All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oe-buildenv-internal: add BitBake's library to PYTHONPATH
@ 2021-05-04 12:57 Ross Burton
  0 siblings, 0 replies; only message in thread
From: Ross Burton @ 2021-05-04 12:57 UTC (permalink / raw)
  To: openembedded-core

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>
---
 scripts/oe-buildenv-internal | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index ba0a9b44d6f..e0d920f2fc2 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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-04 12:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 12:57 [PATCH] oe-buildenv-internal: add BitBake's library to PYTHONPATH Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.