Skip to content

Commit 50a0403

Browse files
authored
Merge pull request swiftlang#28098 from brentdax/a-link-to-the-past-5.1
[5.1] Fix flaky Driver tests
2 parents 70cb3ca + 29e9502 commit 50a0403

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/lit.cfg

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,9 +1422,17 @@ if hasattr(config, 'target_cc_options'):
14221422
else:
14231423
config.substitutions.append(('%target-cc-options', ''))
14241424

1425-
config.substitutions.append(
1426-
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1427-
SubstituteCaptures(r'ln \1 \2 || cp \1 \2')))
1425+
# WORKAROUND(rdar://53507844): On some macOS versions, we see flaky failures in
1426+
# tests which create a hard link to an executable and immediately invoke it.
1427+
# Work around this by always copying on Darwin.
1428+
if platform.system() == 'Darwin':
1429+
config.substitutions.append(
1430+
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1431+
SubstituteCaptures(r'cp \1 \2')))
1432+
else:
1433+
config.substitutions.append(
1434+
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1435+
SubstituteCaptures(r'ln \1 \2 || cp \1 \2')))
14281436

14291437
config.substitutions.append(('%utils', config.swift_utils))
14301438
config.substitutions.append(('%line-directive', '%r %s' % (sys.executable, config.line_directive)))

0 commit comments

Comments
 (0)