Skip to content

Commit 7589520

Browse files
committed
Make back-deployed concurrency library testable on OS's that have the library.
Change the order of paths provided for `DYLD_LIBRARY_PATH` when running tests for the back-deployed concurrency library, so they supersede the ones in `/usr/lib/swift`. This way, we can test the back-deployed concurrency library even on OS's that have the concurrency library in them. It's not a complete test, because the standard library and runtime will still vary, but can reproduce many failures more easily. When using the back-deployed concurrency library, set the lit feature `back_deploy_concurrency`. Update some tests that are unsupported with back-deployment to check this. Finally, add some logging when the concurrency runtime cannot be tested at all, to help with debugging CI in the future.
1 parent 588a1eb commit 7589520

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

test/Concurrency/Runtime/exclusivity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// REQUIRES: concurrency_runtime
77
// UNSUPPORTED: back_deployment_runtime
88
// UNSUPPORTED: OS=wasi
9-
// UNSUPPORTED: use_os_stdlib
9+
// UNSUPPORTED: back_deploy_concurrency
1010

1111
// This test makes sure that:
1212
//

test/Concurrency/Runtime/exclusivity_custom_executors.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
// rdar://76038845
77
// UNSUPPORTED: back_deployment_runtime
88
// REQUIRES: concurrency_runtime
9+
// UNSUPPORTED: back_deploy_concurrency
910

1011
// Crash expectations can't be implemented on WASI/WebAssembly.
1112
// UNSUPPORTED: OS=wasi
1213

13-
// UNSUPPORTED: use_os_stdlib
14-
1514
// This test makes sure that we properly save/restore access when we
1615
// synchronously launch a task from a serial executor. The access from the task
1716
// should be merged into the already created access set while it runs and then

test/Concurrency/async_task_base_priority.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// rdar://76038845
88
// REQUIRES: concurrency_runtime
99
// UNSUPPORTED: back_deployment_runtime
10+
// UNSUPPORTED: back_deploy_concurrency
1011

1112
import StdlibUnittest
1213
import Dispatch

test/Concurrency/async_task_priority.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// rdar://76038845
1212
// REQUIRES: concurrency_runtime
1313
// UNSUPPORTED: back_deployment_runtime
14+
// UNSUPPORTED: back_deploy_concurrency
1415

1516
import Darwin
1617
@preconcurrency import Dispatch

test/lit.cfg

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,8 @@ if back_deployment_runtime is not None:
18031803

18041804
concurrency_back_deploy_path = ''
18051805
if run_vendor == 'apple':
1806-
if 'back_deploy_concurrency' in config.available_features:
1806+
if 'back_deploy_concurrency' in lit_config.params:
1807+
config.available_features.add('back_deploy_concurrency')
18071808
concurrency_back_deploy_path = os.path.join(os.path.dirname(swift_obj_root), os.path.basename(swift_obj_root).replace("swift-", "backdeployconcurrency-"), 'lib', 'swift-5.5', run_os)
18081809

18091810
def os_stdlib_paths():
@@ -2092,6 +2093,13 @@ if 'concurrency' in config.available_features:
20922093
config.available_features.add('concurrency_runtime')
20932094
elif 'back_deploy_concurrency' in config.available_features and run_vers >= concurrency_back_deploy_version:
20942095
config.available_features.add('concurrency_runtime')
2096+
elif 'back_deploy_concurrency' in config.available_features:
2097+
print('Disabled concurrency runtime tests because run version',
2098+
run_vers, "< back deploy version",
2099+
concurrency_back_deploy_version)
2100+
else:
2101+
print('Disable concurrency runtime tests because run version',
2102+
run_vers, 'is too old and back-deployment is not enabled')
20952103
else:
20962104
config.available_features.add('concurrency_runtime')
20972105

@@ -2116,7 +2124,7 @@ elif not kIsWindows:
21162124
if 'use_os_stdlib' in lit_config.params:
21172125
config.available_features.add('use_os_stdlib')
21182126

2119-
target_stdlib_path = os_stdlib_paths() + [concurrency_back_deploy_path] + target_stdlib_path
2127+
target_stdlib_path = [concurrency_back_deploy_path] + os_stdlib_paths() + target_stdlib_path
21202128

21212129
lit_config.note('Testing with the standard libraries in the OS')
21222130
elif 'back_deployment_runtime' in lit_config.params:

0 commit comments

Comments
 (0)