Skip to content

Commit 3fc3631

Browse files
committed
Allow setting exec_group in more places
Signed-off-by: Brentley Jones <[email protected]>
1 parent 3dfbf33 commit 3fc3631

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

doc/api.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ A tuple of `(CcLinkingContext, CcLinkingOutputs)` containing the linking
411411

412412
<pre>
413413
swift_common.extract_symbol_graph(*, <a href="#swift_common.extract_symbol_graph-actions">actions</a>, <a href="#swift_common.extract_symbol_graph-compilation_contexts">compilation_contexts</a>, <a href="#swift_common.extract_symbol_graph-emit_extension_block_symbols">emit_extension_block_symbols</a>,
414-
<a href="#swift_common.extract_symbol_graph-feature_configuration">feature_configuration</a>, <a href="#swift_common.extract_symbol_graph-include_dev_srch_paths">include_dev_srch_paths</a>, <a href="#swift_common.extract_symbol_graph-minimum_access_level">minimum_access_level</a>,
415-
<a href="#swift_common.extract_symbol_graph-module_name">module_name</a>, <a href="#swift_common.extract_symbol_graph-output_dir">output_dir</a>, <a href="#swift_common.extract_symbol_graph-swift_infos">swift_infos</a>, <a href="#swift_common.extract_symbol_graph-swift_toolchain">swift_toolchain</a>,
416-
<a href="#swift_common.extract_symbol_graph-toolchain_type">toolchain_type</a>)
414+
<a href="#swift_common.extract_symbol_graph-exec_group">exec_group</a>, <a href="#swift_common.extract_symbol_graph-feature_configuration">feature_configuration</a>, <a href="#swift_common.extract_symbol_graph-include_dev_srch_paths">include_dev_srch_paths</a>,
415+
<a href="#swift_common.extract_symbol_graph-minimum_access_level">minimum_access_level</a>, <a href="#swift_common.extract_symbol_graph-module_name">module_name</a>, <a href="#swift_common.extract_symbol_graph-output_dir">output_dir</a>, <a href="#swift_common.extract_symbol_graph-swift_infos">swift_infos</a>,
416+
<a href="#swift_common.extract_symbol_graph-swift_toolchain">swift_toolchain</a>, <a href="#swift_common.extract_symbol_graph-toolchain_type">toolchain_type</a>)
417417
</pre>
418418

419419
Extracts the symbol graph from a Swift module.
@@ -426,6 +426,7 @@ Extracts the symbol graph from a Swift module.
426426
| <a id="swift_common.extract_symbol_graph-actions"></a>actions | The object used to register actions. | none |
427427
| <a id="swift_common.extract_symbol_graph-compilation_contexts"></a>compilation_contexts | A list of `CcCompilationContext`s that represent C/Objective-C requirements of the target being compiled, such as Swift-compatible preprocessor defines, header search paths, and so forth. These are typically retrieved from the `CcInfo` providers of a target's dependencies. | none |
428428
| <a id="swift_common.extract_symbol_graph-emit_extension_block_symbols"></a>emit_extension_block_symbols | A `bool` that indicates whether `extension` block information should be included in the symbol graph. | `None` |
429+
| <a id="swift_common.extract_symbol_graph-exec_group"></a>exec_group | Runs the Swift compilation action under the given execution group's context. If `None`, the default execution group is used. | `None` |
429430
| <a id="swift_common.extract_symbol_graph-feature_configuration"></a>feature_configuration | The Swift feature configuration. | none |
430431
| <a id="swift_common.extract_symbol_graph-include_dev_srch_paths"></a>include_dev_srch_paths | A `bool` that indicates whether the developer framework search paths will be added to the compilation command. | none |
431432
| <a id="swift_common.extract_symbol_graph-minimum_access_level"></a>minimum_access_level | The minimum access level of the declarations that should be extracted into the symbol graphs. The default value is `None`, which means the Swift compiler's default behavior should be used (at the time of this writing, the default behavior is "public"). | `None` |

proto/swift_proto_utils.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def compile_swift_protos_for_target(
196196
additional_swift_proto_compiler_info,
197197
attr,
198198
ctx,
199+
exec_group = None,
199200
module_name,
200201
proto_infos,
201202
swift_proto_compilers,
@@ -208,6 +209,8 @@ def compile_swift_protos_for_target(
208209
additional_compiler_deps: Additional dependencies passed directly to the Swift compiler.
209210
attr: The attributes of the target for which the module is being compiled.
210211
ctx: The context of the aspect or rule.
212+
exec_group: Runs the Swift compilation action under the given execution
213+
group's context. If `None`, the default execution group is used.
211214
module_name: The name of the Swift module that should be compiled from the protos.
212215
proto_infos: List of `ProtoInfo` providers to compile into Swift source files.
213216
swift_proto_compilers: List of targets propagating `SwiftProtoCompiler` providers.
@@ -276,6 +279,7 @@ def compile_swift_protos_for_target(
276279
additional_inputs = additional_inputs,
277280
cc_infos = get_providers(compiler_deps, CcInfo),
278281
copts = ["-parse-as-library"] + copts,
282+
exec_group = exec_group,
279283
feature_configuration = feature_configuration,
280284
include_dev_srch_paths = include_dev_srch_paths,
281285
module_name = module_name,

swift/internal/symbol_graph_extracting.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def extract_symbol_graph(
2525
actions,
2626
compilation_contexts,
2727
emit_extension_block_symbols = None,
28+
exec_group = None,
2829
feature_configuration,
2930
include_dev_srch_paths,
3031
minimum_access_level = None,
@@ -44,6 +45,8 @@ def extract_symbol_graph(
4445
a target's dependencies.
4546
emit_extension_block_symbols: A `bool` that indicates whether `extension` block
4647
information should be included in the symbol graph.
48+
exec_group: Runs the Swift compilation action under the given execution
49+
group's context. If `None`, the default execution group is used.
4750
feature_configuration: The Swift feature configuration.
4851
include_dev_srch_paths: A `bool` that indicates whether the developer
4952
framework search paths will be added to the compilation command.
@@ -114,6 +117,7 @@ def extract_symbol_graph(
114117
run_toolchain_action(
115118
actions = actions,
116119
action_name = SWIFT_ACTION_SYMBOL_GRAPH_EXTRACT,
120+
exec_group = exec_group,
117121
feature_configuration = feature_configuration,
118122
outputs = [output_dir],
119123
prerequisites = prerequisites,

0 commit comments

Comments
 (0)