-
Notifications
You must be signed in to change notification settings - Fork 384
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
do not convert to absolute path the files after -include #2449
Conversation
@@ -671,7 +671,7 @@ def __collect_compile_opts(flag_iterator, details): | |||
# order to print these absolute paths natively, this conversion will | |||
# not be necessary. | |||
flags_with_path = ['-I', '-idirafter', '-imacros', '-imultilib', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-imacros
should be removed too.
Why do we ever convert something to absolute path in the first place? If we always set the working directory properly, relative paths should never be the problem. |
Oh, so the plist files section might contain duplicated if the same file is passed both as absolute and as relative path to the compiler invocation. So we are working around a bug in plists. I think we should fix plists at some point rather than trying to work this around. |
Yes, we do it because of the plists, but just converting every path in the plist to absolute is not always the best solution, sometimes you need the relative paths. One option would be to introduce a flag in each analyzer to generate the reports with absolute paths even if the compilation command contained relative, but for this we would have to modify all the supported and planned analyzers. For now it is easier to do the conversion in CodeChecker. |
File path after the -include and -imacros flags should not be converted to absolute path. Only the flags with include path directories should be converted. If every other include directory flag is set properly the file set by -include or -imacros should be found too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This was seemingly last touched in Ericsson#2449 (Ericsson/codechecker@7d93b32) but it seems like a typo. There's no such flag as `-macros` in neither Clang nor GCC.
File path after the -include flag should not be converted to absolute path.
Only the flags with include path directories should be converted.
If every other include directory flag is set properly the
file set by -include should be found too.
Resolves #2440