Skip to content

Commit

Permalink
Merge pull request #3744 from dkrupp/cppcheck_path_quickfix
Browse files Browse the repository at this point in the history
Quick fix for cppcheck environment
  • Loading branch information
vodorok committed Sep 15, 2022
2 parents 7d65d89 + bb896cf commit b7af5a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions analyzer/codechecker_analyzer/analysis_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import glob
import multiprocessing
import os
import pickle
import shlex
import shutil
import signal
Expand Down Expand Up @@ -544,6 +545,17 @@ def __create_timeout(analyzer_process):

result_file_exists = os.path.exists(rh.analyzer_result_file)

# FIXME: cppcheck (and other analyzers)
# need the original env when invoked
# we should handle this in a generic way.
if "cppcheck" in os.path.basename(analyzer_cmd[0]):
original_env_file = os.environ.get(
'CODECHECKER_ORIGINAL_BUILD_ENV')
if original_env_file:
with open(original_env_file, 'rb') as env_file:
analyzer_environment = \
pickle.load(env_file, encoding='utf-8')

# Fills up the result handler with the analyzer information.
source_analyzer.analyze(analyzer_cmd, rh, analyzer_environment,
__create_timeout)
Expand Down

0 comments on commit b7af5a6

Please sign in to comment.