Skip to content

Commit

Permalink
[7.1.0] Point _virtual_includes to stable locations so IDE integratio…
Browse files Browse the repository at this point in the history
…ns survive builds (#20946)

Closes #20540.

Commit
347407a

PiperOrigin-RevId: 599516682
Change-Id: I57ac896c9fe127b428367043015feaaaf7b57339

Co-authored-by: Googler <[email protected]>
  • Loading branch information
bazel-io and justinhorvitz authored Jan 19, 2024
1 parent fe58ee1 commit 48ea3d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

load(":common/cc/cc_common.bzl", "cc_common")
load(":common/cc/cc_helper.bzl", "cc_helper")
load(":common/cc/semantics.bzl", "USE_EXEC_ROOT_FOR_VIRTUAL_INCLUDES_SYMLINKS")
load(":common/paths.bzl", "paths")

cc_internal = _builtins.internal.cc_internal
Expand Down Expand Up @@ -120,7 +121,7 @@ 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,
use_exec_root_for_source = USE_EXEC_ROOT_FOR_VIRTUAL_INCLUDES_SYMLINKS,
)
module_map_headers.append(virtual_header)
if config.coverage_enabled:
Expand Down
5 changes: 5 additions & 0 deletions src/main/starlark/builtins_bzl/common/cc/semantics.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

"""Semantics for Bazel cc rules"""

# Point virtual includes symlinks to the source root for better IDE integration.
# See https://github.com/bazelbuild/bazel/pull/20540.
# TODO: b/320980684 - Add a test that fails if this is flipped to True.
USE_EXEC_ROOT_FOR_VIRTUAL_INCLUDES_SYMLINKS = False

def _get_proto_aspects():
return []

Expand Down

0 comments on commit 48ea3d2

Please sign in to comment.