Skip to content

Commit 2f3f979

Browse files
committed
[5.7][Test] Fix protocol_conformance_collision.swift.
Use 2021 OS versions instead of far-future OS versions. We have versions with the fix now, so we don't need the far-future versions. Using them breaks things when building against a newer SDK and running on an older OS, because the system assumes stuff on the newer OS is available when it isn't. (cherry picked from commit 1220321)
1 parent 85bad4f commit 2f3f979

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

test/Runtime/protocol_conformance_collision.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift %s -o %t/newSDK %target-link-sdk-future-version
2+
// RUN: %target-build-swift %s -o %t/newSDK %target-link-sdk-2021-version
33
// RUN: %target-codesign %t/newSDK
44
// RUN: %target-run %t/newSDK newSDK
55
// RUN: %target-build-swift %s -o %t/oldSDK %target-link-sdk-2020-version

test/lit.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,14 @@ if run_vendor == 'apple':
13071307
'watchos': '7.0'
13081308
}
13091309
sdk_2020_version = SDK_2020_VERSION.get(run_os, '')
1310+
SDK_2021_VERSION = {
1311+
'macosx': '12.0',
1312+
'ios': '15.0',
1313+
'maccatalyst': '15.0',
1314+
'tvos': '15.0',
1315+
'watchos': '8.0'
1316+
}
1317+
sdk_2021_version = SDK_2021_VERSION.get(run_os, '')
13101318
linker_os = {
13111319
'iphoneos': 'ios',
13121320
'appletvos': 'tvos',
@@ -1320,6 +1328,9 @@ if run_vendor == 'apple':
13201328
config.target_link_sdk_2020_version = (
13211329
"-Xlinker -platform_version -Xlinker %s -Xlinker %s -Xlinker %s" %
13221330
(linker_os, sdk_2020_version, sdk_2020_version))
1331+
config.target_link_sdk_2021_version = (
1332+
"-Xlinker -platform_version -Xlinker %s -Xlinker %s -Xlinker %s" %
1333+
(linker_os, sdk_2021_version, sdk_2021_version))
13231334
config.target_link_sdk_future_version = (
13241335
"-Xlinker -platform_version -Xlinker %s -Xlinker %s -Xlinker %s" %
13251336
(linker_os, target_future_version, target_future_version))
@@ -2433,6 +2444,9 @@ if hasattr(config, 'otool_classic'):
24332444
if hasattr(config, 'target_link_sdk_2020_version'):
24342445
config.substitutions.append(('%target-link-sdk-2020-version',
24352446
config.target_link_sdk_2020_version))
2447+
if hasattr(config, 'target_link_sdk_2021_version'):
2448+
config.substitutions.append(('%target-link-sdk-2021-version',
2449+
config.target_link_sdk_2021_version))
24362450
if hasattr(config, 'target_link_sdk_future_version'):
24372451
config.substitutions.append(('%target-link-sdk-future-version',
24382452
config.target_link_sdk_future_version))

0 commit comments

Comments
 (0)