Skip to content

Commit ff4d121

Browse files
authored
Merge pull request #76556 from benlangmuir/bump-to-13-6.0.0
[6.0.1] Bump the deployment target for the compiler to macOS 13.0
2 parents 9641dbc + 8fd9615 commit ff4d121

File tree

87 files changed

+1292
-1247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1292
-1247
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,16 @@ option(SWIFT_ALLOW_LINKING_SWIFT_CONTENT_IN_DARWIN_TOOLCHAIN
556556
This is needed to support Apple internal configurations."
557557
FALSE)
558558

559-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.13" CACHE STRING
559+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "13.0" CACHE STRING
560560
"Minimum deployment target version for OS X")
561561

562-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "11.0" CACHE STRING
562+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "16.0" CACHE STRING
563563
"Minimum deployment target version for iOS")
564564

565-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "11.0" CACHE STRING
565+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "16.0" CACHE STRING
566566
"Minimum deployment target version for tvOS")
567567

568-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "4.0" CACHE STRING
568+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "6.0" CACHE STRING
569569
"Minimum deployment target version for watchOS")
570570

571571
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS "1.0" CACHE STRING

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ macro(configure_sdks_darwin)
110110
set(appletvos_arch "arm64")
111111
set(watchos_arch "armv7k" "arm64_32")
112112

113-
set(macosx_ver "10.13")
114-
set(iphoneos_ver "11.0")
115-
set(appletvos_ver "11.0")
116-
set(watchos_ver "4.0")
113+
set(macosx_ver "13.0")
114+
set(iphoneos_ver "16.0")
115+
set(appletvos_ver "16.0")
116+
set(watchos_ver "6.0")
117117

118118
set(macosx_vendor "apple")
119119
set(iphoneos_vendor "apple")

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function(_report_sdk prefix)
6868
endfunction()
6969

7070
# Remove architectures not supported by the SDK from the given list.
71-
function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
71+
function(remove_sdk_unsupported_archs name os sdk_path deployment_version architectures_var)
7272
execute_process(COMMAND
7373
/usr/libexec/PlistBuddy -c "Print :SupportedTargets:${os}:Archs" ${sdk_path}/SDKSettings.plist
7474
OUTPUT_VARIABLE sdk_supported_archs
@@ -87,11 +87,11 @@ function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
8787
# 32-bit iOS simulator is not listed explicitly in SDK settings.
8888
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
8989
list(APPEND architectures ${arch})
90-
elseif(arch STREQUAL "armv7k" AND os STREQUAL "watchos")
90+
elseif(arch STREQUAL "armv7k" AND os STREQUAL "watchos" AND deployment_version VERSION_LESS "9.0")
9191
# 32-bit watchOS is not listed explicitly in SDK settings.
9292
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
9393
list(APPEND architectures ${arch})
94-
elseif(arch STREQUAL "i386" AND os STREQUAL "watchsimulator")
94+
elseif(arch STREQUAL "i386" AND os STREQUAL "watchsimulator" AND deployment_version VERSION_LESS "7.0")
9595
# 32-bit watchOS simulator is not listed explicitly in SDK settings.
9696
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
9797
list(APPEND architectures ${arch})
@@ -229,7 +229,7 @@ macro(configure_sdk_darwin
229229
endif()
230230

231231
# Remove any architectures not supported by the SDK.
232-
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} SWIFT_SDK_${prefix}_ARCHITECTURES)
232+
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} "${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}" SWIFT_SDK_${prefix}_ARCHITECTURES)
233233

234234
list_intersect(
235235
"${SWIFT_DARWIN_MODULE_ARCHS}" # lhs

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,15 +1909,16 @@ static bool fixAvailabilityByNarrowingNearbyVersionCheck(
19091909
AvailabilityContext(RunningRange))) {
19101910

19111911
// Only fix situations that are "nearby" versions, meaning
1912-
// disagreement on a minor-or-less version for non-macOS,
1913-
// or disagreement on a subminor-or-less version for macOS.
1912+
// disagreement on a minor-or-less version (subminor-or-less version for
1913+
// macOS 10.x.y).
19141914
auto RunningVers = RunningRange.getLowerEndpoint();
19151915
auto RequiredVers = RequiredRange.getLowerEndpoint();
19161916
auto Platform = targetPlatform(Context.LangOpts);
19171917
if (RunningVers.getMajor() != RequiredVers.getMajor())
19181918
return false;
19191919
if ((Platform == PlatformKind::macOS ||
19201920
Platform == PlatformKind::macOSApplicationExtension) &&
1921+
RunningVers.getMajor() == 10 &&
19211922
!(RunningVers.getMinor().has_value() &&
19221923
RequiredVers.getMinor().has_value() &&
19231924
RunningVers.getMinor().value() ==

test/ClangImporter/availability_implicit_macosx.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -typecheck -verify -target %target-cpu-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift
2-
// RUN: not %swift -typecheck -target %target-cpu-apple-macosx10.51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift 2>&1 | %FileCheck %s '--implicit-check-not=<unknown>:0'
1+
// RUN: %swift -typecheck -verify -target %target-cpu-apple-macosx51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift
2+
// RUN: not %swift -typecheck -target %target-cpu-apple-macosx51 %clang-importer-sdk -I %S/Inputs/custom-modules %s %S/Inputs/availability_implicit_macosx_other.swift 2>&1 | %FileCheck %s '--implicit-check-not=<unknown>:0'
33

44
// REQUIRES: OS=macosx
55

@@ -29,15 +29,15 @@ func useClassThatTriggersImportOfPotentiallyUnavailableOptions() {
2929
}
3030

3131
func directUseShouldStillTriggerDeprecationWarning() {
32-
_ = NSDeprecatedOptions.first // expected-warning {{'NSDeprecatedOptions' was deprecated in macOS 10.51: Use a different API}}
33-
_ = NSDeprecatedEnum.first // expected-warning {{'NSDeprecatedEnum' was deprecated in macOS 10.51: Use a different API}}
32+
_ = NSDeprecatedOptions.first // expected-warning {{'NSDeprecatedOptions' was deprecated in macOS 51: Use a different API}}
33+
_ = NSDeprecatedEnum.first // expected-warning {{'NSDeprecatedEnum' was deprecated in macOS 51: Use a different API}}
3434
}
3535

36-
func useInSignature(_ options: NSDeprecatedOptions) { // expected-warning {{'NSDeprecatedOptions' was deprecated in macOS 10.51: Use a different API}}
36+
func useInSignature(_ options: NSDeprecatedOptions) { // expected-warning {{'NSDeprecatedOptions' was deprecated in macOS 51: Use a different API}}
3737
}
3838

3939
class SuperClassWithDeprecatedInitializer {
40-
@available(OSX, introduced: 10.9, deprecated: 10.51)
40+
@available(OSX, introduced: 10.9, deprecated: 51)
4141
init() { }
4242
}
4343

@@ -49,15 +49,15 @@ class SubClassWithSynthesizedDesignedInitializerOverride : SuperClassWithDepreca
4949
}
5050

5151
func callImplicitInitializerOnSubClassWithSynthesizedDesignedInitializerOverride() {
52-
_ = SubClassWithSynthesizedDesignedInitializerOverride() // expected-warning {{'init()' was deprecated in macOS 10.51}}
52+
_ = SubClassWithSynthesizedDesignedInitializerOverride() // expected-warning {{'init()' was deprecated in macOS 51}}
5353
}
5454

55-
@available(OSX, introduced: 10.9, deprecated: 10.51)
55+
@available(OSX, introduced: 10.9, deprecated: 51)
5656
class NSDeprecatedSuperClass {
5757
var i : Int = 7 // Causes initializer to be synthesized
5858
}
5959

60-
class NotDeprecatedSubClassOfDeprecatedSuperClass : NSDeprecatedSuperClass { // expected-warning {{'NSDeprecatedSuperClass' was deprecated in macOS 10.51}}
60+
class NotDeprecatedSubClassOfDeprecatedSuperClass : NSDeprecatedSuperClass { // expected-warning {{'NSDeprecatedSuperClass' was deprecated in macOS 51}}
6161
}
6262

6363
func callImplicitInitializerOnNotDeprecatedSubClassOfDeprecatedSuperClass() {
@@ -67,21 +67,21 @@ func callImplicitInitializerOnNotDeprecatedSubClassOfDeprecatedSuperClass() {
6767
_ = NotDeprecatedSubClassOfDeprecatedSuperClass()
6868
}
6969

70-
@available(OSX, introduced: 10.9, deprecated: 10.51)
70+
@available(OSX, introduced: 10.9, deprecated: 51)
7171
class NSDeprecatedSubClassOfDeprecatedSuperClass : NSDeprecatedSuperClass {
7272
}
7373

7474
// Tests synthesis of materializeForSet
7575
class ClassWithLimitedAvailabilityAccessors {
7676
var limitedGetter: Int {
77-
@available(OSX, introduced: 10.52)
77+
@available(OSX, introduced: 52)
7878
get { return 10 }
7979
set(newVal) {}
8080
}
8181

8282
var limitedSetter: Int {
8383
get { return 10 }
84-
@available(OSX, introduced: 10.52)
84+
@available(OSX, introduced: 52)
8585
set(newVal) {}
8686
}
8787
}
@@ -103,7 +103,7 @@ func unavailableUseInUnavailableFunction() {
103103
}
104104

105105

106-
@available(OSX 10.52, *)
106+
@available(OSX 52, *)
107107
func foo() {
108108
let _ = SubOfOtherWithInit()
109109
}

test/ClangImporter/enum-with-target.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx10.51 -typecheck %s -verify
2-
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx10.52 -typecheck %s -verify
1+
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx51 -typecheck %s -verify
2+
// RUN: %swift %clang-importer-sdk -target %target-cpu-apple-macosx52 -typecheck %s -verify
33

44
// REQUIRES: OS=macosx
55
import Foundation

test/ClangImporter/objc_factory_method.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-clang-importer-objc-overlays
33

4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target %target-cpu-apple-macosx10.51 -typecheck %s -verify
4+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -target %target-cpu-apple-macosx51 -typecheck %s -verify
55

66
// REQUIRES: OS=macosx
77
// REQUIRES: objc_interop
@@ -41,27 +41,27 @@ func testFactoryWithLaterIntroducedInit() {
4141

4242
// Don't prefer more available convenience factory initializer over less
4343
// available designated initializer
44-
_ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flim:5) // expected-error {{'init(flim:)' is only available in macOS 10.52 or newer}}
44+
_ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flim:5) // expected-error {{'init(flim:)' is only available in macOS 52 or newer}}
4545
// expected-note @-1 {{add 'if #available' version check}}
4646

47-
_ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flam:5) // expected-error {{'init(flam:)' is only available in macOS 10.52 or newer}}
48-
// expected-note @-1 {{add 'if #available' version check}} {{3-63=if #available(macOS 10.52, *) {\n _ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flam:5)\n \} else {\n // Fallback on earlier versions\n \}}}
47+
_ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flam:5) // expected-error {{'init(flam:)' is only available in macOS 52 or newer}}
48+
// expected-note @-1 {{add 'if #available' version check}} {{3-63=if #available(macOS 52, *) {\n _ = NSHavingConvenienceFactoryAndLaterDesignatedInit(flam:5)\n \} else {\n // Fallback on earlier versions\n \}}}
4949

5050

5151
// Don't prefer more available factory initializer over less
5252
// available designated initializer
53-
_ = NSHavingFactoryAndLaterConvenienceInit(flim:5) // expected-error {{'init(flim:)' is only available in macOS 10.52 or newer}}
53+
_ = NSHavingFactoryAndLaterConvenienceInit(flim:5) // expected-error {{'init(flim:)' is only available in macOS 52 or newer}}
5454
// expected-note @-1 {{add 'if #available' version check}}
5555

5656

57-
_ = NSHavingFactoryAndLaterConvenienceInit(flam:5) // expected-error {{'init(flam:)' is only available in macOS 10.52 or newer}}
57+
_ = NSHavingFactoryAndLaterConvenienceInit(flam:5) // expected-error {{'init(flam:)' is only available in macOS 52 or newer}}
5858
// expected-note @-1 {{add 'if #available' version check}}
5959

6060

6161
// When both a convenience factory and a convenience initializer have the
6262
// same availability, choose the convenience initializer.
63-
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(flim:5) // expected-warning {{'init(flim:)' was deprecated in macOS 10.51: ConvenienceInit}}
64-
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(flam:5) // expected-warning {{'init(flam:)' was deprecated in macOS 10.51: ConvenienceInit}}
63+
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(flim:5) // expected-warning {{'init(flim:)' was deprecated in macOS 51: ConvenienceInit}}
64+
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(flam:5) // expected-warning {{'init(flam:)' was deprecated in macOS 51: ConvenienceInit}}
6565

6666
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(flotsam:5) // expected-warning {{'init(flotsam:)' is deprecated: ConvenienceInit}}
6767
_ = NSHavingConvenienceFactoryAndSameConvenienceInit(jetsam:5) // expected-warning {{'init(jetsam:)' is deprecated: ConvenienceInit}}

test/Concurrency/isolation_macro_availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift
1+
// RUN: %target-typecheck-verify-swift -target %target-pre-stable-abi-triple
22

33
// REQUIRES: concurrency
44
// REQUIRES: swift_swift_parser

test/Concurrency/sendable_checking.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -verify -strict-concurrency=targeted -verify-additional-prefix targeted-and-complete- -emit-sil -o /dev/null %s
2-
// RUN: %target-swift-frontend -verify -strict-concurrency=complete -verify-additional-prefix tns- -verify-additional-prefix complete-and-tns- -emit-sil -o /dev/null %s
1+
// RUN: %target-swift-frontend -target %target-swift-abi-5.0-triple -verify -strict-concurrency=targeted -verify-additional-prefix targeted-and-complete- -emit-sil -o /dev/null %s
2+
// RUN: %target-swift-frontend -target %target-swift-abi-5.0-triple -verify -strict-concurrency=complete -verify-additional-prefix tns- -verify-additional-prefix complete-and-tns- -emit-sil -o /dev/null %s
33

44
// REQUIRES: concurrency
55
// REQUIRES: asserts

test/Constraints/result_builder_availability.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50
1+
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx50
22

33
// REQUIRES: OS=macosx
44

@@ -66,43 +66,43 @@ func tuplify<T>(_ cond: Bool, @TupleBuilder body: (Bool) -> T) {
6666
@available(OSX, introduced: 10.9)
6767
func globalFuncAvailableOn10_9() -> Int { return 9 }
6868

69-
@available(OSX, introduced: 10.51)
70-
func globalFuncAvailableOn10_51() -> Int { return 10 }
69+
@available(OSX, introduced: 51)
70+
func globalFuncAvailableOn51() -> Int { return 10 }
7171

72-
@available(OSX, introduced: 10.52)
73-
struct Only10_52 { }
72+
@available(OSX, introduced: 52)
73+
struct Only52 { }
7474

75-
@available(OSX, introduced: 10.52)
76-
func globalFuncAvailableOn10_52() -> Only10_52 { .init() }
75+
@available(OSX, introduced: 52)
76+
func globalFuncAvailableOn52() -> Only52 { .init() }
7777

7878
tuplify(true) { cond in
7979
globalFuncAvailableOn10_9()
80-
if #available(OSX 10.51, *) {
81-
globalFuncAvailableOn10_51()
80+
if #available(OSX 51, *) {
81+
globalFuncAvailableOn51()
8282
tuplify(false) { cond2 in
83-
if cond, #available(OSX 10.52, *) {
83+
if cond, #available(OSX 52, *) {
8484
// expected-warning@-1{{result builder 'TupleBuilder' does not implement 'buildLimitedAvailability'; this code may crash on earlier versions of the OS}}
8585
cond2
86-
globalFuncAvailableOn10_52()
86+
globalFuncAvailableOn52()
8787
} else if true {
88-
globalFuncAvailableOn10_52() // expected-error{{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
88+
globalFuncAvailableOn52() // expected-error{{'globalFuncAvailableOn52()' is only available in macOS 52 or newer}}
8989
// expected-note@-1{{add 'if #available' version check}}
9090
} else if false {
91-
globalFuncAvailableOn10_52() // expected-error{{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
91+
globalFuncAvailableOn52() // expected-error{{'globalFuncAvailableOn52()' is only available in macOS 52 or newer}}
9292
// expected-note@-1{{add 'if #available' version check}}
9393
} else {
94-
globalFuncAvailableOn10_52() // expected-error{{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
94+
globalFuncAvailableOn52() // expected-error{{'globalFuncAvailableOn52()' is only available in macOS 52 or newer}}
9595
// expected-note@-1{{add 'if #available' version check}}
9696
}
97-
if cond, #unavailable(OSX 10.52) {
97+
if cond, #unavailable(OSX 52) {
9898
// expected-warning@-1{{result builder 'TupleBuilder' does not implement 'buildLimitedAvailability'; this code may crash on earlier versions of the OS}}
9999
cond2
100-
globalFuncAvailableOn10_52() // expected-error{{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
100+
globalFuncAvailableOn52() // expected-error{{'globalFuncAvailableOn52()' is only available in macOS 52 or newer}}
101101
// expected-note@-1{{add 'if #available' version check}}
102102
} else if true {
103-
globalFuncAvailableOn10_52()
103+
globalFuncAvailableOn52()
104104
} else if false {
105-
globalFuncAvailableOn10_52()
105+
globalFuncAvailableOn52()
106106
}
107107
}
108108
}
@@ -155,18 +155,18 @@ func tuplifyWithAvailabilityErasure<T>(_ cond: Bool, @TupleBuilderAvailability b
155155
}
156156

157157
tuplifyWithAvailabilityErasure(true) { cond in
158-
if cond, #available(OSX 10.52, *) {
159-
globalFuncAvailableOn10_52()
158+
if cond, #available(OSX 52, *) {
159+
globalFuncAvailableOn52()
160160
}
161161

162-
if cond, #unavailable(OSX 10.52) {
162+
if cond, #unavailable(OSX 52) {
163163
cond
164164
} else {
165-
globalFuncAvailableOn10_52()
165+
globalFuncAvailableOn52()
166166
}
167167

168168
// https://github.com/apple/swift/issues/63764
169-
if #unavailable(OSX 10.52) {
169+
if #unavailable(OSX 52) {
170170
cond // Ok
171171
}
172172
}

0 commit comments

Comments
 (0)