Skip to content

Commit 9ea7b48

Browse files
committed
Generalize fix
1 parent efa3f31 commit 9ea7b48

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

swift/toolchains/config/compile_config.bzl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,8 +2005,19 @@ def _dependencies_swiftmodules_configurator(prerequisites, args):
20052005
uniquify = True,
20062006
)
20072007

2008+
# Include both swiftmodule and swiftinterface files as inputs to ensure
2009+
# they are available in the sandbox for compilation
2010+
transitive_inputs = []
2011+
for module in prerequisites.transitive_modules:
2012+
swift_module = module.swift
2013+
if swift_module:
2014+
if swift_module.swiftmodule:
2015+
transitive_inputs.append(swift_module.swiftmodule)
2016+
if swift_module.swiftinterface:
2017+
transitive_inputs.append(swift_module.swiftinterface)
2018+
20082019
return ConfigResultInfo(
2009-
inputs = prerequisites.transitive_swiftmodules,
2020+
inputs = transitive_inputs,
20102021
)
20112022

20122023
def _module_aliases_configurator(prerequisites, args):

swift/toolchains/config/compile_module_interface_config.bzl

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ load(
1818
"//swift/internal:action_names.bzl",
1919
"SWIFT_ACTION_COMPILE_MODULE_INTERFACE",
2020
)
21-
load(":action_config.bzl", "ActionConfigInfo", "ConfigResultInfo", "add_arg")
21+
load(":action_config.bzl", "ActionConfigInfo", "add_arg")
2222

2323
def compile_module_interface_action_configs():
2424
return [
@@ -41,32 +41,8 @@ def compile_module_interface_action_configs():
4141
add_arg("-compile-module-from-interface"),
4242
],
4343
),
44-
ActionConfigInfo(
45-
actions = [SWIFT_ACTION_COMPILE_MODULE_INTERFACE],
46-
configurators = [
47-
_dependencies_swiftmodules_configurator,
48-
],
49-
),
5044
]
5145

5246
def _emit_module_path_from_module_interface_configurator(prerequisites, args):
5347
"""Adds the `.swiftmodule` output path to the command line."""
5448
args.add("-o", prerequisites.swiftmodule_file)
55-
56-
def _dependencies_swiftmodules_configurator(prerequisites):
57-
"""Adds transitive swiftmodule dependencies as inputs for module interface compilation."""
58-
59-
# For module interface compilation, we need access to dependency swiftinterface/swiftmodule files
60-
# This ensures they are available in the sandbox
61-
transitive_inputs = []
62-
for module in prerequisites.transitive_modules:
63-
swift_module = module.swift
64-
if swift_module:
65-
if swift_module.swiftmodule:
66-
transitive_inputs.append(swift_module.swiftmodule)
67-
if swift_module.swiftinterface:
68-
transitive_inputs.append(swift_module.swiftinterface)
69-
70-
return ConfigResultInfo(
71-
inputs = transitive_inputs,
72-
)

0 commit comments

Comments
 (0)