From 448543b31154238d2cf4201b4922e39618af6f5b Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Mon, 24 Jun 2024 11:52:43 -0700 Subject: [PATCH 1/2] [6.0] Add new include path into Foundation when building tests --- Tests/Functional/lit.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Functional/lit.cfg b/Tests/Functional/lit.cfg index 78d6e1d9..d48a5129 100644 --- a/Tests/Functional/lit.cfg +++ b/Tests/Functional/lit.cfg @@ -99,6 +99,7 @@ else: '-L', os.path.join(foundation_dir, 'lib'), '-I', foundation_dir, '-I', os.path.join(foundation_dir, 'swift'), + '-I', os.path.join(foundation_dir, '_CModulesForClients'), '-Xcc', '-F', '-Xcc', foundation_dir, ]) From a66a9b22606301bb9beb0feef20a4902717a0737 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Thu, 23 May 2024 22:37:46 -0700 Subject: [PATCH 2/2] Guard parse_version The most recent versions of `parse_version` throw an exception if the version is empty. The version passed in is only set on Darwin (call to `mac_ver()`, so it's causing test failures on newer versions of Linux since the test suite can't even start. Now, the only reason for the version parse is because the tests are looking at whether or not concurrency is available on the OS. This is only a limitation if we're working with Darwin. Swift 5.10 on Windows and Linux always have a Swift 5.10 concurrency runtime, so we don't even need to check for a version. rdar://128502662 (cherry picked from commit 65e6ecdce29101129911c49760b0f85ac18d21e5) (cherry picked from commit f26bc2138b8cd8f73317d7b7c019bf016ca5bc33) --- Tests/Functional/lit.cfg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/Functional/lit.cfg b/Tests/Functional/lit.cfg index d48a5129..105fb5c1 100644 --- a/Tests/Functional/lit.cfg +++ b/Tests/Functional/lit.cfg @@ -144,10 +144,14 @@ config.substitutions.append(('%{xctest_checker}', '%%{python} %s' % xctest_check config.substitutions.append( ('%{python}', pipes.quote(sys.executable)) ) # Conditionally report the Swift 5.5 Concurrency runtime as available depending on the OS and version. +# Darwin is the only platform where this is a limitation. (run_os, run_vers) = config.os_info -os_is_not_macOS = run_os != 'Darwin' -macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0') -if os_is_not_macOS or macOS_version_is_recent_enough: +if run_os == 'Darwin': + assert run_vers != "", "No runtime version set." + if parse_version(run_vers) >= parse_version('12.0'): + config.available_features.add('concurrency_runtime') +else: + # Non-Darwin platforms have a concurrency runtime config.available_features.add('concurrency_runtime') if run_os == 'Windows': config.available_features.add('OS=windows')