Skip to content

Add sub-signature to enable matching of gcc vs clang#22

Merged
padovan merged 3 commits into
kernelci:mainfrom
padovan:signature-loc
Jun 5, 2025
Merged

Add sub-signature to enable matching of gcc vs clang#22
padovan merged 3 commits into
kernelci:mainfrom
padovan:signature-loc

Conversation

@padovan

@padovan padovan commented May 23, 2025

Copy link
Copy Markdown
Collaborator

This PR adds signature_loc with a signature that exclude the error summary message and the line position of the error, so we could generate the same hash for errors both from gcc and clang.

(.venv) poutine logspec > ./logspec.py ../tmp-logs/clang.log kbuild --json-full | grep signature_loc
            "_add_signature_loc": true,
            "_signature_loc": "90bb5a8b390fa147b4ddb0cab769c38e39b30e61",
(.venv) poutine logspec > ./logspec.py ../tmp-logs/gcc.log kbuild --json-full | grep signature_loc
            "_add_signature_loc": true,
            "_signature_loc": "90bb5a8b390fa147b4ddb0cab769c38e39b30e61",

Related to #11

@padovan padovan requested a review from nuclearcat May 23, 2025 19:55
Comment thread logspec/main.py Outdated
Comment thread logspec/main.py Outdated
Comment thread logspec/errors/kbuild.py
self.target = target
self.src_file = ""
self.location = ""
self.position = ""

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.

location and position is very confusing imho, if we could modify them to something like line_no and column_no I think it would be better

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.

I thought about it too, but left location like that, because for some cases location is an address. What we could do is to maintain locationfor those cases and then have line_no and pos for the ones we are dealing with here.

Comment thread tests/test_kbuild.py
Comment thread logspec/errors/error.py Outdated
@padovan

padovan commented May 27, 2025

Copy link
Copy Markdown
Collaborator Author

@helen-fornazier @tales-aparecida thanks for the python tips :)

Gustavo Padovan added 3 commits May 27, 2025 15:41
Leave them to be printed only by full json option.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
gcc and clang are reporting different line position for the
same code error. If we want to compare logs from both compilers
we have to make the split, so we can compare the line of the
error as well.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
We need a way to match issues reported both by gcc and clang,
so creating a subsignature that exclude line position and error
summary allow us to have the same `signature_loc` for both.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
@padovan padovan merged commit dfb0491 into kernelci:main Jun 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants