Openembedded Core Discussions
 help / color / mirror / Atom feed
From: sunilkumar.dora@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: richard.purdie@linuxfoundation.org,
	sundeep.kokkonda@windriver.com, Randy.MacLeod@windriver.com,
	sunilkumar.dora@windriver.com, raj.khem@gmail.com
Subject: [PATCH 2/3] clang/llvm: Point lit at the target python for the test suite
Date: Mon,  9 Nov 2026 22:16:07 -0800	[thread overview]
Message-ID: <20261110061608.4043909-3-sunilkumar.dora@windriver.com> (raw)
In-Reply-To: <20261110061608.4043909-1-sunilkumar.dora@windriver.com>

From: Sunil Dora <sunilkumar.dora@windriver.com>

lit.site.cfg.py records the python cmake found on the build host, but
the test suite runs on the target. Any test calling that python directly
fails there. In llvm the extract_symbols tests, new in 23.1.4, do this
and fail on all the -tc builders. In clang, %deps-to-rsp,
%scan-deps-filter, %hmaptool and %check_analyzer_fixit are built the
same way, which is why the ClangScanDeps tests got excluded in
0e7f898dc4.

Rewrite the recorded path after configure in both recipes. Changing
Python3_EXECUTABLE itself is not an option, cmake.bbclass needs it for
the build.

The extract_symbols config is being changed upstream to use the python
running lit, https://github.com/llvm/llvm-project/pull/240530. That
covers only those two tests though, the clang substitutions and the
other llvm ones still use the configured python, so this is done in the
recipes for all of them rather than by carrying the upstream patch.

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 meta/recipes-devtools/clang/clang_git.bb | 12 ++++++++++++
 meta/recipes-devtools/clang/llvm_git.bb  |  9 +++++++++
 2 files changed, 21 insertions(+)

diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb
index 90076f9d6d..6c149945fd 100644
--- a/meta/recipes-devtools/clang/clang_git.bb
+++ b/meta/recipes-devtools/clang/clang_git.bb
@@ -100,6 +100,18 @@ do_configure:prepend() {
   ln -srf ${S}/clang-tools-extra ${S}/clang/tools/extra
 }
 
+# The tests run on the target, so lit must use the target python.
+clang_lit_target_python() {
+    sed -i 's|^config.python_executable = .*|config.python_executable = "${bindir}/python3"|' \
+        ${B}/test/lit.site.cfg.py
+}
+
+do_configure:append:class-target() {
+    if [ "${CLANG_ENABLE_TESTSUITE}" = "1" ]; then
+        clang_lit_target_python
+    fi
+}
+
 do_install:append() {
     oe_multilib_header clang/Config/config.h
 }
diff --git a/meta/recipes-devtools/clang/llvm_git.bb b/meta/recipes-devtools/clang/llvm_git.bb
index bec7e93eab..a61ddcb7ef 100644
--- a/meta/recipes-devtools/clang/llvm_git.bb
+++ b/meta/recipes-devtools/clang/llvm_git.bb
@@ -105,8 +105,17 @@ reproducible_build_variables() {
         ${B}/tools/llvm-config/BuildVariables.inc
 }
 
+# The tests run on the target, so lit must use the target python.
+llvm_lit_target_python() {
+    sed -i 's|^config.python_executable = .*|config.python_executable = "${bindir}/python3"|' \
+        ${B}/test/lit.site.cfg.py
+}
+
 do_configure:append:class-target() {
     reproducible_build_variables
+    if [ "${CLANG_ENABLE_TESTSUITE}" = "1" ]; then
+        llvm_lit_target_python
+    fi
 }
 do_configure:append:class-nativesdk() {
     reproducible_build_variables
-- 
2.49.0


  parent reply	other threads:[~2026-11-10  6:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  6:16 [PATCH 0/3] clang/llvm: Upgrade to 23.1.5 sunilkumar.dora
2026-11-10  6:16 ` [PATCH 1/3] clang/llvm: Upgrade from 23.1.3 to 23.1.5 release sunilkumar.dora
2026-11-10  6:16 ` sunilkumar.dora [this message]
2026-11-10  6:16 ` [PATCH 3/3] oeqa/selftest/clang: Re-enable tests that only needed the target python sunilkumar.dora
2026-11-10  7:48 ` [OE-core] [PATCH 0/3] clang/llvm: Upgrade to 23.1.5 Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110061608.4043909-3-sunilkumar.dora@windriver.com \
    --to=sunilkumar.dora@windriver.com \
    --cc=Randy.MacLeod@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=sundeep.kokkonda@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox