Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment target for host tools on Darwin to macOS 10.15/iOS 13-era #63152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,16 @@ set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "/usr/lib/swift" CACHE STRING
set(SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR "@rpath" CACHE STRING
"The directory of the install_name for the private standard library dylibs")

set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.9" CACHE STRING
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.15" CACHE STRING
"Minimum deployment target version for OS X")

set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "7.0" CACHE STRING
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "13.0" CACHE STRING
"Minimum deployment target version for iOS")

set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "9.0" CACHE STRING
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "13.0" CACHE STRING
"Minimum deployment target version for tvOS")

set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "2.0" CACHE STRING
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "6.0" CACHE STRING
"Minimum deployment target version for watchOS")

#
Expand Down
6 changes: 3 additions & 3 deletions test/ClangImporter/SceneKit_test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func useRenamedValues() {
let _ = SCNSceneSource.LoadingOption.createNormalsIfAbsent
let _ = SCNSceneSource.LoadingOption.checkConsistency
let _ = SCNSceneSource.LoadingOption.flattenScene
let _ = SCNSceneSource.LoadingOption.useSafeMode
let _ = SCNSceneSource.LoadingOption.useSafeMode // expected-warning {{'useSafeMode' was deprecated in macOS 10.13: No longer supported}}
let _ = SCNSceneSource.LoadingOption.assetDirectoryURLs
let _ = SCNSceneSource.LoadingOption.overrideAssetURLs
let _ = SCNSceneSource.LoadingOption.strictConformance
Expand Down Expand Up @@ -183,8 +183,8 @@ func useRenamedAPIs(actionable: SCNActionable, action: SCNAction, data: Data,
let _ = SCNAction.playAudio(audioSource, waitForCompletion: false)

animatable.addAnimation(animation, forKey: "key")
let _ = animatable.isAnimationPaused(forKey: "key")
let _ = animatable.setAnimationSpeed(1.0, forKey: "key")
let _ = animatable.isAnimationPaused(forKey: "key") // expected-warning {{'isAnimationPaused(forKey:)' was deprecated in macOS 10.13: Use -[SCNAnimationPlayer paused] instead}}
let _ = animatable.setAnimationSpeed(1.0, forKey: "key") // expected-warning {{'setAnimationSpeed(_:forKey:)' was deprecated in macOS 10.13: Use -[SCNAnimationPlayer setSpeed:] instead}}

let _ = lookAtConstraint.isGimbalLockEnabled
let _ = SCNIKConstraint.inverseKinematicsConstraint(chainRootNode: node)
Expand Down
8 changes: 4 additions & 4 deletions test/IRGen/availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
// OPT: s10Foundation11MeasurementVySo17NSUnitTemperature

public func dontHoist() {
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
let measurement = Measurement<UnitTemperature>(value: Double(42), unit: .celsius)
print("\(measurement)")
} else {
Expand Down Expand Up @@ -49,13 +49,13 @@ public func dontHoist() {
// OPT-NOT: call {{.*}} @"$ss26_stdlib_isOSVersionAtLeastyBi1_Bw_BwBwtF"
// OPT: ret void
public func multipleAvailabilityChecks() {
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
print("test one")
}
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
print("test two")
}
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
print("test three")
}
}
3 changes: 2 additions & 1 deletion test/PrintAsObjC/resilient-ancestry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

// RUN: cp %S/Inputs/custom-modules/module.map %t/module.map

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution -target %target-cpu-apple-macosx10.13
// RUN: %FileCheck %s --check-prefix=NO-STUBS < %t/resilient.h
// RUN: %check-in-clang %t/resilient.h -I %t

// REQUIRES: objc_interop
// UNSUPPORTED: OS=iosmac
// REQUIRES: OS=macosx

// See also resilient-ancestry.swift, for the stable ABI deployment target test.

Expand Down
91 changes: 46 additions & 45 deletions test/Sema/availability_define.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// RUN: %target-typecheck-verify-swift \
// RUN: -define-availability "_iOS8Aligned:macOS 10.10, iOS 8.0" \
// RUN: -define-availability "_iOS9Aligned:macOS 10.11, iOS 9.0" \
// RUN: -define-availability "_iOS9:iOS 9.0" \
// RUN: -define-availability "_macOS10_11:macOS 10.11" \
// RUN: -define-availability "_myProject 1.0:macOS 10.11" \
// RUN: -define-availability "_myProject 2.5:macOS 10.12"
// RUN: -define-availability "_iOS13Aligned:macOS 10.15, iOS 13.0" \
// RUN: -define-availability "_iOS14Aligned:macOS 11.0, iOS 14.0" \
// RUN: -define-availability "_iOS14:iOS 14.0" \
// RUN: -define-availability "_macOS11_0:macOS 11.0" \
// RUN: -define-availability "_myProject 1.0:macOS 11.0" \
// RUN: -define-availability "_myProject 2.5:macOS 12.5"
// REQUIRES: OS=macosx

@available(_iOS8Aligned, *)
public func onMacOS10_10() {}
@available(_iOS13Aligned, *)
public func onMacOS10_15() {}

@available(_iOS9Aligned, *)
public func onMacOS10_11() {}
@available(_iOS14Aligned, *)
public func onMacOS11_0() {}

@available(_iOS9, _macOS10_11, tvOS 11.0, *)
@available(_iOS14, _macOS11_0, tvOS 14.0, *)
public func composed() {}

@available(_iOS8Aligned, *)
@available(macOS, deprecated: 10.10)
@available(_iOS13Aligned, *)
@available(macOS, deprecated: 10.15)
public func onMacOSDeprecated() {}

@available(_myProject, *) // expected-error {{expected declaration}}
Expand All @@ -42,25 +42,25 @@ public func brokenVersion() {}
// expected-error @-1 {{expected 'available' option such as 'unavailable', 'introduced', 'deprecated', 'obsoleted', 'message', or 'renamed'}}
public func unknownMacro() {}

@available(_iOS9) // expected-error {{must handle potential future platforms with '*'}}
@available(_iOS14) // expected-error {{must handle potential future platforms with '*'}}
public func noOtherOSes() {}

@available(_iOS8Aligned, *)
@available(_iOS13Aligned, *)
func client() {
onMacOS10_10()
onMacOS10_11() // expected-error {{is only available in macOS 10.11 or newer}}
onMacOS10_15()
onMacOS11_0() // expected-error {{is only available in macOS 11.0 or newer}}
// expected-note @-1 {{add 'if #available' version check}}
onMacOSDeprecated()
onMacOSDeprecated() // expected-warning {{'onMacOSDeprecated()' was deprecated in macOS 10.15}}

if #available(_iOS9Aligned, *) {
onMacOS10_11()
if #available(_iOS14Aligned, *) {
onMacOS11_0()
}

if #unavailable(_iOS9Aligned) {
onMacOS10_11() // expected-error {{is only available in macOS 10.11 or newer}}
if #unavailable(_iOS14Aligned) {
onMacOS11_0() // expected-error {{is only available in macOS 11.0 or newer}}
// expected-note @-1 {{add 'if #available' version check}}
} else {
onMacOS10_11()
onMacOS11_0()
}

if #available(_unknownMacro, *) { } // expected-error {{expected version number}}
Expand All @@ -72,39 +72,40 @@ public func doIt(_ closure: () -> ()) {

@inlinable
public func forbidMacrosInInlinableCode() {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(_iOS9, _macOS10_11, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(iOS 9.0, _macOS10_11, tvOS 9.0, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(_iOS9Aligned) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(_iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(iOS 9.0, _macOS10_11, tvOS 9.0) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(_iOS14, _macOS11_0, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(iOS 14.0, _macOS11_0, tvOS 14.0, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(_iOS14Aligned) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(_iOS14, _macOS11_0) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #unavailable(iOS 14.0, _macOS11_0, tvOS 14.0) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
doIt {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
}
}

@_alwaysEmitIntoClient
public func forbidMacrosInInlinableCode1() {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(_iOS9, _macOS10_11, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(iOS 9.0, _macOS10_11, tvOS 9.0, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(_iOS9Aligned) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(_iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(iOS 9.0, _macOS10_11, tvOS 9.0) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(_iOS14, _macOS11_0, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(iOS 14.0, _macOS11_0, tvOS 14.0, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(_iOS14Aligned) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(_iOS14, _macOS11_0) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #unavailable(iOS 14.0, _macOS11_0, tvOS 14.0) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
doIt {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
}
}

@_backDeploy(before: _iOS9Aligned)
@available(_iOS13Aligned, *)
@_backDeploy(before: _iOS14Aligned)
public func forbidMacrosInInlinableCode2() {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(_iOS9, _macOS10_11, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(iOS 9.0, _macOS10_11, tvOS 9.0, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(_iOS9Aligned) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(_iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(iOS 9.0, _macOS10_11, tvOS 9.0) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(_iOS14, _macOS11_0, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(iOS 14.0, _macOS11_0, tvOS 14.0, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(_iOS14Aligned) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(_iOS14, _macOS11_0) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #unavailable(iOS 14.0, _macOS11_0, tvOS 14.0) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
doIt {
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
if #available(_iOS14Aligned, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
}
}
10 changes: 5 additions & 5 deletions test/SymbolGraph/Symbols/Mixins/Availability/Basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// REQUIRES: OS=macosx

@available(macOS, introduced: 10.9, deprecated: 10.10, obsoleted: 10.11, message: "Everyone makes mistakes", renamed: "S2")
@available(macOS, introduced: 10.9, deprecated: 11.0, obsoleted: 18.1, message: "Everyone makes mistakes", renamed: "S2")
public struct S {}

// CHECK: "domain": "macOS"
Expand All @@ -15,12 +15,12 @@ public struct S {}
// CHECK-NEXT: "minor": 9

// CHECK: deprecated
// CHECK-NEXT: "major": 10
// CHECK-NEXT: "minor": 10
// CHECK-NEXT: "major": 11
// CHECK-NEXT: "minor": 0

// CHECK: obsoleted
// CHECK-NEXT: "major": 10
// CHECK-NEXT: "minor": 11
// CHECK-NEXT: "major": 18
// CHECK-NEXT: "minor": 1

// CHECK: "message": "Everyone makes mistakes"
// CHECK: "renamed": "S2"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// REQUIRES: OS=macosx

@available(macOS, obsoleted: 10.15)
@available(macOS, obsoleted: 11.0)
public struct S {
public func foo() {}
}
Expand All @@ -16,22 +16,22 @@ public struct S {
// CHECK-NEXT: {
// CHECK-NEXT: "domain": "macOS",
// CHECK-NEXT: "obsoleted": {
// CHECK-NEXT: "major": 10,
// CHECK-NEXT: "minor": 15
// CHECK-NEXT: "major": 11,
// CHECK-NEXT: "minor": 0
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]

@available(macOS, obsoleted: 10.15)
@available(macOS, obsoleted: 11.0)
public struct Outer {
public struct Inner {
// TRANSITIVE-LABEL: "precise": "s:16IntroducedFilled5OuterV5InnerV3fooyyF"
// TRANSITIVE: "availability": [
// TRANSITIVE-NEXT: {
// TRANSITIVE-NEXT: "domain": "macOS",
// TRANSITIVE-NEXT: "obsoleted": {
// TRANSITIVE-NEXT: "major": 10,
// TRANSITIVE-NEXT: "minor": 15
// TRANSITIVE-NEXT: "major": 11,
// TRANSITIVE-NEXT: "minor": 0
// TRANSITIVE-NEXT: }
// TRANSITIVE-NEXT: }
// TRANSITIVE-NEXT: ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,88 +10,88 @@

// REQUIRES: OS=macosx

@available(macOS, obsoleted: 10.14)
@available(macOS, obsoleted: 18.14)
public struct S {
// LESSTHAN-LABEL: "precise": "s:17ObsoletedReplaced1SV8lessThanyyF",
// LESSTHAN: "availability": [
// LESSTHAN-NEXT: {
// LESSTHAN-NEXT: "domain": "macOS",
// LESSTHAN-NEXT: "obsoleted": {
// LESSTHAN-NEXT: "major": 10,
// LESSTHAN-NEXT: "major": 18,
// LESSTHAN-NEXT: "minor": 10
// LESSTHAN-NEXT: }
// LESSTHAN-NEXT: }
// LESSTHAN-NEXT: ]
@available(macOS, obsoleted: 10.10)
@available(macOS, obsoleted: 18.10)
public func lessThan() {}

// GREATERTHAN-LABEL: "precise": "s:17ObsoletedReplaced1SV11greaterThanyyF",
// GREATERTHAN: "availability": [
// GREATERTHAN-NEXT: {
// GREATERTHAN-NEXT: "domain": "macOS",
// GREATERTHAN-NEXT: "obsoleted": {
// GREATERTHAN-NEXT: "major": 10,
// GREATERTHAN-NEXT: "major": 18,
// GREATERTHAN-NEXT: "minor": 14
// GREATERTHAN-NEXT: }
// GREATERTHAN-NEXT: }
// GREATERTHAN-NEXT: ]
@available(macOS, obsoleted: 10.15)
@available(macOS, obsoleted: 18.15)
public func greaterThan() {}

// EQUAL-LABEL: "precise": "s:17ObsoletedReplaced1SV5equalyyF",
// EQUAL: "availability": [
// EQUAL-NEXT: {
// EQUAL-NEXT: "domain": "macOS",
// EQUAL-NEXT: "obsoleted": {
// EQUAL-NEXT: "major": 10,
// EQUAL-NEXT: "major": 18,
// EQUAL-NEXT: "minor": 14
// EQUAL-NEXT: }
// EQUAL-NEXT: }
// EQUAL-NEXT: ]
@available(macOS, obsoleted: 10.14)
@available(macOS, obsoleted: 18.14)
public func equal() {}
}

@available(macOS, obsoleted: 10.14)
@available(macOS, obsoleted: 18.14)
public struct Outer {
public struct Inner {
// TRANSITIVELESSTHAN-LABEL: "precise": "s:17ObsoletedReplaced5OuterV5InnerV8lessThanyyF"
// TRANSITIVELESSTHAN: "availability": [
// TRANSITIVELESSTHAN-NEXT: {
// TRANSITIVELESSTHAN-NEXT: "domain": "macOS",
// TRANSITIVELESSTHAN-NEXT: "obsoleted": {
// TRANSITIVELESSTHAN-NEXT: "major": 10,
// TRANSITIVELESSTHAN-NEXT: "major": 18,
// TRANSITIVELESSTHAN-NEXT: "minor": 10
// TRANSITIVELESSTHAN-NEXT: }
// TRANSITIVELESSTHAN-NEXT: }
// TRANSITIVELESSTHAN-NEXT: ]
@available(macOS, obsoleted: 10.10)
@available(macOS, obsoleted: 18.10)
public func lessThan() {}

// TRANSITIVEGREATERTHAN-LABEL:"precise": "s:17ObsoletedReplaced5OuterV5InnerV11greaterThanyyF"
// TRANSITIVEGREATERTHAN: "availability": [
// TRANSITIVEGREATERTHAN-NEXT: {
// TRANSITIVEGREATERTHAN-NEXT: "domain": "macOS",
// TRANSITIVEGREATERTHAN-NEXT: "obsoleted": {
// TRANSITIVEGREATERTHAN-NEXT: "major": 10,
// TRANSITIVEGREATERTHAN-NEXT: "major": 18,
// TRANSITIVEGREATERTHAN-NEXT: "minor": 14
// TRANSITIVEGREATERTHAN-NEXT: }
// TRANSITIVEGREATERTHAN-NEXT: }
// TRANSITIVEGREATERTHAN-NEXT: ]
@available(macOS, obsoleted: 10.15)
@available(macOS, obsoleted: 18.15)
public func greaterThan() {}

// TRANSITIVEEQUAL-LABEL:"precise": "s:17ObsoletedReplaced5OuterV5InnerV5equalyyF"
// TRANSITIVEEQUAL: "availability": [
// TRANSITIVEEQUAL-NEXT: {
// TRANSITIVEEQUAL-NEXT: "domain": "macOS",
// TRANSITIVEEQUAL-NEXT: "obsoleted": {
// TRANSITIVEEQUAL-NEXT: "major": 10,
// TRANSITIVEEQUAL-NEXT: "major": 18,
// TRANSITIVEEQUAL-NEXT: "minor": 14
// TRANSITIVEEQUAL-NEXT: }
// TRANSITIVEEQUAL-NEXT: }
// TRANSITIVEEQUAL-NEXT: ]
@available(macOS, obsoleted: 10.14)
@available(macOS, obsoleted: 18.14)
public func equal() {}
}
}
Expand Down
Loading