Skip to content

Commit

Permalink
Point virtual includes symlinks to the source root instead of the exe…
Browse files Browse the repository at this point in the history
…c root for bazel. See bazelbuild#20540.

Closes bazelbuild#20540.

PiperOrigin-RevId: 599516682
Change-Id: I57ac896c9fe127b428367043015feaaaf7b57339
  • Loading branch information
justinhorvitz authored and bazel-io committed Jan 19, 2024
1 parent fe58ee1 commit 0b3038f
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 0b3038f

Please sign in to comment.