Skip to content

[5.10] Remove @_implementationOnly annotations #2430

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 20, 2024

  • Explanation: Building swift-syntax with a Swift 5.10 compiler produces warnings that “Using '@_implementationOnly' without enabling library evolution for 'SwiftSyntax' may lead to instability during execution”. We want swift-syntax to build without warnings. To fix this, remove the @_implementationOnly annotations and replace them with private import if the host compiler is Swift ≥5.11.
  • Scope: @_implementationOnly imports of Foundation-like modules in SwiftSyntaxCompilerPlugin and SwiftSyntax
  • Risk: Any issues from this would be found at build time
  • Testing: Tested that swift-syntax still builds and tests pass.
  • Issue: rdar://115910675
  • Reviewer: @rintaro on Remove @_implementationOnly annotations #2429

@ahoppen ahoppen requested review from rintaro and bnbarham January 20, 2024 23:14
@ahoppen ahoppen changed the title Remove @_implementationOnly annotations [5.10] Remove @_implementationOnly annotations Jan 20, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Jan 20, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/5.10/implementation-only branch from 0681e4d to 49c2d71 Compare January 21, 2024 02:05
@ahoppen
Copy link
Member Author

ahoppen commented Jan 21, 2024

@swift-ci Please test

These annotations produce warnings when compiling swift-syntax without library evolution using Swift ≥5.10.

Replace them by `private import` when compiling using Swift ≥5.11.

Also mark the import of XCTest from `SwiftSyntaxMacrosTestSupport` as `private`, fixing rdar://119517162.

rdar://119517162
@ahoppen ahoppen force-pushed the ahoppen/5.10/implementation-only branch from 49c2d71 to 5215d23 Compare January 21, 2024 03:22
@ahoppen
Copy link
Member Author

ahoppen commented Jan 21, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jan 21, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 06e1c21 into swiftlang:release/5.10 Jan 24, 2024
@ahoppen ahoppen deleted the ahoppen/5.10/implementation-only branch January 24, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants