Skip to content

Commit 578b6ac

Browse files
allevatoswiple-rules-gardener
authored andcommitted
API cleanup: Remove compile_options field from SwiftInfo and remove SwiftBinaryInfo.
RELNOTES: The `compile_actions` field of the `SwiftInfo` provider has been removed. The `SwiftBinaryInfo` provider has been removed. PiperOrigin-RevId: 243628135
1 parent 004597e commit 578b6ac

File tree

4 files changed

+1
-36
lines changed

4 files changed

+1
-36
lines changed

swift/internal/api.bzl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ _SANITIZER_FEATURE_FLAG_MAP = {
8383
}
8484

8585
def _build_swift_info(
86-
compile_options = [],
8786
deps = [],
8887
direct_additional_inputs = [],
8988
direct_defines = [],
@@ -100,8 +99,6 @@ def _build_swift_info(
10099
also automatically collects transitive values from dependencies.
101100
102101
Args:
103-
compile_options: A list of `Args` objects that contain the compilation options passed to
104-
`swiftc` to compile this target.
105102
deps: A list of dependencies of the target being built, which provide `SwiftInfo` providers.
106103
direct_additional_inputs: A list of additional input files passed into a library or binary
107104
target via the `swiftc_inputs` attribute.
@@ -150,7 +147,6 @@ def _build_swift_info(
150147
)
151148

152149
return SwiftInfo(
153-
compile_options = compile_options,
154150
direct_defines = direct_defines,
155151
direct_libraries = direct_libraries,
156152
direct_linkopts = direct_linkopts,
@@ -500,9 +496,6 @@ def _compile_as_objects(
500496
* `compile_inputs`: A `depset` of `File`s representing the full collection
501497
of files that were used as inputs to the compile action. This can be used
502498
if those files need to also be made available to subsequent link actions.
503-
* `compile_options`: A list of `Args` objects containing the complete set
504-
of command line flags that were passed to the compiler. This is mainly
505-
exposed for aspects to inspect so that IDEs can integrate with SourceKit.
506499
* `linker_flags`: A list of strings representing additional flags that
507500
should be passed to the linker when linking these objects into a binary.
508501
* `linker_inputs`: A list of `File`s representing additional input files
@@ -642,7 +635,6 @@ def _compile_as_objects(
642635

643636
return struct(
644637
compile_inputs = all_inputs,
645-
compile_options = ([compile_args] + arguments),
646638
linker_flags = linker_flags,
647639
linker_inputs = linker_inputs,
648640
output_doc = out_doc,
@@ -720,9 +712,6 @@ def _compile_as_library(
720712
* `compile_inputs`: A `depset` of `File`s representing the full collection
721713
of files that were used as inputs to the compile action. This can be used
722714
if those files need to also be made available to subsequent link actions.
723-
* `compile_options`: A list of `Args` objects containing the complete set
724-
of command line flags that were passed to the compiler. This is mainly
725-
exposed for aspects to inspect so that IDEs can integrate with SourceKit.
726715
* `output_archive`: The static archive (`.a`) that was produced by the
727716
archiving step after compilation.
728717
* `output_doc`: The `.swiftdoc` file that was produced by the compiler.
@@ -847,7 +836,6 @@ def _compile_as_library(
847836

848837
providers = [
849838
_build_swift_info(
850-
compile_options = compile_results.compile_options,
851839
deps = all_deps,
852840
direct_additional_inputs = (
853841
additional_inputs + compile_results.linker_inputs
@@ -884,7 +872,6 @@ def _compile_as_library(
884872

885873
return struct(
886874
compile_inputs = compile_results.compile_inputs,
887-
compile_options = compile_results.compile_options,
888875
output_archive = out_archive,
889876
output_doc = compile_results.output_doc,
890877
output_groups = compile_results.output_groups,
@@ -1105,7 +1092,6 @@ def _merge_swift_info_providers(targets):
11051092
transitive_swiftmodules.append(p.transitive_swiftmodules)
11061093

11071094
return SwiftInfo(
1108-
compile_options = [],
11091095
direct_defines = [],
11101096
direct_libraries = [],
11111097
direct_linkopts = [],

swift/internal/providers.bzl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616

1717
load(":utils.bzl", "collect_transitive")
1818

19-
SwiftBinaryInfo = provider(
20-
doc = "Contains information about the compilation of a Swift binary target.",
21-
fields = {
22-
"compile_options": """
23-
`List` of `Args` objects. The command-line options that were passed to the compiler to compile this
24-
target. This is intended to be flattened into a params file by aspects to allow IDE integration with
25-
Bazel.
26-
""",
27-
},
28-
)
29-
3019
SwiftCcLibsInfo = provider(
3120
doc = """
3221
Contains information about C libraries that are dependencies of Swift libraries.
@@ -77,11 +66,6 @@ them. Instead of constructing a `SwiftInfo` provider directly, consider using th
7766
also automatically collects transitive values from a list of dependencies.
7867
""",
7968
fields = {
80-
"compile_options": """
81-
`List` of `Args` objects. The command-line options that were passed to the compiler to compile this
82-
target. This is intended to be flattened into a params file by aspects to allow IDE integration with
83-
Bazel.
84-
""",
8569
"direct_defines": """
8670
`List` of `string`s. The values specified by the `defines` attribute of the library that directly
8771
propagated this provider.

swift/internal/swift_binary_test.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ load(":api.bzl", "swift_common")
2121
load(":derived_files.bzl", "derived_files")
2222
load(":features.bzl", "SWIFT_FEATURE_BUNDLED_XCTESTS")
2323
load(":linking.bzl", "register_link_action")
24-
load(":providers.bzl", "SwiftBinaryInfo", "SwiftToolchainInfo")
24+
load(":providers.bzl", "SwiftToolchainInfo")
2525
load(":swift_c_module_aspect.bzl", "swift_c_module_aspect")
2626
load(":utils.bzl", "expand_locations")
2727

@@ -125,9 +125,6 @@ def _swift_linking_rule_impl(
125125
additional_output_groups,
126126
compile_results.output_groups,
127127
)
128-
compilation_providers.append(
129-
SwiftBinaryInfo(compile_options = compile_results.compile_options),
130-
)
131128

132129
# TODO(b/70228246): Also support mostly-static and fully-dynamic modes, here and for the C++
133130
# toolchain args below.

swift/swift.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ load(
2424
)
2525
load(
2626
"@build_bazel_rules_swift//swift/internal:providers.bzl",
27-
_SwiftBinaryInfo = "SwiftBinaryInfo",
2827
_SwiftClangModuleInfo = "SwiftClangModuleInfo",
2928
_SwiftInfo = "SwiftInfo",
3029
_SwiftProtoInfo = "SwiftProtoInfo",
@@ -66,7 +65,6 @@ load(
6665
)
6766

6867
# Re-export providers.
69-
SwiftBinaryInfo = _SwiftBinaryInfo
7068
SwiftClangModuleInfo = _SwiftClangModuleInfo
7169
SwiftInfo = _SwiftInfo
7270
SwiftProtoInfo = _SwiftProtoInfo

0 commit comments

Comments
 (0)