Skip to content

Use bazel's built in symlink instead of cp for config files - #273

Merged
furtib merged 1 commit into
Ericsson:mainfrom
furtib:use-symlink-instead-of-cp
Aug 12, 2026
Merged

Use bazel's built in symlink instead of cp for config files#273
furtib merged 1 commit into
Ericsson:mainfrom
furtib:use-symlink-instead-of-cp

Conversation

@furtib

@furtib furtib commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Why:
The codechecker_config rule uses cp to duplicate the user-provided config file. This is an unnecessary dependency on cp, and may not work correctly with remote executors.
Using ctx.actions.symlink is the idiomatic Bazel approach, so it should work with remote execution and remote caching.

What:

  • Replace the ctx.actions.run(executable = "cp", ...) call in src/codechecker_config.bzl with ctx.actions.symlink(output, target_file).

Addresses:
none

@furtib
furtib requested a review from Szelethus August 10, 2026 13:06
@furtib furtib self-assigned this Aug 10, 2026
@furtib furtib added the enhancement New feature or request label Aug 10, 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 guess this might be the best alternatives (among /usr/sbin/cp, no-remote, create file etc)!
The toughest question is the test...

Comment thread src/codechecker_config.bzl
@furtib
furtib force-pushed the use-symlink-instead-of-cp branch from 8a55d42 to 403b58b Compare August 12, 2026 10:00
@furtib

furtib commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Regarding tests, the existence of these config files is already covered by our test suite. bazel test //test/unit/cofing:*
We have no access to remote executors; please test.

@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.

We already recieved word from a user who has a working BuildBarn instance, and this PR seems to fix the missing cp binary issue.

@furtib
furtib merged commit 79db202 into Ericsson:main Aug 12, 2026
4 checks passed
@furtib
furtib deleted the use-symlink-instead-of-cp branch August 12, 2026 12:24
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.

3 participants