Work around compiler bug affecting macro decls with #if-guarded availability when building w/legacy driver #1106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This works around a Swift compiler bug which causes a failure validating the generated .swiftinterface of the
Testingmodule due to it having macro declarations with#if-conditionalized@available(...)attributes before any other@-attributes.The PR which recently landed to enable the Exit Tests feature (#324) revealed this compiler bug — specifically, that PR removed
@_spiattributes which until then preceded#if SWT_NO_EXIT_TESTS. The workaround is to move other attributes on the affected macro declarations up before the#if.The compiler bug is being fixed in swiftlang/swift#81346. It only appears to happen when building with the legacy driver, and Android uses that driver still. An example CI failure log can be found here:
Checklist: