Skip to content

Commit c6f81cb

Browse files
authored
Merge pull request #76344 from swiftlang/revert-75918-new-apple-sdk-build-fixes
Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms"
2 parents adf3bde + 1baff87 commit c6f81cb

17 files changed

+25
-55
lines changed

CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,10 @@ option(SWIFT_BUILD_CLANG_OVERLAYS
244244
"Build Swift overlays for the clang builtin modules"
245245
TRUE)
246246

247-
# The SDK overlay is provided by the SDK itself on Darwin platforms.
248-
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
249-
set(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default FALSE)
250-
else()
251-
set(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default TRUE)
252-
endif()
253-
254247
option(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY
255248
"Build dynamic variants of the Swift SDK overlay"
256-
"${SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default}")
257-
249+
TRUE)
250+
258251
option(SWIFT_BUILD_STATIC_SDK_OVERLAY
259252
"Build static variants of the Swift SDK overlay"
260253
FALSE)

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ function(swift_benchmark_compile)
716716

717717
if(NOT SWIFT_BENCHMARK_BUILT_STANDALONE)
718718
set(stdlib_dependencies "swift-frontend" "swiftCore-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
719-
if((SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) AND SWIFT_BUILD_SDK_OVERLAY)
719+
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
720720
list(APPEND stdlib_dependencies "swiftDarwin-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
721721
endif()
722722
foreach(stdlib_dependency ${UNIVERSAL_LIBRARY_NAMES_${SWIFT_BENCHMARK_COMPILE_PLATFORM}})

cmake/modules/DarwinSDKs.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ if(swift_build_freestanding AND (SWIFT_FREESTANDING_FLAVOR STREQUAL "apple"))
3838
configure_target_variant(FREESTANDING-R "FREESTANDING Release" FREESTANDING R "Release")
3939
configure_target_variant(FREESTANDING-S "FREESTANDING MinSizeRelease" FREESTANDING S "MinSizeRelease")
4040

41-
if(SWIFT_BUILD_SDK_OVERLAY)
42-
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "Darwin")
43-
else()
44-
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "")
45-
endif()
41+
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "Darwin")
4642
endif()
4743

4844
# Compatible cross-compile SDKS for Darwin OSes: IOS, IOS_SIMULATOR, TVOS,

stdlib/private/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
if(SWIFT_BUILD_SDK_OVERLAY OR (SWIFT_BUILD_TEST_SUPPORT_MODULES AND NOT SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default))
1+
if(SWIFT_BUILD_SDK_OVERLAY)
22
# SwiftPrivateThreadExtras makes use of Darwin/Glibc, which is part of the
3-
# SDK overlay. If the SDK overlay doesn't build by default, then it should
4-
# be available in the SDK and DifferentiationUnittest can still be built.
3+
# SDK overlay. It can't be built separately from the SDK overlay.
54
if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
65
add_subdirectory(DifferentiationUnittest)
76
endif()
@@ -21,7 +20,7 @@ if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
2120
add_subdirectory(StdlibUnittest)
2221
endif()
2322

24-
if(SWIFT_BUILD_SDK_OVERLAY OR (SWIFT_BUILD_TEST_SUPPORT_MODULES AND NOT SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default))
23+
if(SWIFT_BUILD_SDK_OVERLAY)
2524
add_subdirectory(OSLog)
2625

2726
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

stdlib/public/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ if(SWIFT_BUILD_STDLIB)
266266
add_subdirectory(core)
267267
add_subdirectory(SwiftOnoneSupport)
268268

269-
if(SWIFT_BUILD_CLANG_OVERLAYS OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
269+
if(SWIFT_BUILD_CLANG_OVERLAYS)
270270
add_subdirectory(ClangOverlays)
271271
endif()
272272

@@ -315,12 +315,13 @@ if(SWIFT_BUILD_REMOTE_MIRROR)
315315
add_subdirectory(SwiftRemoteMirror)
316316
endif()
317317

318-
if(SWIFT_BUILD_SDK_OVERLAY OR (SWIFT_BUILD_TEST_SUPPORT_MODULES AND SWIFT_BUILD_DYNAMIC_SDK_OVERLAY_default))
318+
if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
319319
add_subdirectory(Platform)
320320
endif()
321321

322322
if(SWIFT_BUILD_SDK_OVERLAY)
323-
# On Apple platforms, we aren't building any overlays. Instead, we're picking them up from the SDK.
323+
# On Apple platforms, we aren't building any overlays (other than Darwin in
324+
# Platform above). Instead, we're picking them up from the SDK.
324325

325326
if(WINDOWS IN_LIST SWIFT_SDKS)
326327
add_subdirectory(Windows)

test/Driver/loaded_module_trace_foundation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
// CHECK: "arch":"{{[^"]*}}"
1010
// CHECK: "swiftmodules":[
1111

12-
// Swift and SwiftOnoneSupport is expected to be locally built;
12+
// Darwin, Swift and SwiftOnoneSupport is expected to be locally built;
1313
// everything else comes from the SDK, built from swiftinterface.
1414

1515
// CHECK-DAG: "{{[^"]*}}/ObjectiveC.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
1616
// CHECK-DAG: "{{[^"]*}}/Dispatch.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
17-
// CHECK-DAG: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
17+
// CHECK-DAG: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
1818
// CHECK-DAG: "{{[^"]*}}/Foundation.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
1919
// CHECK-DAG: "{{[^"]*}}/Swift.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
2020
// CHECK-DAG: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"

test/Driver/loaded_module_trace_header.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// CHECK: "swiftmodules":[
1212
// CHECK-DAG: "{{[^"]*}}/ObjectiveC.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
1313
// CHECK-DAG: "{{[^"]*}}/Dispatch.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
14-
// CHECK-DAG: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
14+
// CHECK-DAG: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
1515
// CHECK-DAG: "{{[^"]*}}/Foundation.swiftmodule{{(\\/[^"]+[.]swift(module|interface))?}}"
1616
// CHECK-DAG: "{{[^"]*}}/Swift.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
1717
// CHECK-DAG: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Make sure that we can deserialize darwin.
2+
// RUN: %target-sil-opt %platform-sdk-overlay-dir/Darwin.swiftmodule/%target-swiftmodule-name -module-name Darwin > /dev/null
3+
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/Darwin.swiftmodule/%target-swiftmodule-name | %FileCheck %s
4+
5+
// REQUIRES: objc_interop
6+
7+
// CHECK-NOT: Unknown

test/embedded/concurrency-actors.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx
1111

12-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
13-
// embedded Swift mode.
14-
// XFAIL: OS=macosx
15-
1612
import _Concurrency
1713

1814
actor Number {

test/embedded/concurrency-async-let.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx
1111

12-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
13-
// embedded Swift mode.
14-
// XFAIL: OS=macosx
15-
1612
import _Concurrency
1713

1814
func fib(_ n: Int) -> Int {

test/embedded/concurrency-simple.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx
1111

12-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
13-
// embedded Swift mode.
14-
// XFAIL: OS=macosx
15-
1612
import _Concurrency
1713

1814
public func test() async -> Int {

test/embedded/darwin-bridging-header.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
// REQUIRES: VENDOR=apple
1212
// REQUIRES: OS=macosx
1313

14-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
15-
// embedded Swift mode.
16-
// XFAIL: OS=macosx
17-
1814
// BEGIN BridgingHeader.h
1915

2016
#include <unistd.h>

test/embedded/darwin.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// REQUIRES: VENDOR=apple
1010
// REQUIRES: OS=macosx
1111

12-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
13-
// embedded Swift mode.
14-
// XFAIL: OS=macosx
15-
1612
import Darwin
1713

1814
@main

test/embedded/dependencies-concurrency.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
// REQUIRES: optimized_stdlib
4848
// REQUIRES: OS=macosx
4949

50-
// The Darwin SDK overlay module in the macOS SDK cannot be imported in
51-
// embedded Swift mode.
52-
// XFAIL: OS=macosx
53-
5450
import _Concurrency
5551

5652
public func test() async -> Int {

test/lit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,8 @@ if run_vendor == 'apple':
15331533
'%s -modulewrap -target %s' %
15341534
(config.swiftc, config.variant_triple))
15351535
config.target_swift_emit_pcm = (
1536-
'%s -emit-pcm -target %s -sdk %r' %
1537-
(config.swiftc, config.variant_triple, config.variant_sdk))
1536+
'%s -emit-pcm -target %s' %
1537+
(config.swiftc, config.variant_triple))
15381538
subst_target_swift_frontend_mock_sdk_after = \
15391539
target_options_for_mock_sdk_after
15401540
config.target_sil_opt = (

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import multiprocessing
1010
import os
11-
import platform
1211

1312
import android.adb.commands
1413

@@ -1141,7 +1140,7 @@ def create_argument_parser():
11411140
help='build static variants of the Swift standard library')
11421141

11431142
option('--build-swift-dynamic-sdk-overlay', toggle_true,
1144-
default=platform.system() != "Darwin",
1143+
default=True,
11451144
help='build dynamic variants of the Swift SDK overlay')
11461145

11471146
option('--build-swift-static-sdk-overlay', toggle_true,

utils/build_swift/tests/expected_options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
import multiprocessing
11-
import platform
1211

1312
from build_swift import argparse
1413
from build_swift import defaults
@@ -80,7 +79,7 @@
8079
'build_runtime_with_host_compiler': False,
8180
'build_stdlib_deployment_targets': ['all'],
8281
'build_subdir': None,
83-
'build_swift_dynamic_sdk_overlay': platform.system() != "Darwin",
82+
'build_swift_dynamic_sdk_overlay': True,
8483
'build_swift_dynamic_stdlib': True,
8584
'build_swift_inspect': False,
8685
'build_swift_private_stdlib': True,

0 commit comments

Comments
 (0)