Skip to content

Commit 15e7238

Browse files
committed
lit.cfg: copy compatibility span dylib when appropriate on Darwin
This supports back deployment bots. Addresses rdar://155841483
1 parent 9d7d3a1 commit 15e7238

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/lit.cfg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,40 @@ if run_vendor == 'apple':
23032303
if not os.path.isdir(concurrency_back_deploy_path):
23042304
lit_config.fatal(f"Concurrency back deploy libraries not found at {concurrency_back_deploy_path}")
23052305

2306+
compatibility_span_back_deploy_path = ''
2307+
if run_vendor == 'apple':
2308+
COMPATIBILITY_SPAN_BACK_DEPLOY_EARLIEST_VERSIONS = {
2309+
'macosx': '10.14.4',
2310+
'ios': '12.2',
2311+
'maccatalyst': '13.1',
2312+
'tvos': '12.2',
2313+
'watchos': '5.2',
2314+
'xros': '1.0',
2315+
}
2316+
2317+
compatibility_span_back_deploy_version = tuple(
2318+
int(component) for component
2319+
in COMPATIBILITY_SPAN_BACK_DEPLOY_EARLIEST_VERSIONS.get(run_os, '').split('.'))
2320+
2321+
tuple_run_vers=tuple(int(component) for component in run_vers.split('.'))
2322+
2323+
if tuple_run_vers >= compatibility_span_back_deploy_version and tuple_run_vers < (26,):
2324+
config.available_features.add('back_deploy_compatibility_span')
2325+
toolchain_swiftc_path = subprocess.check_output(['xcrun', '--find', 'swiftc']).rstrip().decode('utf-8')
2326+
compatibility_span_back_deploy_path = os.path.join(
2327+
os.path.dirname(toolchain_swiftc_path), '..',
2328+
'lib', 'swift-6.2', xcrun_sdk_name)
2329+
if not os.path.isdir(compatibility_span_back_deploy_path):
2330+
lit_config.warning(
2331+
"Compatibility span back deploy libraries not found at "
2332+
f"{compatibility_span_back_deploy_path}. Falling back to local build...")
2333+
compatibility_span_back_deploy_path = os.path.join(
2334+
swift_obj_root, 'lib', 'swift-6.2', xcrun_sdk_name)
2335+
if not os.path.isdir(compatibility_span_back_deploy_path):
2336+
lit_config.fatal(
2337+
"Compatibility span back deploy libraries "
2338+
f"not found at {compatibility_span_back_deploy_path}")
2339+
23062340
backtracer_path = make_path(config.swift_libexec_dir, 'swift',
23072341
config.target_sdk_name, 'swift-backtrace')
23082342
config.substitutions.append(('%backtracer', backtracer_path))
@@ -2391,6 +2425,9 @@ def configure_remote_run():
23912425
if concurrency_back_deploy_path and 'use_os_stdlib' in lit_config.params:
23922426
upload_dylibs(concurrency_back_deploy_path)
23932427

2428+
if compatibility_span_back_deploy_path and 'use_os_stdlib' in lit_config.params:
2429+
upload_dylibs(compatibility_span_back_deploy_path)
2430+
23942431
# FIXME: Uploading specific files in bin/ is not very scalable.
23952432
local_swift_reflection_test = lit.util.which(
23962433
swift_reflection_test_name, config.environment['PATH'])

0 commit comments

Comments
 (0)