Skip to content

Commit 65e6ecd

Browse files
committed
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
1 parent 4e7153c commit 65e6ecd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Tests/Functional/lit.cfg

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ config.substitutions.append(('%{xctest_checker}', '%%{python} %s' % xctest_check
143143
config.substitutions.append( ('%{python}', pipes.quote(sys.executable)) )
144144

145145
# Conditionally report the Swift 5.5 Concurrency runtime as available depending on the OS and version.
146+
# Darwin is the only platform where this is a limitation.
146147
(run_os, run_vers) = config.os_info
147-
os_is_not_macOS = run_os != 'Darwin'
148-
macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0')
149-
if os_is_not_macOS or macOS_version_is_recent_enough:
148+
if run_os == 'Darwin':
149+
assert run_vers != "", "No runtime version set."
150+
if parse_version(run_vers) >= parse_version('12.0'):
151+
config.available_features.add('concurrency_runtime')
152+
else:
153+
# Non-Darwin platforms have a concurrency runtime
150154
config.available_features.add('concurrency_runtime')
151155
if run_os == 'Windows':
152156
config.available_features.add('OS=windows')

0 commit comments

Comments
 (0)