Skip to content

Commit a231d9c

Browse files
ahoppenfurby-tm
authored andcommitted
Add two Sendable annotations to enable building SourceKit-LSP in Swift 6 mode (swiftlang#7553)
- Mark `FileRuleDescription` as `Sendable` - Make `Platform` sendable and make `Platform.current` a constant
1 parent 3ef46d0 commit a231d9c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Sources/PackageLoading/Platform.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,21 @@ private func isAndroid() -> Bool {
2020
(try? localFileSystem.isFile(AbsolutePath(validating: "/system/bin/toybox"))) ?? false
2121
}
2222

23-
public enum Platform: Equatable {
23+
public enum Platform: Equatable, Sendable {
2424
case android
2525
case darwin
2626
case linux(LinuxFlavor)
2727
case windows
2828

2929
/// Recognized flavors of linux.
30-
public enum LinuxFlavor: Equatable {
30+
public enum LinuxFlavor: Equatable, Sendable {
3131
case debian
3232
case fedora
3333
}
3434
}
3535

3636
extension Platform {
37-
// This is not just a computed property because the ToolchainRegistryTests
38-
// change the value.
39-
public static var current: Platform? = {
37+
public static let current: Platform? = {
4038
#if os(Windows)
4139
return .windows
4240
#else

Sources/PackageLoading/TargetSourcesBuilder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public struct TargetSourcesBuilder {
563563
}
564564

565565
/// Describes a rule for including a source or resource file in a target.
566-
public struct FileRuleDescription {
566+
public struct FileRuleDescription: Sendable {
567567
/// A rule semantically describes a file/directory in a target.
568568
///
569569
/// It is up to the build system to translate a rule into a build command.

0 commit comments

Comments
 (0)