Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Headers only seen via Bazel virtual includes are unindexable #29

Open
shrouxm opened this issue Nov 16, 2020 · 2 comments
Open

Headers only seen via Bazel virtual includes are unindexable #29

shrouxm opened this issue Nov 16, 2020 · 2 comments

Comments

@shrouxm
Copy link
Contributor

shrouxm commented Nov 16, 2020

Bazel does this thing where headers can be placed in a "virtual includes" folder in the exec root, and then the include dirs passed to the compilation command refer to this virtual includes folder, so that lsif-clang cannot know where the actual source for the header is.

In the case that some entry in the compilation database includes the header via its actual pass in the source tree, this works out fine because we've updated the symbol merging to prefer paths contained by the source tree. But if every entry in the compilation database includes a header via a virtual include, that header will have no LSIF data.

It is also unclear whether this is a bazel specific quirk or if other build systems will also present this problem.

Resolution A: In the project which originally surfaced this issue, the generated compilation database contained entries for individual headers, so all headers got LSIF data. If this behaviour is true of all bazel projects (or we make it true via our bazel tooling) then we're good.

Resolution B: Find a way to map the virtual includes back to their source. There may already be a way to do this with bazel, otherwise we're in very ???? territory. Step 1 seems much more promising and should be attempted first.

Here's some related reading for more context:

bazelbuild/bazel#3828
bazelbuild/bazel#6254

See #28 for more context.

@shrouxm shrouxm added this to the Backlog milestone Nov 16, 2020
@macraig macraig removed this from the Backlog milestone Nov 20, 2020
@Strum355
Copy link
Member

Also related bazelbuild/bazel#11874

@Strum355
Copy link
Member

Interesting commit here, going to see how we could expose this for grail bazel thing to consume

@Strum355 Strum355 removed their assignment Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants