Skip to content

Work around a bug in the older Swift compiler used to build swift-syntax in the toolchain, which affected certain result builder APIs #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

stmontgomery
Copy link
Contributor

This works around a bug which was identified while working towards adding swift-testing to Swift toolchains. See the code comment for a more detailed explanation.

Modifications:

Use a different variant of this swift-syntax API in our macro plugin to avoid the bug.

Result:

Building in the toolchain avoids the failure this was causing.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…tax in the toolchain, which affected certain result builder APIs
@stmontgomery stmontgomery added workaround Workaround for an issue in another component (may need to revert later) build 🧱 Affects the project's build configuration or process labels Jul 16, 2024
@stmontgomery stmontgomery self-assigned this Jul 16, 2024
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor

Booooourns

}
}
//
// Intentionally avoid using the result builder variant of these APIs due to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a swift-syntax or swift PR/issue you can point to here? For future reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nobody involved in the investigation was sure what exactly the problem was, but in any event, the bug itself has long been fixed. We believe it was fixed in Swift 5.10. The problem is Swift's CI, in this case at least, is building some early dependencies using Swift 5.9 or earlier (intentionally), and that compiler had the bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty. And the bug only affected this use of a result builder? How strange!

@stmontgomery stmontgomery merged commit 3894ad3 into swiftlang:main Jul 16, 2024
3 checks passed
@stmontgomery stmontgomery deleted the swift-syntax-workaround branch July 16, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build 🧱 Affects the project's build configuration or process workaround Workaround for an issue in another component (may need to revert later)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants