Skip to content

Commit ee11d3f

Browse files
Googlerswiple-rules-gardener
authored andcommitted
Add ctx argument to cc_common.configure_features
In order to migrate C++ rules to platforms, we need the access to the C++ configuration fragment in Starlark APIs. All existing APIs have already access to it, but cc_common.configure_features doesn't. This change adds a ctx argument to configure_features. This is the migration needed for bazelbuild/bazel#7793, and is part of the effort for bazelbuild/bazel#6516. If the rule doesn't depend on cpp fragment yet, you will have to add `fragments =['cpp']` argument to the rule() call. Note that this behavior is only available in Bazel 0.25 (to be released this month). RELNOTES: None. PiperOrigin-RevId: 248534309
1 parent 3a1d305 commit ee11d3f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

swift/internal/swift_import.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def _swift_import_impl(ctx):
3232
# toolchains.
3333
cc_toolchain = ctx.attr._cc_toolchain[cc_common.CcToolchainInfo]
3434
cc_feature_configuration = cc_common.configure_features(
35+
ctx = ctx,
3536
cc_toolchain = cc_toolchain,
3637
requested_features = ctx.features,
3738
unsupported_features = ctx.disabled_features,
@@ -126,5 +127,6 @@ The C++ toolchain from which linking flags and other tools needed by the Swift t
126127
Allows for the use of precompiled Swift modules as dependencies in other `swift_library` and
127128
`swift_binary` targets.
128129
""",
130+
fragments = ["cpp"],
129131
implementation = _swift_import_impl,
130132
)

0 commit comments

Comments
 (0)