Skip to content

Commit d9462c9

Browse files
Stop collecting headers from CcInfo for input files (#3017)
Resolves #3014. We now only collect things via attributes. This aligns with how users expect “input files” to work. --------- Signed-off-by: Brentley Jones <github@brentleyjones.com>
1 parent a1fe653 commit d9462c9

File tree

3 files changed

+1
-67
lines changed

3 files changed

+1
-67
lines changed

xcodeproj/internal/files/incremental_input_files.bzl

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -110,33 +110,16 @@ def _should_ignore_input_attr(attr):
110110
attr in _IGNORE_ATTR
111111
)
112112

113-
def _process_cc_info_headers(headers, *, exclude_headers):
114-
def _process_header(header_file):
115-
exclude_headers[header_file] = None
116-
return header_file
117-
118-
files = []
119-
for header in headers:
120-
if header in exclude_headers:
121-
continue
122-
files.append(_process_header(header))
123-
124-
return files
125-
126113
def _process_files_and_deps(
127114
*,
128115
additional_src_files,
129116
additional_src_file_handler,
130117
attrs,
131-
cc_info,
132118
collect_uncategorized,
133-
extra_files,
134119
file_handlers,
135120
rule_attr,
136121
rule_file,
137-
rule_files,
138-
swift_info):
139-
categorized_files = {}
122+
rule_files):
140123
uncategorized = []
141124
xccurrentversions = []
142125

@@ -148,7 +131,6 @@ def _process_files_and_deps(
148131
if handler:
149132
handler(file)
150133
categorized = True
151-
categorized_files[file] = None
152134
else:
153135
categorized = False
154136

@@ -221,36 +203,6 @@ def _process_files_and_deps(
221203
for list_dep in dep:
222204
_handle_dep(list_dep)
223205

224-
if cc_info:
225-
if swift_info:
226-
for module in swift_info.direct_modules:
227-
clang = module.clang
228-
if not clang:
229-
continue
230-
for header in clang.compilation_context.direct_public_headers:
231-
# Exclude Swift generated headers
232-
categorized_files[header] = None
233-
234-
compilation_context = cc_info.compilation_context
235-
extra_files.extend(
236-
_process_cc_info_headers(
237-
compilation_context.direct_private_headers,
238-
exclude_headers = categorized_files,
239-
),
240-
)
241-
extra_files.extend(
242-
_process_cc_info_headers(
243-
compilation_context.direct_public_headers,
244-
exclude_headers = categorized_files,
245-
),
246-
)
247-
extra_files.extend(
248-
_process_cc_info_headers(
249-
compilation_context.direct_textual_headers,
250-
exclude_headers = categorized_files,
251-
),
252-
)
253-
254206
return (
255207
transitive_extra_files,
256208
uncategorized,
@@ -281,7 +233,6 @@ def _collect_incremental_input_files(
281233
attrs,
282234
automatic_target_info,
283235
avoid_deps = EMPTY_LIST,
284-
cc_info,
285236
framework_files = EMPTY_DEPSET,
286237
focused_labels = EMPTY_DEPSET,
287238
infoplist = None,
@@ -290,7 +241,6 @@ def _collect_incremental_input_files(
290241
platform,
291242
resource_info = None,
292243
rule_attr,
293-
swift_info,
294244
swift_proto_info,
295245
transitive_infos):
296246
"""Collects all of the inputs of a target.
@@ -302,8 +252,6 @@ def _collect_incremental_input_files(
302252
the target.
303253
avoid_deps: A `list` of the targets that already consumed resources, and
304254
their resources shouldn't be bundled with the target.
305-
cc_info: The `CcInfo` provider for the target, or `None` if it doesn't
306-
have one.
307255
framework_files: A `depset` of framework files from
308256
`AppleDynamicFramework.framework_files`, if the target has the
309257
`AppleDynamicFramework` provider.
@@ -319,8 +267,6 @@ def _collect_incremental_input_files(
319267
resource_info: If the target is a bundle and has the `AppleResourceInfo`
320268
provider, this is the provider.
321269
rule_attr: `ctx.rule.attr`.
322-
swift_info: The `SwiftInfo` provider for the target, or `None` if it
323-
doesn't have one.
324270
swift_proto_info: The `SwiftProtoInfo` provider for the target, or
325271
`None` if it doesn't have one.
326272
transitive_infos: A `list` of `XcodeProjInfo`s for the transitive
@@ -447,16 +393,13 @@ def _collect_incremental_input_files(
447393
additional_src_files = additional_src_files,
448394
additional_src_file_handler = _handle_srcs_file,
449395
attrs = attrs,
450-
cc_info = cc_info,
451396
collect_uncategorized = (
452397
automatic_target_info.collect_uncategorized_files
453398
),
454-
extra_files = extra_files,
455399
file_handlers = file_handlers,
456400
rule_attr = rule_attr,
457401
rule_file = ctx.rule.file,
458402
rule_files = ctx.rule.files,
459-
swift_info = swift_info,
460403
)
461404

462405
product_framework_files = memory_efficient_depset(
@@ -689,17 +632,14 @@ def _collect_unsupported_input_files(
689632
additional_src_files = EMPTY_LIST,
690633
additional_src_file_handler = None,
691634
attrs = attrs,
692-
cc_info = None,
693635
collect_uncategorized = (
694636
include_extra_files and
695637
automatic_target_info.collect_uncategorized_files
696638
),
697-
extra_files = extra_files,
698639
file_handlers = file_handlers,
699640
rule_attr = rule_attr,
700641
rule_file = ctx.rule.file,
701642
rule_files = ctx.rule.files,
702-
swift_info = None,
703643
)
704644

705645
if is_resource_bundle:

xcodeproj/internal/processed_targets/incremental_library_targets.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,10 @@ def _process_incremental_library_target(
109109
ctx = ctx,
110110
attrs = attrs,
111111
automatic_target_info = automatic_target_info,
112-
cc_info = cc_info,
113112
label = label,
114113
linker_inputs = linker_inputs,
115114
platform = platform,
116115
rule_attr = rule_attr,
117-
swift_info = swift_info,
118116
swift_proto_info = (
119117
target[SwiftProtoInfo] if SwiftProtoInfo in target else None
120118
),

xcodeproj/internal/processed_targets/incremental_top_level_targets.bzl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ def _process_focused_top_level_target(
462462
avoid_deps,
463463
bin_dir_path,
464464
bundle_info,
465-
cc_info,
466465
configuration,
467466
deps_infos,
468467
direct_dependencies,
@@ -553,7 +552,6 @@ def _process_focused_top_level_target(
553552
attrs = attrs,
554553
automatic_target_info = automatic_target_info,
555554
avoid_deps = avoid_deps,
556-
cc_info = cc_info,
557555
focused_labels = focused_labels,
558556
framework_files = framework_files,
559557
infoplist = infoplist,
@@ -562,7 +560,6 @@ def _process_focused_top_level_target(
562560
platform = platform,
563561
resource_info = resource_info,
564562
rule_attr = rule_attr,
565-
swift_info = swift_info,
566563
swift_proto_info = (
567564
target[SwiftProtoInfo] if SwiftProtoInfo in target else None
568565
),
@@ -1227,7 +1224,6 @@ def _process_incremental_top_level_target(
12271224
avoid_deps = avoid_deps,
12281225
bin_dir_path = bin_dir_path,
12291226
bundle_info = bundle_info,
1230-
cc_info = cc_info,
12311227
configuration = configuration,
12321228
deps_infos = deps_infos,
12331229
direct_dependencies = direct_dependencies,

0 commit comments

Comments
 (0)