-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly Handle relative paths in JSON Compilation Databases #1790
Comments
tisoft
added a commit
to tisoft/sonar-cxx
that referenced
this issue
Jan 20, 2020
According to the specification, all paths specified in a JSON Compilation database must either be absolute, or relative to the location given in the directory field. Fixes SonarOpenCommunity#1790
tisoft
added a commit
to tisoft/sonar-cxx
that referenced
this issue
Jan 20, 2020
According to the specification, all paths specified in a JSON Compilation database must either be absolute, or relative to the location given in the directory field. Fixes SonarOpenCommunity#1790
Hi @tisoft, thanks for investigation. Had not the time to look deeper into it. Only some general hints:
The important thing I wanna say is that the files of the JSON Compilation Database can't be outside of "root". Your solution should take this into account. Will look more detailed into it latest tomorrow. Regards, |
Think two cases should be handled:
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
According to the specification, all paths specified in a JSON Compilation database must either be absolute, or relative to the location given in
directory
. Currently they are either absolute or relative to the build base dir.Steps to reproduce the problem
Example compile-commands.json:
Expected behavior
The following includes are resolved:
Actual behavior
The following includes are resolved:
Known workarounds
It would probably be possible to preprocess the json, to only include absolte paths, but haven't tried that.
LOG file
Related information
The text was updated successfully, but these errors were encountered: