Skip to content

Conversation

@furtib
Copy link
Contributor

@furtib furtib commented Jun 24, 2025

Why:
Paths in .plist (and yaml) files have not been correctly updated to point to the original file; they pointed to a /home/.cache/ folder.

What:
I have modified the CodeChecker wrapper Python script so as not to modify the file paths listed in the list files, and resolve the symlinks that way. Also I have removed a line disabling the symlink resolution if the checker is not calng-tidy.

Addresses:
#65

This test only fixes the single codechecker job rule, not the distributed one!

test/BUILD Outdated
Comment on lines 82 to 98
# Test for resolving virtual include prefix
cc_binary(
name = "virtual_include",
srcs = ["src/virtual_include.cc"],
deps = [":virtual_include_lib"],
includes = ["inc"],
)

# Header lib for virtual include
cc_library(
name = "virtual_include_lib",
hdrs = glob(["inc/virtual_include_lib/*.h"]),
strip_include_prefix = "inc",
visibility = ["//visibility:public"],
)


Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the test for virtual include (strip_include_prefix) already exists at line 43

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A library target for a virtual include does exist. However, I needed an error to produce the output I test on, and didn't want to edit a file used by other tests; this is the reason for the new library target, instead of reusing the one on line 43.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the new test is appropriate, we should leave the old one as-is.

@Szelethus Szelethus requested a review from dkrupp July 9, 2025 11:13
@Szelethus Szelethus added the bug Something isn't working label Jul 9, 2025
Szelethus
Szelethus previously approved these changes Jul 21, 2025
Copy link
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

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

LGTM on my end

@furtib furtib changed the title Fix plist (and yaml) paths Resolve symlinks in all plist/yaml files Jul 22, 2025
@furtib
Copy link
Contributor Author

furtib commented Jul 25, 2025

Let's split this into two! I will open a separate PR for the test.

@furtib
Copy link
Contributor Author

furtib commented Aug 13, 2025

This has a unit test in: #25

@furtib furtib requested a review from Szelethus August 13, 2025 11:35
@furtib furtib force-pushed the fix_plist_paths branch 2 times, most recently from 2302891 to c21fbaf Compare August 15, 2025 09:30
Szelethus added a commit that referenced this pull request Aug 21, 2025
Test for #14 

The problem was that paths in plist files didn't get resolved when there
was an error in a header file.

To reproduce the bug, I had to:
- Add a header file that contains an error
- Add a source file that includes said header
- Add a rule for the new source fileí

Depends on: #60

---------

Co-authored-by: Kristóf Umann <[email protected]>
@furtib furtib changed the title Resolve symlinks in all plist/yaml files Resolve symlinks in all plist/yaml files under the classic codechecker rule! Aug 25, 2025
@furtib furtib changed the title Resolve symlinks in all plist/yaml files under the classic codechecker rule! Resolve symlinks in all plist/yaml files under the classic codechecker rule Aug 25, 2025
@furtib furtib force-pushed the fix_plist_paths branch 3 times, most recently from fa97a16 to 681412c Compare August 25, 2025 12:14
@furtib furtib marked this pull request as draft August 26, 2025 11:57
@furtib furtib marked this pull request as ready for review August 26, 2025 12:51
@furtib furtib force-pushed the fix_plist_paths branch 3 times, most recently from 9c35784 to 7eae847 Compare August 27, 2025 07:11
furtib added a commit to furtib/codechecker_bazel that referenced this pull request Aug 27, 2025
Test for Ericsson#14 

The problem was that paths in plist files didn't get resolved when there
was an error in a header file.

To reproduce the bug, I had to:
- Add a header file that contains an error
- Add a source file that includes said header
- Add a rule for the new source fileí

Depends on: Ericsson#60

---------

Co-authored-by: Kristóf Umann <[email protected]>
fix_bazel_paths()
""" Resolve symlinks from local jobs, then try fixing path from remote executors """
resolve_symlinks()
fix_bazel_paths()
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, whats the explanation here? Why the change of order? If possible, resolve, than fall back to replacing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, we should not shoot ourselves in the foot, if we can use the syslinks

Comment on lines -32 to -34
r"\/sandbox\/processwrapper-sandbox\/\S*\/execroot\/": "/execroot/",
START_PATH + r"\/worker\/build\/[0-9a-fA-F]{16}\/root\/": "",
START_PATH + r"\/[0-9a-fA-F]{32}\/execroot\/": "",
Copy link
Contributor

@Szelethus Szelethus Aug 29, 2025

Choose a reason for hiding this comment

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

I love the new explanations, but I think I'm gonna need a bit more info as to whether we've truly reproduced these with the new regexes. In particular, by omitting START_PATH, you seem to produce absolute paths when symlinking fails, whereas the old regexes seem to produce relative paths always. Do we need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have not reproduced what these regex did. Only the middle one is reused, just without the START_PATH; this is most likely a remote executor-specific setting, our testing solution did not produce such a START_PATH. We should inquire more about these regexes. For now, it seems like for local runs, they are unnecessary; for remote jobs, it could be setup-dependent.

Copy link
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

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

So to summarize, we're kind of stuck on this patch because much of the plist preprocessing depends on paths coming from buildbarn remote agents, which we don't have in the Github CI as of now. I suggest that we commit some buildbarn-generated-plists (as seen in #75, we can run it locally but not yet as a github action), and just do a plain python unit test on whether we can appropriately postprocess it.

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.

3 participants