Skip to content

Add two Sendable annotations to enable building SourceKit-LSP in Swift 6 mode #7559

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 May 14, 2024

  • Explanation: Mark FileRuleDescription and Platform as Sendable and make Platform.current a constant. This allows us to build SourceKit-LSP in Swift 6 mode
  • Scope: FileRuleDescription and Platform if SwiftPM is used as a library
  • Risk: Very low, adding Sendable conformances is safe and I don’t expect anyone to modify Platform.current
  • Testing: Verified that this helps us build SourceKit-LSP in Swift 6 mode
  • Issue: n/a
  • Reviewer: @xedin on Add two Sendable annotations to enable building SourceKit-LSP in Swift 6 mode #7553

ahoppen added 2 commits May 14, 2024 08:34
This allows us to build `SourceKitLSP` in Swift 6 mode.
This allows us to build `SourceKitLSP` in Swift 6 mode.
@ahoppen ahoppen added the swift 6.0 Related to Swift 6.0 release branch label May 14, 2024
Comment on lines -37 to -38
// This is not just a computed property because the ToolchainRegistryTests
// change the value.
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this comment wasn't true 😅? If that's the case though, can it just be a computed property?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was, ToolchainRegistryTests is in SourceKit-LSP: swiftlang/sourcekit-lsp#1276 (comment)

I prefer it to be stored so we don’t re-run uname every time the variable is accessed.

@@ -563,7 +563,7 @@ public struct TargetSourcesBuilder {
}

/// Describes a rule for including a source or resource file in a target.
public struct FileRuleDescription {
public struct FileRuleDescription: Sendable {
Copy link
Contributor

@giginet giginet May 15, 2024

Choose a reason for hiding this comment

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

Don't we need FileRuleDescription.Rule to conform to Sendable?
Because it is public.

Copy link
Member Author

Choose a reason for hiding this comment

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

This change is trying to be minimal to get SourceKit-LSP building in Swift 6 mode. Adding proper Sendable annotations to SwiftPM wherever sensible is not a goal of this PR.

@ahoppen
Copy link
Member Author

ahoppen commented May 15, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 15, 2024

@swift-ci Please test Linux

@ahoppen ahoppen merged commit 3956d24 into swiftlang:release/6.0 May 15, 2024
5 checks passed
@ahoppen ahoppen deleted the 6.0/file-rule-description-sendable branch May 15, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 6.0 Related to Swift 6.0 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants