Skip to content

Commit 1d5c4ff

Browse files
authored
Merge pull request #4673 from bruntib/ld_logger_not_found
[fix] ld_logger not available in MacOS
2 parents ef53ebd + cefdc8b commit 1d5c4ff

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

analyzer/codechecker_analyzer/analyzer_context.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ def __init__(self):
8787
# Add all children (architecture) paths to be later used in the
8888
# LD_LIBRARY_PATH environment variable during logging of compiler
8989
# invocations.
90-
self.logger_lib_dir_path = ":".join(
91-
[str(arch) for arch in ld_logger_path.iterdir() if arch.is_dir()]
92-
)
90+
if ld_logger_path.is_dir():
91+
self.logger_lib_dir_path = ":".join(
92+
str(arch) for arch in ld_logger_path.iterdir() if arch.is_dir()
93+
)
94+
else:
95+
self.logger_lib_dir_path = ""
9396

9497
self.logger_bin = None
9598
self.logger_file = None

analyzer/codechecker_analyzer/env.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ def get_log_env(logfile, original_env, use_absolute_ldpreload_path=False):
7272
preload_value = context.logger_lib_name
7373

7474
try:
75-
original_ld_library_path = new_env["LD_LIBRARY_PATH"]
76-
new_env["LD_LIBRARY_PATH"] = (
77-
context.path_logger_lib + ":" + original_ld_library_path
78-
)
75+
if context.path_logger_lib:
76+
new_env["LD_LIBRARY_PATH"] = \
77+
f'{context.path_logger_lib}:{new_env["LD_LIBRARY_PATH"]}'
7978
except KeyError:
8079
new_env["LD_LIBRARY_PATH"] = context.path_logger_lib
8180
LOG.debug(

0 commit comments

Comments
 (0)