bazel-contrib / bazel-contrib/toolchains_llvm

cc_wrapper.sh breaks default assumptions of clangd

Open
#508 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Starlark
Stars
371
Forks
283
Avg merge
1d 55m
Merged PRs (30d)
25

Description

clangd will not try to figure out where your system includes live unless it thinks your compiler is gcc or can be driven as-if it were gcc, such as clang. If your compiler happens to be `cc_wrapper.sh` clangd won't touch it until you add it to the allowed list of query drivers e.g. `--query-driver=/**/cc_wrapper.sh` This seems to be very obscure, as I can find only [one single line on Github](https://github.com/search?q=%2Fquery-driver.*cc_wrapper%2F&type=code) where someone has directed clangd to treat the wrapper script as the compiler.

The symptom of this problem is that in your IDE while editing your project that uses this toolchain, your editor thinks that none of the STL headers like `` exist, and every mention of namespace `std` is in error.

I don't know what approach to take to resolve this issue, but this is to get the conversation going and possibly to make the issue visible to search engine users who might be stumped, as I was.

Contributor guide

Open the contributing guide

Research direction

Start by examining how cc_wrapper.sh is exposed to clangd and reproduce the missing STL headers and std namespace diagnostics in an IDE. Determine a supported way for clangd to recognize the wrapper as a compiler, then verify that the query-driver behavior makes those headers resolve correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.