Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/unittests/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

if platform.system() == "Darwin":
shlibpath_var = "DYLD_LIBRARY_PATH"
elif platform.system() == "Windows":
elif platform.system() == "Windows" or sys.platform == "cygwin":
shlibpath_var = "PATH"
else:
shlibpath_var = "LD_LIBRARY_PATH"
config.environment[shlibpath_var] = os.path.pathsep.join(
("@SHLIBDIR@", "@LLVM_LIBS_DIR@", config.environment.get(shlibpath_var, ""))
(config.shlibdir, config.llvm_libs_dir, config.environment.get(shlibpath_var, ""))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this change does here and how it relates to the rest of this change, same for the file below.

Copy link
Contributor Author

@kikairoya kikairoya Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SHLIBDIR@ is replaced by CMake's configuration function, so it must be in lit.site.cfg.py.in but not lit.cfg.py.
lit.cfg.py must reference variables in generated lit.site.cfg.py.

config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.shlibdir = "@SHLIBDIR@"

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd, how did this code work before? Was it moved here and no one noticed that the values are no longer expanded?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable - but it sounds like a slightly different change from the rest of the theme of the patch. Or at the very least, it would need a mention in the commit message (PR description).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll split out to another PR and look into how it worked before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd, how did this code work before? Was it moved here and no one noticed that the values are no longer expanded?

For Windows, since the pre-merge CI runs checks without -DLLVM_LINK_LLVM_DYLIB=ON, an additional $PATH isn't needed. llvm-mingw appears to do the same, although its releases are configured with dylib.

For Linux, DSOs are found via RUNPATH so $LD_LIBRARY_PATH isn't needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll split out to another PR

done. #164147

)

# It is not realistically possible to account for all options that could
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/include-cleaner/test/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

if platform.system() == "Darwin":
shlibpath_var = "DYLD_LIBRARY_PATH"
elif platform.system() == "Windows":
elif platform.system() == "Windows" or sys.platform == "cygwin":
shlibpath_var = "PATH"
else:
shlibpath_var = "LD_LIBRARY_PATH"
config.environment[shlibpath_var] = os.path.pathsep.join(
("@SHLIBDIR@", "@LLVM_LIBS_DIR@", config.environment.get(shlibpath_var, ""))
(config.shlibdir, config.llvm_libs_dir, config.environment.get(shlibpath_var, ""))
)

# It is not realistically possible to account for all options that could
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/test/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if platform.system() == "Darwin":
shlibpath_var = "DYLD_LIBRARY_PATH"
elif platform.system() == "Windows":
elif platform.system() == "Windows" or sys.platform == "cygwin":
shlibpath_var = "PATH"
else:
shlibpath_var = "LD_LIBRARY_PATH"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def find_shlibpath_var():
yield "LD_LIBRARY_PATH"
elif platform.system() == "Darwin":
yield "DYLD_LIBRARY_PATH"
elif platform.system() == "Windows":
elif platform.system() == "Windows" or sys.platform == "cygwin":
yield "PATH"
elif platform.system() == "AIX":
yield "LIBPATH"
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/lit/tests/Inputs/googletest-cmd-wrapper/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import lit.formats

config.name = "googletest-cmd-wrapper"
config.test_format = lit.formats.GoogleTest(
"DummySubDir", "Test" if "win32" in sys.platform else ".exe", [sys.executable]
"DummySubDir", "Test" if sys.platform in ["win32", "cygwin"] else ".exe", [sys.executable]
)
2 changes: 1 addition & 1 deletion polly/test/Unit/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for var in [

if platform.system() == 'Darwin':
shlibpath_var = 'DYLD_LIBRARY_PATH'
elif platform.system() == 'Windows':
elif platform.system() == 'Windows' or sys.platform == "cygwin":
shlibpath_var = 'PATH'
else:
shlibpath_var = 'LD_LIBRARY_PATH'
Expand Down