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 DataCache, reference master (bcb54d), with Swift 6.1 for macOS (SPM) on 27 Apr 2025 10:54:31 UTC.

Swift 6 data race errors: 1

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -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

Build Log

========================================
RunAll
========================================
Builder version: 4.61.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/huynguyencong/DataCache.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/huynguyencong/DataCache
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at bcb54d3 Update Podspec tag and package iOS version
Cloned https://github.com/huynguyencong/DataCache.git
Revision (git rev-parse @):
bcb54d313a6ab16fc3f8fa5884ec0f5f331c6ae3
SUCCESS checkout https://github.com/huynguyencong/DataCache.git at master
========================================
ResolveProductDependencies
========================================
Resolving dependencies ...
{
  "identity": ".resolve-product-dependencies",
  "name": "resolve-dependencies",
  "url": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "version": "unspecified",
  "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "dependencies": [
    {
      "identity": "datacache",
      "name": "DataCache",
      "url": "https://github.com/huynguyencong/DataCache.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/DataCache",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/huynguyencong/DataCache.git
[1/445] Fetching datacache
Fetched https://github.com/huynguyencong/DataCache.git from cache (0.71s)
Creating working copy for https://github.com/huynguyencong/DataCache.git
Working copy of https://github.com/huynguyencong/DataCache.git resolved at master (bcb54d3)
warning: '.resolve-product-dependencies': dependency 'datacache' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/huynguyencong/DataCache.git
https://github.com/huynguyencong/DataCache.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "DataCache",
  "name" : "DataCache",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.11"
    },
    {
      "name" : "ios",
      "version" : "13.0"
    }
  ],
  "products" : [
    {
      "name" : "DataCache",
      "targets" : [
        "DataCache"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "DataCache",
      "module_type" : "SwiftTarget",
      "name" : "DataCache",
      "path" : "Sources",
      "product_memberships" : [
        "DataCache"
      ],
      "sources" : [
        "DataCache.swift",
        "Dictionary+Cache.swift",
        "String+MD5.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -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
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-2F0A5646E1D333AE.txt
[3/6] Compiling DataCache String+MD5.swift
[4/6] Compiling DataCache Dictionary+Cache.swift
[5/6] Emitting module DataCache
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:24:23: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'DataCache' may have shared mutable state; this is an error in the Swift 6 language mode
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
 22 |     static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7         // a week
 23 |
 24 |     public static let instance = DataCache(name: "default")
    |                       |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'DataCache' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: add '@MainActor' to make static property 'instance' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 25 |
 26 |     let cachePath: String
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
301 |      - parameter completionHandler: Called after the operation completes.
302 |      */
303 |     open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
    |     `- warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
304 |
305 |         // Do things in cocurrent io queue
[6/6] Compiling DataCache DataCache.swift
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:24:23: warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'DataCache' may have shared mutable state; this is an error in the Swift 6 language mode
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
 22 |     static let defaultMaxCachePeriodInSecond: TimeInterval = 60 * 60 * 24 * 7         // a week
 23 |
 24 |     public static let instance = DataCache(name: "default")
    |                       |- warning: static property 'instance' is not concurrency-safe because non-'Sendable' type 'DataCache' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: add '@MainActor' to make static property 'instance' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 25 |
 26 |     let cachePath: String
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:303:5: warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
301 |      - parameter completionHandler: Called after the operation completes.
302 |      */
303 |     open func cleanExpiredDiskCache(completion handler: (()->())? = nil) {
    |     `- warning: non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
304 |
305 |         // Do things in cocurrent io queue
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:76:16: warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
    :
 74 |     private func writeDataToDisk(data: Data, key: String) {
 75 |         ioQueue.async {
 76 |             if self.fileManager.fileExists(atPath: self.cachePath) == false {
    |                `- warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
 77 |                 do {
 78 |                     try self.fileManager.createDirectory(atPath: self.cachePath, withIntermediateDirectories: true, attributes: nil)
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:271:21: warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
    :
269 |         ioQueue.async {
270 |             do {
271 |                 try self.fileManager.removeItem(atPath: self.cachePath(forKey: key))
    |                     `- warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
272 |             } catch {
273 |                 print("DataCache: Error while remove file: \(error.localizedDescription)")
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:285:21: warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
    :
283 |         ioQueue.async {
284 |             do {
285 |                 try self.fileManager.removeItem(atPath: self.cachePath)
    |                     `- warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
286 |             } catch {
287 |                 print("DataCache: Error when clean disk: \(error.localizedDescription)")
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:308:62: warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
    :
306 |         ioQueue.async {
307 |
308 |             var (URLsToDelete, diskCacheSize, cachedFiles) = self.travelCachedFiles(onlyForCacheSize: false)
    |                                                              `- warning: capture of 'self' with non-sendable type 'DataCache' in a '@Sendable' closure
309 |
310 |             for fileURL in URLsToDelete {
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:356:17: warning: capture of 'handler' with non-sendable type '(() -> ())?' in a '@Sendable' closure
354 |
355 |             DispatchQueue.main.async(execute: { () -> Void in
356 |                 handler?()
    |                 |- warning: capture of 'handler' with non-sendable type '(() -> ())?' in a '@Sendable' closure
    |                 `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
357 |             })
358 |         }
/Users/admin/builder/spi-builder-workspace/Sources/DataCache.swift:318:61: warning: implicit capture of 'self' requires that 'DataCache' conforms to 'Sendable'; this is an error in the Swift 6 language mode
 17 | }
 18 |
 19 | open class DataCache {
    |            `- note: class 'DataCache' does not conform to the 'Sendable' protocol
 20 |     static let cacheDirectoryPrefix = "com.nch.cache."
 21 |     static let ioQueuePrefix = "com.nch.queue."
    :
316 |             }
317 |
318 |             if self.maxDiskCacheSize > 0 && diskCacheSize > self.maxDiskCacheSize {
    |                                                             `- warning: implicit capture of 'self' requires that 'DataCache' conforms to 'Sendable'; this is an error in the Swift 6 language mode
319 |                 let targetSize = self.maxDiskCacheSize / 2
320 |
Build complete! (6.33s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "DataCache",
  "name" : "DataCache",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.11"
    },
    {
      "name" : "ios",
      "version" : "13.0"
    }
  ],
  "products" : [
    {
      "name" : "DataCache",
      "targets" : [
        "DataCache"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "DataCache",
      "module_type" : "SwiftTarget",
      "name" : "DataCache",
      "path" : "Sources",
      "product_memberships" : [
        "DataCache"
      ],
      "sources" : [
        "DataCache.swift",
        "Dictionary+Cache.swift",
        "String+MD5.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Done.