Skip to content

Commit

Permalink
Point _virtual_includes to stable locations so IDE integrations survi…
Browse files Browse the repository at this point in the history
…ve builds

Hi wonderful Bazelers,

This minor change makes it possible for IDE integrations to play nicely with _virtual_includes. 

Prior to this change, _virtual_include symlinks, themselves in stable, accumulating locations in bazel-out, were pointing into unstable locations in execroot and execroot/external, often invalidated by the next build. This leads to spurious, confusing error messages for the user when subsequent builds made headers no longer findable. Sad times. But with this change, the symlinks stay valid, since they point into the workspace and the accumulating caches in <output_base>/external.

Before we tracked  it down, we received large numbers of issue reports about this over at https:/hedronvision/bazel-compile-commands-extractor, a rather popular tool that enables autocomplete for the C language family across editors and platforms. I strongly suspect it solves similar issues in other IDE adapters, whether they've been traced back to this yet or not. FWIW, I'd previously fixed similar issues in the internal symlinks and include paths of the bazelbuild IntelliJ plugin and Tulsi, back in the day. 

Thanks so much,
Chris
(ex-Googler)
  • Loading branch information
cpsauer authored Dec 14, 2023
1 parent 3c298fd commit db6f306
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def _compute_public_headers(
output = virtual_header,
target_file = original_header,
progress_message = "Symlinking virtual headers for " + label.name,
use_exec_root_for_source = True,
)
module_map_headers.append(virtual_header)
if config.coverage_enabled:
Expand Down

0 comments on commit db6f306

Please sign in to comment.