From: Yoann Congal <[email protected]>

When building the new selftest builddir, paths in environment variables
are rewritten to point to the new buildir, but users can have
environment variables that point outside of the build dir using
relative paths from builddir. We must not rewrite those.

Check this by verifying that the absolute path still contains the
builddir.

Fixes [YOCTO #15241]

Signed-off-by: Yoann Congal <[email protected]>
---
 meta/lib/oeqa/selftest/context.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/context.py 
b/meta/lib/oeqa/selftest/context.py
index 99186175e5..acc3b073bd 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -117,8 +117,11 @@ class OESelftestTestContext(OETestContext):
                     newbblayers += 'BBLAYERS = "%s"\n' % ' 
'.join(bblayers_abspath)
                     f.write(newbblayers)
 
+        # Rewrite builddir paths seen in environment variables
         for e in os.environ:
-            if builddir + "/" in os.environ[e]:
+            # Rewrite paths that absolutely point inside builddir
+            # (e.g $builddir/conf/ would be rewritten but not 
$builddir/../bitbake/)
+            if builddir + "/" in os.environ[e] and builddir + "/" in 
os.path.abspath(os.environ[e]):
                 os.environ[e] = os.environ[e].replace(builddir + "/", 
newbuilddir + "/")
             if os.environ[e].endswith(builddir):
                 os.environ[e] = os.environ[e].replace(builddir, newbuilddir)
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204370): 
https://lists.openembedded.org/g/openembedded-core/message/204370
Mute This Topic: https://lists.openembedded.org/mt/108383049/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to