Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

CompilerManager: Cannot extract standard include paths. #1438

Open thwilloch-stryde opened 10 months ago

thwilloch-stryde commented 10 months ago

Describe the bug~ Lot of spurious errors consistent with not finding standard include files.

A clear and concise description of what the bug is.

To Reproduce Start rdm In emacs make a change to a source file and save. See in the rdm output the message CompilerManager: Cannot extract standard include paths.

See lots of errors consistent with not finding include files. Like: Semantic Issue: member reference base type 'istream' (aka 'int') is not a structure or union Semantic Issue: type 'string' (aka 'basic_string') does not provide a subscript operator

Expected behavior A clear and concise description of what you expected to happen. Not to see CompilerManager: Cannot extract standard include paths. Not to get all refereces to stream and string reslult in error messages.

Screenshots/Backtrace If applicable, add screenshots or/and a backtrace.

Environment (please complete the following information):

Additional context rtags has worked for me for the last two years. What caused the change I do not know. I have updateted clang and rtags often.

Seems that adding all the include files explicitly fixes the problem:

Starting rdm as

-I /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8 -I /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux -I /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward -I /usr/lib/gcc/x86_64-redhat-linux/8/include -I /usr/local/include -I /usr/include

works.

And adding the same to emacs variable rtags-rdm-includes also works.

I am using ccache, do not know if that can mess things up. But it has worked for me the last two years.

thwilloch-stryde commented 10 months ago

It is indeed the ccache that is the issue. Stepping through rdm with debugger I found that ccache returned the error: mString = "ccache: error: Could not find compiler \"c++\" in PATH\n"}

So I assume rdm messes with the PATH before it calls the compiler

PATH= /usr/lib64/ccache/c++ -x c++ -v -E -dM - </dev/null ccache: error: Could not find compiler "c++" in PATH

This has worked for me for years , so this must be some recent change