Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/codechecker_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def analyze():
codechecker_env = dict(item.split("=", 1) for item in env_list)
env.update(codechecker_env)
if "PATH" not in env:
env["PATH"] = "/bin" # NOTE: this is workaround for CodeChecker 6.24.4
# NOTE: this is workaround for CodeChecker
# CodeChecker never actually uses the PATH, it just
# have to be set to something.
env["PATH"] = "/"
env["CC_ANALYZER_BIN"] = generate_analyzer_executables()
logging.debug("env: %s", str(env))

Expand Down
2 changes: 1 addition & 1 deletion src/per_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _run_code_checker(
analyzer_executables,
],
mnemonic = "CodeChecker",
use_default_shell_env = True,
use_default_shell_env = False,
progress_message = "CodeChecker analyze {}".format(src.short_path),
)
return outputs
Expand Down
5 changes: 5 additions & 0 deletions src/per_file_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def _get_codechecker_env() -> dict[str, str]:
Returns the environment for running CodeChecker
"""
cc_env = os.environ.copy()
if "PATH" not in cc_env:
# NOTE: this is workaround for CodeChecker
# CodeChecker never actually uses the PATH, it just
# have to be set to something.
cc_env["PATH"] = "/"
# Overwrite analyzer paths
cc_env["CC_ANALYZER_BIN"] = ANALYZER_EXECUTABLES_ENV_VAR
return cc_env
Expand Down
Loading