Skip to content

Commit 54c6297

Browse files
committed
Remove some deprecated arguments from swift_common APIs.
RELNOTES: The `allow_testing`, `compilation_mode`, `configuration`, `objc_fragment`, and `swift_fragment` arguments have been removed from the `swift_common.{compile_as_objects,compile_as_library,swiftc_command_line_and_inputs}` functions. PiperOrigin-RevId: 241522035
1 parent e9130ae commit 54c6297

File tree

1 file changed

+3
-53
lines changed

1 file changed

+3
-53
lines changed

swift/internal/api.bzl

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -456,15 +456,10 @@ def _compile_as_objects(
456456
toolchain,
457457
additional_input_depsets = [],
458458
additional_outputs = [],
459-
allow_testing = True,
460-
compilation_mode = None,
461-
configuration = None,
462459
copts = [],
463460
defines = [],
464461
deps = [],
465-
genfiles_dir = None,
466-
objc_fragment = None,
467-
swift_fragment = None):
462+
genfiles_dir = None):
468463
"""Compiles Swift source files into object files (and optionally a module).
469464
470465
Args:
@@ -485,12 +480,6 @@ def _compile_as_objects(
485480
action because they are referenced by compiler flags.
486481
additional_outputs: A list of `File`s representing files that should be
487482
treated as additional outputs of the compilation action.
488-
allow_testing: This argument is no longer used and will be removed in a
489-
future version.
490-
compilation_mode: This argument is no longer used and will be removed in a
491-
future version.
492-
configuration: This argument is no longer used and will be removed in a
493-
future version.
494483
copts: A list (**not** an `Args` object) of compiler flags that apply to the
495484
target being built. These flags, along with those from Bazel's Swift
496485
configuration fragment (i.e., `--swiftcopt` command line flags) are
@@ -504,10 +493,6 @@ def _compile_as_objects(
504493
is added to ClangImporter's header search paths for compatibility with
505494
Bazel's C++ and Objective-C rules which support inclusions of generated
506495
headers from that location.
507-
objc_fragment: This argument is no longer used and will be removed in a
508-
future version.
509-
swift_fragment: This argument is no longer used and will be removed in a
510-
future version.
511496
512497
Returns:
513498
A `struct` containing the following fields:
@@ -531,7 +516,6 @@ def _compile_as_objects(
531516
* `output_objects`: The object (`.o`) files that were produced by the
532517
compiler.
533518
"""
534-
_ignore = [allow_testing, compilation_mode, configuration, objc_fragment, swift_fragment]
535519

536520
# Force threaded mode for WMO builds, using the same number of cores that is
537521
# on a Mac Pro for historical reasons.
@@ -667,18 +651,13 @@ def _compile_as_library(
667651
srcs,
668652
toolchain,
669653
additional_inputs = [],
670-
allow_testing = True,
671654
alwayslink = False,
672-
compilation_mode = None,
673-
configuration = None,
674655
copts = [],
675656
defines = [],
676657
deps = [],
677658
genfiles_dir = None,
678659
library_name = None,
679-
linkopts = [],
680-
objc_fragment = None,
681-
swift_fragment = None):
660+
linkopts = []):
682661
"""Compiles Swift source files into static and/or shared libraries.
683662
684663
This is a high-level API that wraps the compilation and library creation steps
@@ -704,15 +683,9 @@ def _compile_as_library(
704683
additional_inputs: A list of `File`s representing additional inputs that
705684
need to be passed to the Swift compile action because they are
706685
referenced in compiler flags.
707-
allow_testing: This argument is no longer used and will be removed in a
708-
future version.
709686
alwayslink: Indicates whether the object files in the library should always
710687
be always be linked into any binaries that depend on it, even if some
711688
contain no symbols referenced by the binary.
712-
compilation_mode: This argument is no longer used and will be removed in a
713-
future version.
714-
configuration: This argument is no longer used and will be removed in a
715-
future version.
716689
copts: Additional flags that should be passed to `swiftc`.
717690
defines: Symbols that should be defined by passing `-D` to the compiler.
718691
deps: Dependencies of the target being compiled. These targets must
@@ -731,10 +704,6 @@ def _compile_as_library(
731704
used directly by any action registered by this function, but they are
732705
added to the `SwiftInfo` provider that it returns so that the linker
733706
flags can be propagated to dependent targets.
734-
objc_fragment: This argument is no longer used and will be removed in a
735-
future version.
736-
swift_fragment: This argument is no longer used and will be removed in a
737-
future version.
738707
739708
Returns:
740709
A `struct` containing the following fields:
@@ -757,8 +726,6 @@ def _compile_as_library(
757726
rule. This includes the `SwiftInfo` provider, and if Objective-C interop
758727
is enabled on the toolchain, an `apple_common.Objc` provider as well.
759728
"""
760-
_ignore = [allow_testing, compilation_mode, configuration, objc_fragment, swift_fragment]
761-
762729
if not module_name:
763730
fail("'module_name' must be provided. Use " +
764731
"'swift_common.derive_module_name' if necessary to derive one from " +
@@ -1177,15 +1144,10 @@ def _swiftc_command_line_and_inputs(
11771144
srcs,
11781145
toolchain,
11791146
additional_input_depsets = [],
1180-
allow_testing = True,
1181-
compilation_mode = None,
1182-
configuration = None,
11831147
copts = [],
11841148
defines = [],
11851149
deps = [],
1186-
genfiles_dir = None,
1187-
objc_fragment = None,
1188-
swift_fragment = None):
1150+
genfiles_dir = None):
11891151
"""Computes command line arguments and inputs needed to invoke `swiftc`.
11901152
11911153
The command line arguments computed by this function are any that do *not*
@@ -1209,12 +1171,6 @@ def _swiftc_command_line_and_inputs(
12091171
additional_input_depsets: A list of `depset`s of `File`s representing
12101172
additional input files that need to be passed to the Swift compile
12111173
action because they are referenced by compiler flags.
1212-
allow_testing: This argument is no longer used and will be removed in a
1213-
future version.
1214-
compilation_mode: This argument is no longer used and will be removed in a
1215-
future version.
1216-
configuration: This argument is no longer used and will be removed in a
1217-
future version.
12181174
copts: A list (**not** an `Args` object) of compiler flags that apply to the
12191175
target being built. These flags, along with those from Bazel's Swift
12201176
configuration fragment (i.e., `--swiftcopt` command line flags) are
@@ -1228,18 +1184,12 @@ def _swiftc_command_line_and_inputs(
12281184
is added to ClangImporter's header search paths for compatibility with
12291185
Bazel's C++ and Objective-C rules which support inclusions of generated
12301186
headers from that location.
1231-
objc_fragment: This argument is no longer used and will be removed in a
1232-
future version.
1233-
swift_fragment: This argument is no longer used and will be removed in a
1234-
future version.
12351187
12361188
Returns:
12371189
A `depset` containing the full set of files that need to be passed as inputs
12381190
of the Bazel action that spawns a tool with the computed command line (i.e.,
12391191
any source files, referenced module maps and headers, and so forth.)
12401192
"""
1241-
_ignore = [allow_testing, compilation_mode, configuration, objc_fragment, swift_fragment]
1242-
12431193
all_deps = deps + toolchain.implicit_deps
12441194

12451195
args.add("-module-name")

0 commit comments

Comments
 (0)