Skip to content

Commit 97e5f5a

Browse files
dwsbazel-io
authored andcommitted
use DefaultInfo in Bazel's embedded Starlark
The Starlark embedded in Bazel, that can get used when building other repos, has problems exposed by enabling --incompatible_disable_target_default_provider_fields Since this code is embedded in Bazel, there is no way for users to patch it in the course of trying to disable target default provider fields in their own repos. We here address these issues. Closes bazelbuild#26276. PiperOrigin-RevId: 770991995 Change-Id: I4b29e9d52dd1789afe7de990ca9500812a8ec211
1 parent 0784a23 commit 97e5f5a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/starlark/builtins_bzl/common/cc/cc_helper.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ def _local_defines(ctx, additional_make_variable_substitutions):
11731173
def _linker_scripts(ctx):
11741174
result = []
11751175
for dep in ctx.attr.deps:
1176-
for f in dep.files.to_list():
1176+
for f in dep[DefaultInfo].files.to_list():
11771177
if f.extension in cpp_file_types.LINKER_SCRIPT:
11781178
result.append(f)
11791179
return result

src/main/starlark/builtins_bzl/common/cc/cc_library.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def _check_no_repeated_srcs(ctx):
512512
seen = {}
513513
for target in ctx.attr.srcs:
514514
if DefaultInfo in target:
515-
for file in target.files.to_list():
515+
for file in target[DefaultInfo].files.to_list():
516516
extension = "." + file.extension
517517
if extension not in cc_helper.extensions.CC_HEADER:
518518
if extension in cc_helper.extensions.CC_AND_OBJC:

0 commit comments

Comments
 (0)