Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/codechecker_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ def analyze(cfg):
if env_list:
codechecker_env = dict(item.split("=", 1) for item in env_list)
env.update(codechecker_env)
# Note: This is a workaround, CodeChecker requires the PATH to be set
if "PATH" not in env:
env["PATH"] = "/bin" # NOTE: this is workaround for CodeChecker 6.24.4
env["PATH"] = "/bin"
env["CC_ANALYZER_BIN"] = generate_analyzer_executables(cfg)
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 @@ -97,6 +97,7 @@ def _run_code_checker(
# Action to run CodeChecker for a file
# env_vars are unused for now, since
# use_default_shell_env and env are incompatible
# TODO: use env for environment variables, instead of passing it as argument
ctx.actions.run(
inputs = inputs,
outputs = outputs,
Expand All @@ -119,7 +120,6 @@ def _run_code_checker(
analyzer_executables,
],
mnemonic = "CodeChecker",
use_default_shell_env = True,
progress_message = "CodeChecker analyze {}".format(src.short_path),
)
return outputs
Expand Down
3 changes: 3 additions & 0 deletions src/per_file_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def _get_codechecker_env() -> dict[str, str]:
Returns the environment for running CodeChecker
"""
cc_env = os.environ.copy()
# Note: This is a workaround, CodeChecker requires the PATH to be set
if "PATH" not in cc_env:
cc_env["PATH"] = "/bin"
# Overwrite analyzer paths
cc_env["CC_ANALYZER_BIN"] = ANALYZER_EXECUTABLES_ENV_VAR
return cc_env
Expand Down
Loading