Skip to content

fix: Use env from codechecker_config in per-file - #340

Merged
furtib merged 3 commits into
Ericsson:mainfrom
furtib:per-file-fix-env
Oct 6, 2026
Merged

furtib merged 3 commits into
Ericsson:mainfrom
furtib:per-file-fix-env

Conversation

@furtib

@furtib furtib commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why:
When use_default_shell_env=True was used in the per_file rule, we purposefully didn't use env vars from the codechecker_config target. We have since removed use_default_shell_env=True, so we should use these environment variables.

What:

  • Made per_file rule use env_vars from codechecker_config targets.
  • Made per_file rule log the entire environment (so we can test it).
  • Made a test for it.

Addresses:
Fixes: #341

@furtib
furtib requested a review from Szelethus October 2, 2026 07:33
@furtib furtib self-assigned this Oct 2, 2026
@furtib furtib added the enhancement New feature or request label Oct 2, 2026
@furtib furtib changed the title feat: Use env from codechecker_config in per-file fix: Use env from codechecker_config in per-file Oct 2, 2026
@furtib furtib added bug Something isn't working and removed enhancement New feature or request labels Oct 2, 2026

@Szelethus Szelethus left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Architecturally OK, just a minor nit.

Comment thread src/per_file_script.py Outdated
@furtib
furtib requested a review from Szelethus October 6, 2026 09:40
Comment thread src/per_file_script.py Outdated
@furtib
furtib requested a review from Szelethus October 6, 2026 12:30

@Szelethus Szelethus left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to admit that the new prepended env vars are an ugly beast on top of the CodeChecker call. Then again, everything we do here is in the name of being holistic and all encompassing... In that case, function should prevail over form at any costs.

Besides, these are logs. They are meant to be information-first.

LGTM

@furtib
furtib merged commit 522161f into Ericsson:main Oct 6, 2026
7 of 8 checks passed
@furtib
furtib deleted the per-file-fix-env branch October 6, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Env variables defined in codechecker_config are not used in per_file rule

2 participants