Skip to content

Commit 617aae3

Browse files
committed
[lit] Drop the user-site packages directory from search paths when running tests
Do not add user-site packages directory to the python search path. This avoids test failures if there's an incompatible lit module installed inside the user-site packages directory, as it gets prioritized over the lit from the PYTHONPATH. (cherry picked from commit 32837a6)
1 parent 4d31871 commit 617aae3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/utils/lit/tests/lit.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ else:
3737

3838
# Required because some tests import the lit module
3939
llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
40+
# Do not add user-site packages directory to the python search path. This avoids test failures if there's an
41+
# incompatible lit module installed inside the user-site packages directory, as it gets prioritized over the lit
42+
# from the PYTHONPATH.
43+
config.environment['PYTHONNOUSERSITE'] = '1'
4044

4145
# Add llvm and lit tools directories if this config is being loaded indirectly.
4246
for attribute in ('llvm_tools_dir', 'lit_tools_dir'):

0 commit comments

Comments
 (0)