Skip to content

Header Search Paths Broken #2285

Open
Open
@cpsauer

Description

@cpsauer

Summary: Plugin seems to provide no header search paths to the editor, breaking #include and autocomplete for C++.

Symptoms:

  • All headers #included via non-relative paths are underlined in red ("file not found") in the editor. CMD+click, file details on hover, and build all still work; the file is in the right place and included correctly. Relative paths work fine, since they don't depend on header search paths
  • Not being able to find headers breaks autocomplete for types #included through them.

Suspected Causes
The plugin seems to be failing to set any "Header Search paths".

Running "Show Compiler Info" (via Help->Find Action) shows an empty list of "Header Search paths" for all files examined.
"Compiler switches" contains isystem/iquote flags for all the correct directories, but that doesn't seem to be enough.

I think I can see where the switches--but not the search paths--are set in BlazeCWorkspace.java.

Platform details that shouldn't matter, but I'll include for completeness:
Latest released Android Studio, 4.1.1.
Using a working version of the plugin, patched as in #2265
Latest macOS, 11.1.
Latest Bazel, 3.7.2
Build setup is Android Library that depends on cc_libraries.

Related to, but not the same as #330, since the switches are not null.

Thanks!
Chris
(ex-Googler)

P.S. If, in the meantime, anyone knows a workaround for overriding the header search paths and adding them, I'd love to hear it. This is the last major bug we don't have a workaround for.

Metadata

Metadata

Assignees

Labels

P3We're not considering working on this, but happy to review a PR. (No assignee)awaiting-maintainerAwaiting review from Bazel team on issueslang: c++C++ rules integrationos: macosmacOS supportproduct: Android StudioAndroid Studio plugintype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions