This is an archive of the discontinued LLVM Phabricator instance.

scan-build supprot relative 'file' in cdb.
ClosedPublic

Authored by aabbaabb on Oct 28 2020, 6:56 PM.

Details

Summary

Excluded folders in scan build is turned to absolute path before
comapre to 'file' in cdb. 'file' in cdb might be a path relative
to 'directory', so we need to turn it to absolute path before
comparison.

Diff Detail

Event Timeline

aabbaabb created this revision.Oct 28 2020, 6:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2020, 6:56 PM
aabbaabb requested review of this revision.Oct 28 2020, 6:56 PM
phosek accepted this revision.Oct 29 2020, 1:19 AM

LGTM

This revision is now accepted and ready to land.Oct 29 2020, 1:19 AM

I know that the current situation is a mess, but there is an alternative version of scan-build-py on Github, which is also distributed on pypi. Could you check if that version is also susceptible to this problem and open a pull request for the author in case it is?

The repository is here: https://github.com/rizsotto/scan-build

This would be the best way to ensure the bug is fixed for all the users.

This comment was removed by aabbaabb.

Gabor or Petr,
Can any one of you help me commit this change? Not sure if I could commit myself.

I know that the current situation is a mess, but there is an alternative version of scan-build-py on Github, which is also distributed on pypi. Could you check if that version is also susceptible to this problem and open a pull request for the author in case it is?

The repository is here: https://github.com/rizsotto/scan-build

This would be the best way to ensure the bug is fixed for all the users.

Do you mean pull this change into that repo after this got submitted in trunk? Will do!

kindly ping for help to submit this.

phosek added a comment.Nov 2 2020, 1:10 PM

What's the plan regarding updating scan-build-py to match the upstream? It seems like this issue has already been address in the upstream version.

What's the plan regarding updating scan-build-py to match the upstream? It seems like this issue has already been address in the upstream version.

As far as I understand, the author is no longer motivated to contribute to LLVM, so I think there are two ways forward:

  • Just remove this from the LLVM repo and redirect users to use the GitHub/Pypi version, or
  • Import the upstream fixes we need ourselves.

I think there are also some patches that only exist here not on that repo so there is no strict upstream/downstream, just two forked versions.
Since in our use case, we would likely use this version instead of the python version (easier to update/maintain), I suggest just adding the fix we need here.
For this specific bug, the python version is already fixed in a different way by reading the code.

haowei accepted this revision.Nov 9 2020, 8:01 PM