The Swift Package Index logo.Swift Package Index

Track the adoption of Swift 6 strict concurrency checks for data race safety. How many packages are Ready for Swift 6?

Build Information

Successful build of SLLog, reference master (d8cded), with Swift 6.0 for Linux on 28 Nov 2024 05:42:33 UTC.

Swift 6 data race errors: 3

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.58.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/shial4/LogSwift.git
Reference: master
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/shial4/LogSwift
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at d8cded7 Update scheme
Cloned https://github.com/shial4/LogSwift.git
Revision (git rev-parse @):
d8cded7fa03270655bee79304cdabb4a341027f9
SUCCESS checkout https://github.com/shial4/LogSwift.git at master
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $PWD
https://github.com/shial4/LogSwift.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/8] Compiling SLLog SLLogFile.swift
/host/spi-builder-workspace/Sources/SLLog/SLLogFile.swift:61:36: warning: capture of 'self' with non-sendable type 'SLLogFile?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  9 | import Dispatch
 10 |
 11 | public class SLLogFile {
    |              `- note: class 'SLLogFile' does not conform to the 'Sendable' protocol
 12 |     struct LogObject: Codable {
 13 |         let d: String
    :
 59 |     public func addEntry(level: SLLog.LogType, occurrence: Occurrence, message: Any) {
 60 |         queue.addOperation { [weak self] in
 61 |             guard let strongSelf = self else { return }
    |                                    `- warning: capture of 'self' with non-sendable type 'SLLogFile?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 62 |             guard let path = strongSelf.filePath else { return }
 63 |             do {
/host/spi-builder-workspace/Sources/SLLog/SLLogFile.swift:64:64: warning: capture of 'message' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 62 |             guard let path = strongSelf.filePath else { return }
 63 |             do {
 64 |                 let data = try strongSelf.buildObject(message: message, level: level, occurrence: occurrence)
    |                                                                `- warning: capture of 'message' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 65 |                 if FileManager.default.fileExists(atPath: path) {
 66 |                     strongSelf.appendEntry(data, path: path)
/host/spi-builder-workspace/Sources/SLLog/SLLogFile.swift:64:80: warning: capture of 'level' with non-sendable type 'SLLog.LogType' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 62 |             guard let path = strongSelf.filePath else { return }
 63 |             do {
 64 |                 let data = try strongSelf.buildObject(message: message, level: level, occurrence: occurrence)
    |                                                                                `- warning: capture of 'level' with non-sendable type 'SLLog.LogType' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 65 |                 if FileManager.default.fileExists(atPath: path) {
 66 |                     strongSelf.appendEntry(data, path: path)
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:54:10: note: consider making enum 'LogType' conform to the 'Sendable' protocol
52 |
53 | public extension SLLog {
54 |     enum LogType: Int, CustomStringConvertible {
   |          `- note: consider making enum 'LogType' conform to the 'Sendable' protocol
55 |         public var description: String {
56 |             switch self {
/host/spi-builder-workspace/Sources/SLLog/SLLogFile.swift:80:29: warning: result of call to 'createFile(atPath:contents:attributes:)' is unused
 78 |             files.append(file)
 79 |         }
 80 |         FileManager.default.createFile(atPath: path, contents: SLLogFile.openArray + data + SLLogFile.comma + SLLogFile.closeArray)
    |                             `- warning: result of call to 'createFile(atPath:contents:attributes:)' is unused
 81 |         fileHandle?.closeFile()
 82 |         fileHandle = FileHandle(forWritingAtPath: path)
/host/spi-builder-workspace/Sources/SLLog/SLLogFile.swift:121:35: warning: capture of 'self' with non-sendable type 'SLLogFile' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  9 | import Dispatch
 10 |
 11 | public class SLLogFile {
    |              `- note: class 'SLLogFile' does not conform to the 'Sendable' protocol
 12 |     struct LogObject: Codable {
 13 |         let d: String
    :
119 |     private func removeFile(_ files: [String]) {
120 |         DispatchQueue.global().async {
121 |             files.forEach { [weak self] in
    |                                   `- warning: capture of 'self' with non-sendable type 'SLLogFile' in a `@Sendable` closure; this is an error in the Swift 6 language mode
122 |                 guard let path = self?.path else { return }
123 |                 let file: String = "\(path)/\($0)"
[4/8] Compiling SLLog SLLogConsole.swift
[5/8] Compiling SLLog SLLog.swift
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:25:36: warning: static property 'providers' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
23 |
24 | public class SLLog {
25 |     public private(set) static var providers: [LogProvider] = []
   |                                    |- warning: static property 'providers' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'providers' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'providers' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
26 |     public private(set) static var targets: [LogHandler] = []
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:26:36: warning: static property 'targets' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
24 | public class SLLog {
25 |     public private(set) static var providers: [LogProvider] = []
26 |     public private(set) static var targets: [LogHandler] = []
   |                                    |- warning: static property 'targets' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'targets' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'targets' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
28 |                                                                              timeZone: "UTC",
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:27:36: warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
25 |     public private(set) static var providers: [LogProvider] = []
26 |     public private(set) static var targets: [LogHandler] = []
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
   |                                    |- warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'dateFormat' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'dateFormat' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 |                                                                              timeZone: "UTC",
29 |                                                                              locale: "en_US_POSIX")
[6/8] Compiling SLLog Log.swift
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:27:36: warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
25 |     public private(set) static var providers: [LogProvider] = []
26 |     public private(set) static var targets: [LogHandler] = []
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
   |                                    |- warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'dateFormat' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'dateFormat' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 |                                                                              timeZone: "UTC",
29 |                                                                              locale: "en_US_POSIX")
[7/8] Emitting module SLLog
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:25:36: warning: static property 'providers' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
23 |
24 | public class SLLog {
25 |     public private(set) static var providers: [LogProvider] = []
   |                                    |- warning: static property 'providers' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'providers' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'providers' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
26 |     public private(set) static var targets: [LogHandler] = []
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:26:36: warning: static property 'targets' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
24 | public class SLLog {
25 |     public private(set) static var providers: [LogProvider] = []
26 |     public private(set) static var targets: [LogHandler] = []
   |                                    |- warning: static property 'targets' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'targets' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'targets' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
28 |                                                                              timeZone: "UTC",
/host/spi-builder-workspace/Sources/SLLog/SLLog.swift:27:36: warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
25 |     public private(set) static var providers: [LogProvider] = []
26 |     public private(set) static var targets: [LogHandler] = []
27 |     public private(set) static var dateFormat: DateFormatter = DateFormatter(dateFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
   |                                    |- warning: static property 'dateFormat' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                                    |- note: convert 'dateFormat' to a 'let' constant to make 'Sendable' shared state immutable
   |                                    |- note: annotate 'dateFormat' with '@MainActor' if property should only be accessed from the main actor
   |                                    `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 |                                                                              timeZone: "UTC",
29 |                                                                              locale: "en_US_POSIX")
[8/8] Compiling SLLog DateFormatterExtension.swift
Build complete! (9.83s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "SLLog",
  "name" : "SLLog",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "SLLog",
      "targets" : [
        "SLLog"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "SLLogTests",
      "module_type" : "SwiftTarget",
      "name" : "SLLogTests",
      "path" : "Tests/SLLogTests",
      "sources" : [
        "SLLogConsoleTests.swift",
        "SLLogFileTests.swift",
        "SLLogTests.swift"
      ],
      "target_dependencies" : [
        "SLLog"
      ],
      "type" : "test"
    },
    {
      "c99name" : "SLLog",
      "module_type" : "SwiftTarget",
      "name" : "SLLog",
      "path" : "Sources/SLLog",
      "product_memberships" : [
        "SLLog"
      ],
      "sources" : [
        "Extensions/DateFormatterExtension.swift",
        "Log.swift",
        "SLLog.swift",
        "SLLogConsole.swift",
        "SLLogFile.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Done.