|
15 | 15 | """Implementation of the `swift_library_group` rule."""
|
16 | 16 |
|
17 | 17 | load("//swift/internal:attrs.bzl", "swift_deps_attr")
|
| 18 | +load( |
| 19 | + "//swift/internal:toolchain_utils.bzl", |
| 20 | + "get_swift_toolchain", |
| 21 | + "use_swift_toolchain", |
| 22 | +) |
18 | 23 | load("//swift/internal:utils.bzl", "get_providers")
|
19 | 24 | load(":providers.bzl", "SwiftInfo")
|
20 | 25 | load(":swift_clang_module_aspect.bzl", "swift_clang_module_aspect")
|
21 | 26 |
|
22 | 27 | def _swift_library_group_impl(ctx):
|
| 28 | + swift_toolchain = get_swift_toolchain(ctx) |
| 29 | + |
23 | 30 | deps = ctx.attr.deps
|
24 | 31 |
|
25 | 32 | return [
|
26 | 33 | DefaultInfo(),
|
27 | 34 | cc_common.merge_cc_infos(
|
28 |
| - cc_infos = [dep[CcInfo] for dep in deps if CcInfo in dep], |
| 35 | + cc_infos = ([dep[CcInfo] for dep in deps if CcInfo in dep] + |
| 36 | + swift_toolchain.implicit_deps_providers.cc_infos), |
29 | 37 | ),
|
30 | 38 | coverage_common.instrumented_files_info(
|
31 | 39 | ctx,
|
32 | 40 | dependency_attributes = ["deps"],
|
33 | 41 | ),
|
34 | 42 | SwiftInfo(
|
35 |
| - swift_infos = get_providers(deps, SwiftInfo), |
| 43 | + swift_infos = (get_providers(deps, SwiftInfo) + |
| 44 | + swift_toolchain.implicit_deps_providers.swift_infos), |
36 | 45 | ),
|
37 | 46 | # Propagate an `apple_common.Objc` provider with linking info about the
|
38 | 47 | # library so that linking with Apple Starlark APIs/rules works
|
@@ -60,4 +69,5 @@ A new module isn't created for this target, you need to import the grouped
|
60 | 69 | libraries directly.
|
61 | 70 | """,
|
62 | 71 | implementation = _swift_library_group_impl,
|
| 72 | + toolchains = use_swift_toolchain(), |
63 | 73 | )
|
0 commit comments