Skip to content

Commit bcb7825

Browse files
etcwildeedymtt
authored andcommitted
[5.9] Build private swift interface files from stdlib
We have various pieces of SPI that are getting used in tests that are failing occasionally. The swiftmodule file has the SPI, so if the compiler loads from the swiftmodule file, everything works fine. If the compiler loads the interface from the swiftinterface file, it fails to find the `startOnMainActor` declaration. Addresses rdar://108900952 (cherry picked from commit 14956ef, #64587)
1 parent 34684c1 commit bcb7825

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,11 @@ function(_compile_swift_files
640640
if(SWIFT_ENABLE_MODULE_INTERFACES)
641641
set(interface_file "${module_base}.swiftinterface")
642642
set(interface_file_static "${module_base_static}.swiftinterface")
643+
set(private_interface_file "${module_base}.private.swiftinterface")
644+
set(private_interface_file_static "${module_base_static}.private.swiftinterface")
643645
list(APPEND swift_module_flags
644-
"-emit-module-interface-path" "${interface_file}")
646+
"-emit-module-interface-path" "${interface_file}"
647+
"-emit-private-module-interface-path" "${private_interface_file}")
645648
endif()
646649

647650
if (NOT SWIFTFILE_IS_STDLIB_CORE)
@@ -652,7 +655,7 @@ function(_compile_swift_files
652655
set(module_outputs "${module_file}" "${module_doc_file}")
653656

654657
if(interface_file)
655-
list(APPEND module_outputs "${interface_file}")
658+
list(APPEND module_outputs "${interface_file}" "${private_interface_file}")
656659
endif()
657660

658661
set(optional_arg)
@@ -720,8 +723,8 @@ function(_compile_swift_files
720723
set(module_outputs "${module_file}" "${module_doc_file}")
721724
set(module_outputs_static "${module_file_static}" "${module_doc_file_static}")
722725
if(interface_file)
723-
list(APPEND module_outputs "${interface_file}")
724-
list(APPEND module_outputs_static "${interface_file_static}")
726+
list(APPEND module_outputs "${interface_file}" "${private_interface_file}")
727+
list(APPEND module_outputs_static "${interface_file_static}" "${private_interface_file_static}")
725728
endif()
726729

727730
swift_install_in_component(DIRECTORY "${specific_module_dir}"

0 commit comments

Comments
 (0)