Skip to content

feat: Create fake path for codechecker - #308

Open
furtib wants to merge 3 commits into
Ericsson:mainfrom
furtib:hermetic-bin
Open

feat: Create fake path for codechecker#308
furtib wants to merge 3 commits into
Ericsson:mainfrom
furtib:hermetic-bin

Conversation

@furtib

@furtib furtib commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Why:
We want the Bazel rule to be as hermetic as possible.

What:

  • Added dirname to the toolchain. (This is the only tool we use from PATH. Running codechecker with strace reveals that it accesses openssl and uname too, but they seem to be optional)
  • Added a custom PATH containing both the hermetic Python interpreter (even though the script running CodeChecker is a py_binary target, CodeChecker still wants to find Python in PATH) and dirname.

Addresses:
none

Notes:

  • We might be able to remove Python from the fake PATH when switching to pip-installed CodeChecker.
    Supporting standalone builds of CodeChecker, however, will still require Python in PATH.

@furtib
furtib requested a review from Szelethus August 25, 2026 07:53
@furtib furtib self-assigned this Aug 25, 2026
@furtib furtib added the enhancement New feature or request label Aug 25, 2026
@furtib furtib changed the title Create fake path for codechecker feat: Create fake path for codechecker Aug 25, 2026

@nettle nettle 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 think we are just missing evidences here (use-case? tests?).
That's why this change does not look convincing to me so far.
Is it a part bigger change?

@furtib

furtib commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure I understand your concerns.
This is not part of a bigger change.

The main goal of this patch is to move away from using use_default_shell_env = True and get rid of the workaround of setting the PATH to /bin to use system tools.
The use case is to have everything available for codechecker inside the sandbox (just like with clang, and clang-tidy). (In this case, that would be dirname and python)

On the note of tests, since I'm only changing the environment codechecker runs in, any test running a codechecker analysis (e.g.: //test/unit/basic:basic_codechecker_test or //test/unit/basic:basic_per_file_test) should suffice, since codechecker either works or not.

@nettle

nettle commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

The main goal of this patch is to move away from using use_default_shell_env = True and get rid of the workaround of setting the PATH to /bin to use system tools. The use case is to have everything available for codechecker inside the sandbox (just like with clang, and clang-tidy). (In this case, that would be dirname and python)

OK, it's getting clearer... Thanks for explanation!
So, we get back python toolchain for that :)
But I still dont understand that idea with fake_path... looks kinda clumsy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants