Skip to content

Conversation

charles-zablit
Copy link
Contributor

When testing LLDB, we want to make sure to use the same Python as the one we used to build it.

We already did this in #143183 for the Unit and Shell tests. This patch does the same thing for the API tests as well.

@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2025

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

Changes

When testing LLDB, we want to make sure to use the same Python as the one we used to build it.

We already did this in #143183 for the Unit and Shell tests. This patch does the same thing for the API tests as well.


Full diff: https://github.com/llvm/llvm-project/pull/154396.diff

1 Files Affected:

  • (modified) lldb/test/API/lit.cfg.py (+1)
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 7ab9749f6266d..dcff8687fb4ca 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -353,6 +353,7 @@ def delete_module_cache(path):
 # Some steps required to initialize the tests dynamically link with python.dll
 # and need to know the location of the Python libraries. This ensures that we
 # use the same version of Python that was used to build lldb to run our tests.
+config.environment["PYTHONHOME"] = config.python_root_dir
 config.environment["PATH"] = os.path.pathsep.join(
     (config.python_root_dir, config.environment.get("PATH", ""))
 )

@charles-zablit
Copy link
Contributor Author

charles-zablit commented Aug 19, 2025

The lldb-api tests on the Swift Windows CI fail when the Python we use to build is not the same as the one installed on the system, as can be seen on this run, tied to swiftlang/swift#83615.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants