From 62f391e32e44bffdcb34c1c3d2698a1dde512189 Mon Sep 17 00:00:00 2001 From: Eric Miotto Date: Mon, 28 Apr 2025 07:07:21 -0700 Subject: [PATCH 1/2] =?UTF-8?q?6.2:=20Add=20`=5FBuiltin=5Ffloat`=20depende?= =?UTF-8?q?ncy=20to=20`Distributed`=C2=A0and=20`Synchronization`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will avoid errors in CI when the latter ones are scheduled before the former. Addresses rdar://149558141 (cherry picked from commit 231a9d989dfe6861f0b53867253307541e7b420f) --- stdlib/public/Distributed/CMakeLists.txt | 10 ++++++++++ stdlib/public/Synchronization/CMakeLists.txt | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/stdlib/public/Distributed/CMakeLists.txt b/stdlib/public/Distributed/CMakeLists.txt index 1dbecde134c34..49cfcfb08cb2a 100644 --- a/stdlib/public/Distributed/CMakeLists.txt +++ b/stdlib/public/Distributed/CMakeLists.txt @@ -16,6 +16,15 @@ else() set(swift_distributed_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) +set(swift_distributed_dependencies _Builtin_float) +else() +set(swift_distributed_dependencies) +endif() + set(swift_distributed_link_libraries swiftCore) @@ -30,6 +39,7 @@ add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS DistributedMetadata.swift LocalTestingDistributedActorSystem.swift + SWIFT_MODULE_DEPENDS ${swift_distributed_dependencies} SWIFT_MODULE_DEPENDS_IOS ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_OSX ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_TVOS ${swift_distributed_darwin_dependencies} diff --git a/stdlib/public/Synchronization/CMakeLists.txt b/stdlib/public/Synchronization/CMakeLists.txt index d924943cee70f..e0256d57d0388 100644 --- a/stdlib/public/Synchronization/CMakeLists.txt +++ b/stdlib/public/Synchronization/CMakeLists.txt @@ -41,6 +41,14 @@ if(SWIFT_BUILD_SDK_OVERLAY) set(SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES Darwin) endif() +set(SWIFT_SYNCHRONIZATION_DEPENDENCIES) +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + set(SWIFT_SYNCHRONIZATION_DEPENDENCIES _Builtin_float) +endif() + set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES Mutex/DarwinImpl.swift Mutex/Mutex.swift @@ -104,6 +112,8 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES SWIFT_SOURCES_DEPENDS_FREESTANDING Mutex/MutexUnavailable.swift + SWIFT_MODULE_DEPENDS + ${SWIFT_SYNCHRONIZATION_DEPENDENCIES} SWIFT_MODULE_DEPENDS_OSX ${SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES} SWIFT_MODULE_DEPENDS_IOS From 06a20017084e3aeda614ebf7240a9da5201e5f42 Mon Sep 17 00:00:00 2001 From: Eric Miotto Date: Thu, 1 May 2025 09:29:19 -0700 Subject: [PATCH 2/2] CMake: add explicit dependency to _Builtin_float to targets... ... that would import that as a result of importing Darwin from the SDK. Amend my previous change to Differentiation and Distributed in this sense. Addresses rdar://150400049 (cherry picked from commit 8c7e8550aaedec76cfe516f404dcbc0791fe00e1) --- stdlib/private/OSLog/CMakeLists.txt | 10 ++++++++++ stdlib/private/StdlibUnittest/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftPrivate/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt | 11 +++++++++++ .../private/SwiftPrivateThreadExtras/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftReflectionTest/CMakeLists.txt | 11 +++++++++++ stdlib/public/Distributed/CMakeLists.txt | 9 +++++---- stdlib/public/Synchronization/CMakeLists.txt | 9 +++++---- stdlib/public/libexec/swift-backtrace/CMakeLists.txt | 11 +++++++++++ 9 files changed, 86 insertions(+), 8 deletions(-) diff --git a/stdlib/private/OSLog/CMakeLists.txt b/stdlib/private/OSLog/CMakeLists.txt index befc43e172b7c..21cab695c781d 100644 --- a/stdlib/private/OSLog/CMakeLists.txt +++ b/stdlib/private/OSLog/CMakeLists.txt @@ -8,6 +8,16 @@ endif() if (SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING) list(APPEND swift_oslog_darwin_dependencies "_StringProcessing") endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_oslog_darwin_dependencies _Builtin_float) +endif() add_swift_target_library(swiftOSLogTestHelper IS_SDK_OVERLAY diff --git a/stdlib/private/StdlibUnittest/CMakeLists.txt b/stdlib/private/StdlibUnittest/CMakeLists.txt index 5ebc25ecd3f72..a54fc7b006777 100644 --- a/stdlib/private/StdlibUnittest/CMakeLists.txt +++ b/stdlib/private/StdlibUnittest/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_stdlib_unittest_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_stdlib_unittest_darwin_dependencies _Builtin_float) +endif() + set(swift_stdlib_unittest_compile_flags "-Xfrontend" "-disable-objc-attr-requires-foundation-module") if (SWIFT_RUNTIME_ENABLE_LEAK_CHECKER) diff --git a/stdlib/private/SwiftPrivate/CMakeLists.txt b/stdlib/private/SwiftPrivate/CMakeLists.txt index 07b8ac7d0033c..585a0b36c86de 100644 --- a/stdlib/private/SwiftPrivate/CMakeLists.txt +++ b/stdlib/private/SwiftPrivate/CMakeLists.txt @@ -8,6 +8,17 @@ else() set(swift_swiftprivate_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_swiftprivate_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt index 83a13affb475d..22adfe2cb6af2 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt @@ -20,6 +20,17 @@ else() set(swift_private_libc_extras_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_private_libc_extras_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt index 124f162220585..5d005a783d595 100644 --- a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_private_thread_extras_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_private_thread_extras_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftReflectionTest/CMakeLists.txt b/stdlib/private/SwiftReflectionTest/CMakeLists.txt index 6dba4e6ac07fb..d9474ac61bd44 100644 --- a/stdlib/private/SwiftReflectionTest/CMakeLists.txt +++ b/stdlib/private/SwiftReflectionTest/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_reflection_test_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_reflection_test_darwin_dependencies _Builtin_float) +endif() + if (SWIFT_INCLUDE_TESTS AND SWIFT_BUILD_DYNAMIC_STDLIB) add_swift_target_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB SwiftReflectionTest.swift diff --git a/stdlib/public/Distributed/CMakeLists.txt b/stdlib/public/Distributed/CMakeLists.txt index 49cfcfb08cb2a..aec0c14f7c2b3 100644 --- a/stdlib/public/Distributed/CMakeLists.txt +++ b/stdlib/public/Distributed/CMakeLists.txt @@ -20,9 +20,11 @@ if((SWIFT_BUILD_CLANG_OVERLAYS OR SWIFT_BUILD_TEST_SUPPORT_MODULES) AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) -set(swift_distributed_dependencies _Builtin_float) -else() -set(swift_distributed_dependencies) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_distributed_darwin_dependencies _Builtin_float) endif() set(swift_distributed_link_libraries @@ -39,7 +41,6 @@ add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS DistributedMetadata.swift LocalTestingDistributedActorSystem.swift - SWIFT_MODULE_DEPENDS ${swift_distributed_dependencies} SWIFT_MODULE_DEPENDS_IOS ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_OSX ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_TVOS ${swift_distributed_darwin_dependencies} diff --git a/stdlib/public/Synchronization/CMakeLists.txt b/stdlib/public/Synchronization/CMakeLists.txt index e0256d57d0388..302d332b82c3e 100644 --- a/stdlib/public/Synchronization/CMakeLists.txt +++ b/stdlib/public/Synchronization/CMakeLists.txt @@ -41,12 +41,15 @@ if(SWIFT_BUILD_SDK_OVERLAY) set(SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES Darwin) endif() -set(SWIFT_SYNCHRONIZATION_DEPENDENCIES) if((SWIFT_BUILD_CLANG_OVERLAYS OR SWIFT_BUILD_TEST_SUPPORT_MODULES) AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) - set(SWIFT_SYNCHRONIZATION_DEPENDENCIES _Builtin_float) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES _Builtin_float) endif() set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES @@ -112,8 +115,6 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES SWIFT_SOURCES_DEPENDS_FREESTANDING Mutex/MutexUnavailable.swift - SWIFT_MODULE_DEPENDS - ${SWIFT_SYNCHRONIZATION_DEPENDENCIES} SWIFT_MODULE_DEPENDS_OSX ${SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES} SWIFT_MODULE_DEPENDS_IOS diff --git a/stdlib/public/libexec/swift-backtrace/CMakeLists.txt b/stdlib/public/libexec/swift-backtrace/CMakeLists.txt index 20f6048a1ea8f..8f42800b0e6f3 100644 --- a/stdlib/public/libexec/swift-backtrace/CMakeLists.txt +++ b/stdlib/public/libexec/swift-backtrace/CMakeLists.txt @@ -12,6 +12,17 @@ if(SWIFT_BUILD_SDK_OVERLAY) set(musl Musl) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND darwin _Builtin_float) +endif() + # Similarly, we only want the Runtime dependency if we're building # with the stdlib. set(runtime)