Skip to content

refactor: Fix new and old codechecker script issues - #322

Merged
nettle merged 1 commit into
Ericsson:mainfrom
nettle:pybinary-fix
Sep 2, 2026
Merged

refactor: Fix new and old codechecker script issues#322
nettle merged 1 commit into
Ericsson:mainfrom
nettle:pybinary-fix

Conversation

@nettle

@nettle nettle commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Why:
Change #199 caused a few bugs in downstream projects.
Migration to py_binary should be fixed and refactored.
Besides codechecker.bzl and codechecker_script.py also
contained old bugs.

What:

  • Execute the script py_binary in the test rule, drop the symlink
  • Declare the script tools in the exec configuration
  • Pass one --env= per entry
  • Build the environment explicitly, pass it to every command
  • Simplify the script, name the arguments after the flags
  • Add tests for the analyzer paths, parse exports and config env

@nettle
nettle marked this pull request as draft August 27, 2026 22:30
@nettle
nettle force-pushed the pybinary-fix branch 2 times, most recently from ac6599e to da767c5 Compare August 28, 2026 22:07
@nettle nettle self-assigned this Aug 31, 2026
@nettle nettle added bug Something isn't working enhancement New feature or request labels Aug 31, 2026

@nettle nettle left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi @furtib, @Szelethus,
I have added a few comments to highlight the most important bugfixes

Comment thread src/codechecker.bzl
Comment thread src/codechecker.bzl
Comment thread src/codechecker_script.py
Comment thread src/codechecker_script.py Outdated
Comment thread src/codechecker.bzl
@nettle
nettle marked this pull request as ready for review September 1, 2026 20:36
@nettle nettle changed the title Fix py_binary issues refactor: Fix new and old codechecker script issues Sep 1, 2026

@furtib furtib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!
I only have this tiny nit regarding target/exec.

Comment thread src/codechecker.bzl
Comment thread src/codechecker.bzl
@furtib
furtib requested review from Szelethus and a lite review from Copilot and removed request for Copilot September 2, 2026 09:32
@nettle
nettle requested a review from furtib September 2, 2026 17:44
@nettle

nettle commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @furtib,
I have tested "exec" in downstream projects, and I confirm that "exec" is not just theoretically correct suggestion but also proven in practice. If we put "target" then it means we request the script to be build for execution on target platform which is wrong - all executions are done on Execution platform (see https://bazel.build/concepts/platforms).
With "target" it also does not fail since it is Python script, but "exec" seems correct. Note that we may also consider "host" (platform on which Bazel itself runs) but I think we are closer to "exec" (platform which runs compile actions).

@furtib furtib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In that case, if we expect the test actions to also be executed on the remote machines, then exec indeed seems to be the correct choice here.

LGTM!

@nettle
nettle merged commit 0aede4a into Ericsson:main Sep 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants