Skip to content

Commit

Permalink
Use swiftc_inputs instead of deps for Swift VFS target
Browse files Browse the repository at this point in the history
This fixes a missing `_swift_vfs.yaml` error related to the changes in: bazelbuild/rules_swift#1191
  • Loading branch information
luispadron committed Jun 19, 2024
1 parent ec08184 commit b8b4692
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ module {module_name}.Swift {{
arguments = [args],
)

return [
DefaultInfo(
files = depset([ctx.outputs.destination])
),
CcInfo(
compilation_context = cc_common.create_compilation_context(
headers = depset([ctx.outputs.destination]),
),
),
]

extend_modulemap = rule(
implementation = _extend_modulemap_impl,
attrs = {
Expand Down Expand Up @@ -961,6 +972,7 @@ def apple_library(
tags = _MANUAL,
)
module_map = "%s.extended.modulemap" % name
swiftc_inputs.append(module_map)

# Note: this needs to go here, in order to virtualize the extended module
framework_vfs_overlay(
Expand Down Expand Up @@ -991,11 +1003,11 @@ def apple_library(
"@build_bazel_rules_ios//:virtualize_frameworks": framework_vfs_swift_copts,
"//conditions:default": framework_vfs_swift_copts if enable_framework_vfs else [],
}) + additional_swift_copts,
deps = deps + private_deps + private_dep_names + lib_names + select({
deps = deps + private_deps + private_dep_names + lib_names,
swiftc_inputs = swiftc_inputs + select({
"@build_bazel_rules_ios//:virtualize_frameworks": [framework_vfs_overlay_name_swift],
"//conditions:default": [framework_vfs_overlay_name_swift] if enable_framework_vfs else [],
}),
swiftc_inputs = swiftc_inputs,
features = features + ["swift.no_generated_module_map", "swift.use_pch_output_dir"] + select({
"@build_bazel_rules_ios//:virtualize_frameworks": ["swift.vfsoverlay"],
"//conditions:default": [],
Expand Down

0 comments on commit b8b4692

Please sign in to comment.