You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a mechanism to provide a list of protocol names for constant value extraction. (#1170)
This cherry-picks support for producing const values produced via the
compiler flags `-emit-const-values-path` and
`-const-gather-protocols-file`. rules_apple will start using this
feature in bazelbuild/rules_apple#2418.
---------
Co-authored-by: Tony Allevato <[email protected]>
Co-authored-by: Keith Smiley <[email protected]>
| <aid="swift_common.create_module-name"></a>name | The name of the module. | none |
356
360
| <aid="swift_common.create_module-clang"></a>clang | A value returned by `swift_common.create_clang_module` that contains artifacts related to Clang modules, such as a module map or precompiled module. This may be `None` if the module is a pure Swift module with no generated Objective-C interface. |`None`|
361
+
| <aid="swift_common.create_module-const_gather_protocols"></a>const_gather_protocols | A list of protocol names from which constant values should be extracted from source code that takes this module as a *direct* dependency. |`[]`|
357
362
| <aid="swift_common.create_module-compilation_context"></a>compilation_context | A value returned from `swift_common.create_compilation_context` that contains the context needed to compile the module being built. This may be `None` if the module wasn't compiled from sources. |`None`|
358
363
| <aid="swift_common.create_module-is_system"></a>is_system | Indicates whether the module is a system module. The default value is `False`. System modules differ slightly from non-system modules in the way that they are passed to the compiler. For example, non-system modules have their Clang module maps passed to the compiler in both implicit and explicit module builds. System modules, on the other hand, do not have their module maps passed to the compiler in implicit module builds because there is currently no way to indicate that modules declared in a file passed via `-fmodule-map-file` should be treated as system modules even if they aren't declared with the `[system]` attribute, and some system modules may not build cleanly with respect to warnings otherwise. Therefore, it is assumed that any module with `is_system == True` must be able to be found using import search paths in order for implicit module builds to succeed. |`False`|
359
364
| <aid="swift_common.create_module-swift"></a>swift | A value returned by `swift_common.create_swift_module` that contains artifacts related to Swift modules, such as the `.swiftmodule`, `.swiftdoc`, and/or `.swiftinterface` files emitted by the compiler. This may be `None` if the module is a pure C/Objective-C module. |`None`|
@@ -460,7 +465,7 @@ A provider whose type/layout is an implementation detail and should not
Creates a value representing a Swift module use as a Swift dependency.
@@ -479,6 +484,7 @@ Creates a value representing a Swift module use as a Swift dependency.
479
484
| <aid="swift_common.create_swift_module-swiftsourceinfo"></a>swiftsourceinfo | The `.swiftsourceinfo` file emitted by the compiler for this module. May be `None` if no source info file was emitted. |`None`|
480
485
| <aid="swift_common.create_swift_module-swiftinterface"></a>swiftinterface | The `.swiftinterface` file emitted by the compiler for this module. May be `None` if no module interface file was emitted. |`None`|
481
486
| <aid="swift_common.create_swift_module-private_swiftinterface"></a>private_swiftinterface | The `.private.swiftinterface` file emitted by the compiler for this module. May be `None` if no private module interface file was emitted. |`None`|
487
+
| <aid="swift_common.create_swift_module-const_protocols_to_gather"></a>const_protocols_to_gather | A list of protocol names from which constant values should be extracted from source code that takes this module as a *direct* dependency. |`[]`|
482
488
| <aid="swift_common.create_swift_module-symbol_graph"></a>symbol_graph | A `File` representing the directory that contains the symbol graph data generated by the compiler if the `"swift.emit_symbol_graph"` feature is enabled, otherwise this will be `None`. |`None`|
Propagates information about a Swift toolchain to compilation and linking rules
@@ -102,6 +102,7 @@ that use the toolchain.
102
102
| <aid="SwiftToolchainInfo-action_configs"></a>action_configs | This field is an internal implementation detail of the build rules. |
103
103
| <aid="SwiftToolchainInfo-cc_toolchain_info"></a>cc_toolchain_info | The `cc_common.CcToolchainInfo` provider from the Bazel C++ toolchain that this Swift toolchain depends on. |
104
104
| <aid="SwiftToolchainInfo-clang_implicit_deps_providers"></a>clang_implicit_deps_providers | A `struct` with the following fields, which represent providers from targets that should be added as implicit dependencies of any precompiled explicit C/Objective-C modules:<br><br>*`cc_infos`: A list of `CcInfo` providers from targets specified as the toolchain's implicit dependencies. * `objc_infos`: A list of `apple_common.Objc` providers from targets specified as the toolchain's implicit dependencies. * `swift_infos`: A list of `SwiftInfo` providers from targets specified as the toolchain's implicit dependencies.<br><br>For ease of use, this field is never `None`; it will always be a valid `struct` containing the fields described above, even if those lists are empty. |
105
+
| <aid="SwiftToolchainInfo-const_protocols_to_gather"></a>const_protocols_to_gather |`File`. A JSON file specifying a list of protocols for extraction of conformances' const values. |
105
106
| <aid="SwiftToolchainInfo-developer_dirs"></a>developer_dirs | A list of `structs` containing the following fields:*`developer_path_label`: A `string` representing the type of developer path. * `path`: A `string` representing the path to the developer framework. |
106
107
| <aid="SwiftToolchainInfo-entry_point_linkopts_provider"></a>entry_point_linkopts_provider | A function that returns flags that should be passed to the linker to control the name of the entry point of a linked binary for rules that customize their entry point. This function must take the following keyword arguments: * `entry_point_name`: The name of the entry point function, as was passed to the Swift compiler using the `-entry-point-function-name` flag. It must return a `struct` with the following fields: * `linkopts`: A list of strings that will be passed as additional linker flags when linking a binary with a custom entry point. |
107
108
| <aid="SwiftToolchainInfo-feature_allowlists"></a>feature_allowlists | A list of `SwiftFeatureAllowlistInfo` providers that allow or prohibit packages from requesting or disabling features. |
0 commit comments