Skip to content

Commit

Permalink
[analyzer] Include arch subdirectories in LD_LIBRARY_PATH for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gamesh411 committed Dec 2, 2024

Verified

This commit was signed with the committer’s verified signature.
tomlokhorst Tom Lokhorst
1 parent d084d79 commit 173a087
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions analyzer/codechecker_analyzer/analyzer_context.py
Original file line number Diff line number Diff line change
@@ -71,13 +71,20 @@ def __init__(self):
# Original caller environment of CodeChecker for external binaries
self.__original_env = None

self.logger_lib_dir_path = os.path.join(
self._data_files_dir_path, 'ld_logger', 'lib')

if not os.path.exists(self.logger_lib_dir_path):
self.logger_lib_dir_path = os.path.join(
# Find the path which has the architectures for the built ld_logger
# shared objects.
ld_logger_path = Path(self._data_files_dir_path, 'ld_logger', 'lib')
if not ld_logger_path.is_dir():
ld_logger_path = Path(
self._lib_dir_path, 'codechecker_analyzer', 'ld_logger', 'lib')

# Add the ld_logger_path and all children (architecture) paths to be
# later used in the LD_LIBRARY_PATH environment variable during
# logging of compiler invocations.
self.logger_lib_dir_path = ':'.join(
[str(ld_logger_path)] +
[str(arch) for arch in ld_logger_path.iterdir() if arch.is_dir()])

self.logger_bin = None
self.logger_file = None
self.logger_compilers = None

0 comments on commit 173a087

Please sign in to comment.