Build Information
Successful build of PersistentCacheKit, reference master (5cd697
), with Swift 6.0 for macOS (SPM) on 31 Oct 2024 20:59:59 UTC.
Swift 6 data race errors: 2
Build Command
env DEVELOPER_DIR=/Applications/Xcode-16.1.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Build Log
========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/davbeck/PersistentCacheKit.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/davbeck/PersistentCacheKit
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
HEAD is now at 5cd6979 Bump version number
Cloned https://github.com/davbeck/PersistentCacheKit.git
Revision (git rev-parse @):
5cd6979a225a76c04a2f0813bdedcea323ff3e29
SUCCESS checkout https://github.com/davbeck/PersistentCacheKit.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": "persistentcachekit",
"name": "PersistentCacheKit",
"url": "https://github.com/davbeck/PersistentCacheKit.git",
"version": "unspecified",
"path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/PersistentCacheKit",
"dependencies": [
]
}
]
}
Fetching https://github.com/davbeck/PersistentCacheKit.git
[1/265] Fetching persistentcachekit
Fetched https://github.com/davbeck/PersistentCacheKit.git from cache (0.78s)
Creating working copy for https://github.com/davbeck/PersistentCacheKit.git
Working copy of https://github.com/davbeck/PersistentCacheKit.git resolved at master (5cd6979)
warning: '.resolve-product-dependencies': dependency 'persistentcachekit' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform: macosSpm
Swift version: 6.0
Building package at path: $PWD
https://github.com/davbeck/PersistentCacheKit.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.1.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
[3/6] Compiling PersistentCacheKit SQLite.swift
[4/6] Compiling PersistentCacheKit PersistentCache.swift
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:6:31: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
4 | #endif
5 |
6 | public protocol CacheStorage: class {
| `- warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
7 | subscript(_: String) -> Data? { get set }
8 | /// Wait until all operations have been completed and data has been saved.
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:9:20: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
8 |
9 | public static let shared: SQLiteCacheStorage? = {
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'shared' 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
10 | do {
11 | var url = try FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:62:4: warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: generic class 'PersistentCache' does not conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
60 | public func clearMemoryCache(completion: (() -> Void)? = nil) {
61 | self.queue.async(flags: .barrier) {
62 | self.internalCache = [:]
| `- warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
63 |
64 | if let completion = completion {
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:64:24: warning: capture of 'completion' with non-sendable type '(() -> Void)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
62 | self.internalCache = [:]
63 |
64 | if let completion = completion {
| |- warning: capture of 'completion' with non-sendable type '(() -> Void)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
65 | DispatchQueue.global().async {
66 | completion()
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:66:6: warning: capture of 'completion' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
64 | if let completion = completion {
65 | DispatchQueue.global().async {
66 | completion()
| |- warning: capture of 'completion' with non-sendable type '() -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
67 | }
68 | }
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:109:5: warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: generic class 'PersistentCache' does not conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
107 |
108 | self.queue.async(flags: .barrier) {
109 | self.internalCache[key] = newValue
| `- warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
110 |
111 | self.storage?[self.stringKey(for: key)] = data
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:109:24: warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: consider making generic parameter 'Key' conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
107 |
108 | self.queue.async(flags: .barrier) {
109 | self.internalCache[key] = newValue
| `- warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
110 |
111 | self.storage?[self.stringKey(for: key)] = data
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:109:31: warning: capture of 'newValue' with non-sendable type 'Item<Value>?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
14 | }
15 |
16 | public struct Item<Value: Codable>: Codable {
| `- note: consider making generic struct 'Item' conform to the 'Sendable' protocol
17 | public var expiration: Date?
18 | public var value: Value
:
107 |
108 | self.queue.async(flags: .barrier) {
109 | self.internalCache[key] = newValue
| `- warning: capture of 'newValue' with non-sendable type 'Item<Value>?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
110 |
111 | self.storage?[self.stringKey(for: key)] = data
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:140:20: warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: generic class 'PersistentCache' does not conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
138 | } else {
139 | self.queue.async {
140 | if let data = self.storage?[self.stringKey(for: key)], let item = try? self.decoder.decode(Item<Value>.self, from: data) {
| `- warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
141 | queue.async {
142 | completion(item.value)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:140:54: warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: consider making generic parameter 'Key' conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
138 | } else {
139 | self.queue.async {
140 | if let data = self.storage?[self.stringKey(for: key)], let item = try? self.decoder.decode(Item<Value>.self, from: data) {
| `- warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
141 | queue.async {
142 | completion(item.value)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:142:8: warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
140 | if let data = self.storage?[self.stringKey(for: key)], let item = try? self.decoder.decode(Item<Value>.self, from: data) {
141 | queue.async {
142 | completion(item.value)
| |- warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
143 | }
144 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:146:23: warning: capture of 'fallback' with non-sendable type '(() -> Value)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
144 | } else {
145 | queue.async {
146 | if let value = fallback?() {
| |- warning: capture of 'fallback' with non-sendable type '(() -> Value)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
147 | self[key] = value
148 |
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:142:8: warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
140 | if let data = self.storage?[self.stringKey(for: key)], let item = try? self.decoder.decode(Item<Value>.self, from: data) {
141 | queue.async {
142 | completion(item.value)
| |- warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
143 | }
144 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:142:19: warning: capture of 'item' with non-sendable type 'Item<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
14 | }
15 |
16 | public struct Item<Value: Codable>: Codable {
| `- note: consider making generic struct 'Item' conform to the 'Sendable' protocol
17 | public var expiration: Date?
18 | public var value: Value
:
140 | if let data = self.storage?[self.stringKey(for: key)], let item = try? self.decoder.decode(Item<Value>.self, from: data) {
141 | queue.async {
142 | completion(item.value)
| `- warning: capture of 'item' with non-sendable type 'Item<Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
143 | }
144 | } else {
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:146:23: warning: capture of 'fallback' with non-sendable type '(() -> Value)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
144 | } else {
145 | queue.async {
146 | if let value = fallback?() {
| |- warning: capture of 'fallback' with non-sendable type '(() -> Value)?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
147 | self[key] = value
148 |
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:147:9: warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: generic class 'PersistentCache' does not conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
145 | queue.async {
146 | if let value = fallback?() {
147 | self[key] = value
| `- warning: capture of 'self' with non-sendable type 'PersistentCache<Key, Value>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
148 |
149 | completion(value)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:147:14: warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
36 | }
37 |
38 | public class PersistentCache<Key: CustomStringConvertible & Hashable, Value: Codable> {
| `- note: consider making generic parameter 'Key' conform to the 'Sendable' protocol
39 | private let queue = DispatchQueue(label: "Cache", attributes: .concurrent)
40 | private var internalCache = [Key: Item<Value>]()
:
145 | queue.async {
146 | if let value = fallback?() {
147 | self[key] = value
| `- warning: capture of 'key' with non-sendable type 'Key' in a `@Sendable` closure; this is an error in the Swift 6 language mode
148 |
149 | completion(value)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:149:9: warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
147 | self[key] = value
148 |
149 | completion(value)
| |- warning: capture of 'completion' with non-sendable type '(Value?) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
150 | } else {
151 | completion(nil)
[5/6] Emitting module PersistentCacheKit
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/PersistentCache.swift:6:31: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
4 | #endif
5 |
6 | public protocol CacheStorage: class {
| `- warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
7 | subscript(_: String) -> Data? { get set }
8 | /// Wait until all operations have been completed and data has been saved.
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:9:20: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
8 |
9 | public static let shared: SQLiteCacheStorage? = {
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'shared' 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
10 | do {
11 | var url = try FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:42:10: warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
:
40 | self.queue.async {
41 | do {
42 | try self._trimFilesize()
| `- warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
43 | } catch {
44 | if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
[6/6] Compiling PersistentCacheKit SQLiteCacheStorage.swift
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:9:20: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
8 |
9 | public static let shared: SQLiteCacheStorage? = {
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'SQLiteCacheStorage?' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'shared' 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
10 | do {
11 | var url = try FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:42:10: warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
:
40 | self.queue.async {
41 | do {
42 | try self._trimFilesize()
| `- warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
43 | } catch {
44 | if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
/Users/admin/builder/spi-builder-workspace/Sources/PersistentCacheKit/SQLiteCacheStorage.swift:109:26: warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
3 | import SQLite3
4 |
5 | public final class SQLiteCacheStorage: CacheStorage {
| `- note: class 'SQLiteCacheStorage' does not conform to the 'Sendable' protocol
6 | @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
7 | static let log = OSLog(subsystem: "co.davidbeck.persistent_cache_kit.plist", category: "sqlite_storage")
:
107 | let sql = "INSERT OR REPLACE INTO cache_storage (key, data, createdAt) VALUES (?, ?, ?)"
108 |
109 | let statement = try self.db.preparedStatement(forSQL: sql)
| `- warning: capture of 'self' with non-sendable type 'SQLiteCacheStorage' in a `@Sendable` closure; this is an error in the Swift 6 language mode
110 |
111 | try statement.bind(key, at: 1)
Build complete! (7.47s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "PersistentCacheKit",
"name" : "PersistentCacheKit",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "10.10"
},
{
"name" : "ios",
"version" : "10.0"
}
],
"products" : [
{
"name" : "PersistentCacheKit",
"targets" : [
"PersistentCacheKit"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "PersistentCacheKitTests",
"module_type" : "SwiftTarget",
"name" : "PersistentCacheKitTests",
"path" : "Tests/PersistentCacheKitTests",
"sources" : [
"PersistentCacheKitTests.swift"
],
"type" : "test"
},
{
"c99name" : "PersistentCacheKit",
"module_type" : "SwiftTarget",
"name" : "PersistentCacheKit",
"path" : "Sources/PersistentCacheKit",
"product_memberships" : [
"PersistentCacheKit"
],
"sources" : [
"PersistentCache.swift",
"SQLite.swift",
"SQLiteCacheStorage.swift"
],
"type" : "library"
}
],
"tools_version" : "5.0"
}
Done.