From 14956ef82b22836e5c4894e4dcf951fa7ba4f21f Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Thu, 23 Mar 2023 10:45:04 -0700 Subject: [PATCH] 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. --- stdlib/cmake/modules/SwiftSource.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index d587fdf0180a3..6584aaf37ad46 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -640,8 +640,11 @@ function(_compile_swift_files if(SWIFT_ENABLE_MODULE_INTERFACES) set(interface_file "${module_base}.swiftinterface") set(interface_file_static "${module_base_static}.swiftinterface") + set(private_interface_file "${module_base}.private.swiftinterface") + set(private_interface_file_static "${module_base_static}.private.swiftinterface") list(APPEND swift_module_flags - "-emit-module-interface-path" "${interface_file}") + "-emit-module-interface-path" "${interface_file}" + "-emit-private-module-interface-path" "${private_interface_file}") endif() if (NOT SWIFTFILE_IS_STDLIB_CORE) @@ -652,7 +655,7 @@ function(_compile_swift_files set(module_outputs "${module_file}" "${module_doc_file}") if(interface_file) - list(APPEND module_outputs "${interface_file}") + list(APPEND module_outputs "${interface_file}" "${private_interface_file}") endif() set(optional_arg) @@ -720,8 +723,8 @@ function(_compile_swift_files set(module_outputs "${module_file}" "${module_doc_file}") set(module_outputs_static "${module_file_static}" "${module_doc_file_static}") if(interface_file) - list(APPEND module_outputs "${interface_file}") - list(APPEND module_outputs_static "${interface_file_static}") + list(APPEND module_outputs "${interface_file}" "${private_interface_file}") + list(APPEND module_outputs_static "${interface_file_static}" "${private_interface_file_static}") endif() swift_install_in_component(DIRECTORY "${specific_module_dir}"