This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.

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 SwiftFileStore with Swift 6.0 for Linux.

Swift 6 data race errors: 5

Build Command

bash -c docker run --rm -v "checkouts-4609320-1":/host -w "$workDir" 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 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.40.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/juyan/swift-filestore.git
Reference: main
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/juyan/swift-filestore
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 61aa52c platform support (#9)
Cloned https://github.com/juyan/swift-filestore.git
Revision (git rev-parse @):
61aa52c514e39a70c17ce6421d70807f46282154
SUCCESS checkout https://github.com/juyan/swift-filestore.git at main
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $workDir
https://github.com/juyan/swift-filestore.git
Running build ...
bash -c docker run --rm -v "checkouts-4609320-1":/host -w "$workDir" 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 2>&1
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/10] Compiling SwiftFileStore Observer.swift
[4/11] Compiling SwiftFileStore ObjectStore.swift
[5/11] Compiling SwiftFileStore ObjectStore+Expiry.swift
[6/11] Compiling SwiftFileStore ObserverManager.swift
[7/11] Compiling SwiftFileStore JSONDataRepresentable.swift
[8/11] Compiling SwiftFileStore FileObjectStore.swift
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:114:1: warning: extension declares a conformance of imported type 'String' to imported protocol 'Error'; this will not behave correctly if the owners of 'Swift' introduce this conformance in the future
112 | }
113 |
114 | extension String: Error {}
    | |- warning: extension declares a conformance of imported type 'String' to imported protocol 'Error'; this will not behave correctly if the owners of 'Swift' introduce this conformance in the future
    | `- note: add '@retroactive' to silence this warning
115 |
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:42:19: warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  7 | /// Implementation of `ObjectStore` using flat files.
  8 | /// Each namespace has a directory, and each object is serialized into a flat file under the directory.
  9 | public final class FileObjectStore: ObjectStore {
    |                    `- note: class 'FileObjectStore' does not conform to the 'Sendable' protocol
 10 |     private static let rootDirName = "file-object-store"
 11 |
    :
 40 |         try object.serialize().write(to: fileURL)
 41 |         Task {
 42 |             await observerManager.publishValue(key: key, namespace: namespace, value: object)
    |                   `- warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 43 |         }
 44 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:42:87: warning: capture of 'object' with non-sendable type 'T' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 34 |     }
 35 |
 36 |     public func write<T>(key: String, namespace: String, object: T) async throws where T: DataRepresentable {
    |                       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 37 |         let dirURL = rootDir.appendingPathComponent(namespace)
 38 |         let fileURL = dirURL.appendingPathComponent(key)
    :
 40 |         try object.serialize().write(to: fileURL)
 41 |         Task {
 42 |             await observerManager.publishValue(key: key, namespace: namespace, value: object)
    |                                                                                       `- warning: capture of 'object' with non-sendable type 'T' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 43 |         }
 44 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:53:19: warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  7 | /// Implementation of `ObjectStore` using flat files.
  8 | /// Each namespace has a directory, and each object is serialized into a flat file under the directory.
  9 | public final class FileObjectStore: ObjectStore {
    |                    `- note: class 'FileObjectStore' does not conform to the 'Sendable' protocol
 10 |     private static let rootDirName = "file-object-store"
 11 |
    :
 51 |         }
 52 |         Task {
 53 |             await observerManager.publishRemoval(namespace: namespace, key: key)
    |                   `- warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 54 |         }
 55 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:61:19: warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  7 | /// Implementation of `ObjectStore` using flat files.
  8 | /// Each namespace has a directory, and each object is serialized into a flat file under the directory.
  9 | public final class FileObjectStore: ObjectStore {
    |                    `- note: class 'FileObjectStore' does not conform to the 'Sendable' protocol
 10 |     private static let rootDirName = "file-object-store"
 11 |
    :
 59 |         try FileManager.default.removeItem(at: dirURL)
 60 |         Task {
 61 |             await observerManager.publishRemoval(namespace: namespace)
    |                   `- warning: capture of 'self' with non-sendable type 'FileObjectStore' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 62 |         }
 63 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:71:46: warning: non-sendable type 'Observer' returned by call to actor-isolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
 69 |
 70 |     public func observe<T>(key: String, namespace: String, objectType: T.Type) async -> AsyncThrowingStream<T?, Error> where T: DataRepresentable {
 71 |         let observer = await observerManager.getObserver(key: key, namespace: namespace)
    |                                              `- warning: non-sendable type 'Observer' returned by call to actor-isolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
 72 |         do {
 73 |             let existingValue = try await read(key: key, namespace: namespace, objectType: objectType)
/host/spi-builder-workspace/Sources/SwiftFileStore/Observer.swift:7:13: note: class 'Observer' does not conform to the 'Sendable' protocol
 5 | import Foundation
 6 |
 7 | final class Observer {
   |             `- note: class 'Observer' does not conform to the 'Sendable' protocol
 8 |     let key: String
 9 |     let namespace: String
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:87:21: warning: capture of 'observer' with non-sendable type 'Observer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 85 |                 }
 86 |                 continuation.onTermination = { @Sendable _ in
 87 |                     observer.callbacks.removeValue(forKey: callbackID)
    |                     `- warning: capture of 'observer' with non-sendable type 'Observer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 88 |                 }
 89 |             }
/host/spi-builder-workspace/Sources/SwiftFileStore/Observer.swift:7:13: note: class 'Observer' does not conform to the 'Sendable' protocol
 5 | import Foundation
 6 |
 7 | final class Observer {
   |             `- note: class 'Observer' does not conform to the 'Sendable' protocol
 8 |     let key: String
 9 |     let namespace: String
[9/11] Emitting module SwiftFileStore
/host/spi-builder-workspace/Sources/SwiftFileStore/FileObjectStore.swift:114:1: warning: extension declares a conformance of imported type 'String' to imported protocol 'Error'; this will not behave correctly if the owners of 'Swift' introduce this conformance in the future
112 | }
113 |
114 | extension String: Error {}
    | |- warning: extension declares a conformance of imported type 'String' to imported protocol 'Error'; this will not behave correctly if the owners of 'Swift' introduce this conformance in the future
    | `- note: add '@retroactive' to silence this warning
115 |
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:14:17: warning: non-sendable type 'T?' returned by actor-isolated instance method 'read(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
12 |     public init() {}
13 |
14 |     public func read<T>(key: String, namespace: String, objectType _: T.Type) async throws -> T? where T: DataRepresentable {
   |                 |    `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
   |                 `- warning: non-sendable type 'T?' returned by actor-isolated instance method 'read(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
15 |         objects[namespace]?[key].flatMap { try? T.from(data: $0) }
16 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:18:17: warning: non-sendable type 'T' in parameter of the protocol requirement satisfied by actor-isolated instance method 'write(key:namespace:object:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
16 |     }
17 |
18 |     public func write<T>(key: String, namespace: String, object: T) async throws where T: DataRepresentable {
   |                 `- warning: non-sendable type 'T' in parameter of the protocol requirement satisfied by actor-isolated instance method 'write(key:namespace:object:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
19 |         let data = try object.serialize()
20 |         objects[namespace, default: [:]][key] = data
/host/spi-builder-workspace/Sources/SwiftFileStore/ObjectStore.swift:29:16: note: consider making generic parameter 'T' conform to the 'Sendable' protocol
27 |     ///   - namespace: namespace of the object, such as "Cats"
28 |     ///   - object: The object to write
29 |     func write<T>(key: String, namespace: String, object: T) async throws where T: DataRepresentable
   |                `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
30 |
31 |     /// Remove an object from storage
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:38:17: warning: non-sendable type 'AsyncThrowingStream<T?, any Error>' returned by actor-isolated instance method 'observe(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
36 |     }
37 |
38 |     public func observe<T>(key: String, namespace: String, objectType: T.Type) async -> AsyncThrowingStream<T?, Error> where T: DataRepresentable {
   |                 |       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
   |                 `- warning: non-sendable type 'AsyncThrowingStream<T?, any Error>' returned by actor-isolated instance method 'observe(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
39 |         let observer = await observerManager.getObserver(key: key, namespace: namespace)
40 |         do {
/host/spi-builder-workspace/Sources/SwiftFileStore/PersistenceLog.swift:54:17: warning: non-sendable type 'Self.Element' in parameter of the protocol requirement satisfied by actor-isolated instance method 'append(element:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
52 |     }
53 |
54 |     public func append(element: ElementType) async throws {
   |                 `- warning: non-sendable type 'Self.Element' in parameter of the protocol requirement satisfied by actor-isolated instance method 'append(element:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
55 |         try fileHandle.seekToEnd()
56 |         let data = try element.serialize()
/host/spi-builder-workspace/Sources/SwiftFileStore/PersistenceLog.swift:62:17: warning: non-sendable type '[ElementType]' returned by actor-isolated instance method 'flush()' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
15 | }
16 |
17 | public actor PersistenceLogImpl<ElementType>: PersistenceLog where ElementType: DataRepresentable {
   |                                 `- note: consider making generic parameter 'ElementType' conform to the 'Sendable' protocol
18 |     public typealias Element = ElementType
19 |
   :
60 |     }
61 |
62 |     public func flush() async throws -> [ElementType] {
   |                 `- warning: non-sendable type '[ElementType]' returned by actor-isolated instance method 'flush()' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
63 |         try fileHandle.seek(toOffset: 0)
64 |         let fileData = try fileHandle.readToEnd()
[10/11] Compiling SwiftFileStore MemoryObjectStore.swift
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:14:17: warning: non-sendable type 'T?' returned by actor-isolated instance method 'read(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
12 |     public init() {}
13 |
14 |     public func read<T>(key: String, namespace: String, objectType _: T.Type) async throws -> T? where T: DataRepresentable {
   |                 |    `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
   |                 `- warning: non-sendable type 'T?' returned by actor-isolated instance method 'read(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
15 |         objects[namespace]?[key].flatMap { try? T.from(data: $0) }
16 |     }
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:18:17: warning: non-sendable type 'T' in parameter of the protocol requirement satisfied by actor-isolated instance method 'write(key:namespace:object:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
16 |     }
17 |
18 |     public func write<T>(key: String, namespace: String, object: T) async throws where T: DataRepresentable {
   |                 `- warning: non-sendable type 'T' in parameter of the protocol requirement satisfied by actor-isolated instance method 'write(key:namespace:object:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
19 |         let data = try object.serialize()
20 |         objects[namespace, default: [:]][key] = data
/host/spi-builder-workspace/Sources/SwiftFileStore/ObjectStore.swift:29:16: note: consider making generic parameter 'T' conform to the 'Sendable' protocol
27 |     ///   - namespace: namespace of the object, such as "Cats"
28 |     ///   - object: The object to write
29 |     func write<T>(key: String, namespace: String, object: T) async throws where T: DataRepresentable
   |                `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
30 |
31 |     /// Remove an object from storage
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:38:17: warning: non-sendable type 'AsyncThrowingStream<T?, any Error>' returned by actor-isolated instance method 'observe(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
36 |     }
37 |
38 |     public func observe<T>(key: String, namespace: String, objectType: T.Type) async -> AsyncThrowingStream<T?, Error> where T: DataRepresentable {
   |                 |       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
   |                 `- warning: non-sendable type 'AsyncThrowingStream<T?, any Error>' returned by actor-isolated instance method 'observe(key:namespace:objectType:)' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
39 |         let observer = await observerManager.getObserver(key: key, namespace: namespace)
40 |         do {
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:39:46: warning: non-sendable type 'Observer' returned by call to actor-isolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
37 |
38 |     public func observe<T>(key: String, namespace: String, objectType: T.Type) async -> AsyncThrowingStream<T?, Error> where T: DataRepresentable {
39 |         let observer = await observerManager.getObserver(key: key, namespace: namespace)
   |                                              `- warning: non-sendable type 'Observer' returned by call to actor-isolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
40 |         do {
41 |             let existingValue = try await read(key: key, namespace: namespace, objectType: objectType)
/host/spi-builder-workspace/Sources/SwiftFileStore/Observer.swift:7:13: note: class 'Observer' does not conform to the 'Sendable' protocol
 5 | import Foundation
 6 |
 7 | final class Observer {
   |             `- note: class 'Observer' does not conform to the 'Sendable' protocol
 8 |     let key: String
 9 |     let namespace: String
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:55:21: warning: capture of 'observer' with non-sendable type 'Observer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
53 |                 }
54 |                 continuation.onTermination = { @Sendable _ in
55 |                     observer.callbacks.removeValue(forKey: callbackID)
   |                     `- warning: capture of 'observer' with non-sendable type 'Observer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
56 |                 }
57 |             }
/host/spi-builder-workspace/Sources/SwiftFileStore/Observer.swift:7:13: note: class 'Observer' does not conform to the 'Sendable' protocol
 5 | import Foundation
 6 |
 7 | final class Observer {
   |             `- note: class 'Observer' does not conform to the 'Sendable' protocol
 8 |     let key: String
 9 |     let namespace: String
/host/spi-builder-workspace/Sources/SwiftFileStore/MemoryObjectStore.swift:21:31: warning: sending 'object' risks causing data races; this is an error in the Swift 6 language mode
19 |         let data = try object.serialize()
20 |         objects[namespace, default: [:]][key] = data
21 |         await observerManager.publishValue(key: key, namespace: namespace, value: object)
   |                               |- warning: sending 'object' risks causing data races; this is an error in the Swift 6 language mode
   |                               `- note: sending 'self'-isolated 'object' to actor-isolated instance method 'publishValue(key:namespace:value:)' risks causing data races between actor-isolated and 'self'-isolated uses
22 |     }
23 |
[11/11] Compiling SwiftFileStore PersistenceLog.swift
/host/spi-builder-workspace/Sources/SwiftFileStore/PersistenceLog.swift:54:17: warning: non-sendable type 'Self.Element' in parameter of the protocol requirement satisfied by actor-isolated instance method 'append(element:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
52 |     }
53 |
54 |     public func append(element: ElementType) async throws {
   |                 `- warning: non-sendable type 'Self.Element' in parameter of the protocol requirement satisfied by actor-isolated instance method 'append(element:)' cannot cross actor boundary; this is an error in the Swift 6 language mode
55 |         try fileHandle.seekToEnd()
56 |         let data = try element.serialize()
/host/spi-builder-workspace/Sources/SwiftFileStore/PersistenceLog.swift:62:17: warning: non-sendable type '[ElementType]' returned by actor-isolated instance method 'flush()' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
15 | }
16 |
17 | public actor PersistenceLogImpl<ElementType>: PersistenceLog where ElementType: DataRepresentable {
   |                                 `- note: consider making generic parameter 'ElementType' conform to the 'Sendable' protocol
18 |     public typealias Element = ElementType
19 |
   :
60 |     }
61 |
62 |     public func flush() async throws -> [ElementType] {
   |                 `- warning: non-sendable type '[ElementType]' returned by actor-isolated instance method 'flush()' satisfying protocol requirement cannot cross actor boundary; this is an error in the Swift 6 language mode
63 |         try fileHandle.seek(toOffset: 0)
64 |         let fileData = try fileHandle.readToEnd()
Build complete! (14.44s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "SwiftFileStore",
  "name" : "SwiftFileStore",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "14.0"
    },
    {
      "name" : "macos",
      "version" : "12.0"
    },
    {
      "name" : "tvos",
      "version" : "14.0"
    },
    {
      "name" : "watchos",
      "version" : "8.0"
    }
  ],
  "products" : [
    {
      "name" : "SwiftFileStore",
      "targets" : [
        "SwiftFileStore"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "SwiftFileStoreTests",
      "module_type" : "SwiftTarget",
      "name" : "SwiftFileStoreTests",
      "path" : "Tests/SwiftFileStoreTests",
      "sources" : [
        "FileObjectStoreTests.swift",
        "MemoryObjectStoreTests.swift",
        "PersistenceLogTests.swift",
        "TestObject.swift",
        "XCTestCase+.swift"
      ],
      "target_dependencies" : [
        "SwiftFileStore"
      ],
      "type" : "test"
    },
    {
      "c99name" : "SwiftFileStore",
      "module_type" : "SwiftTarget",
      "name" : "SwiftFileStore",
      "path" : "Sources/SwiftFileStore",
      "product_memberships" : [
        "SwiftFileStore"
      ],
      "sources" : [
        "FileObjectStore.swift",
        "JSONDataRepresentable.swift",
        "MemoryObjectStore.swift",
        "ObjectStore+Expiry.swift",
        "ObjectStore.swift",
        "Observer.swift",
        "ObserverManager.swift",
        "PersistenceLog.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.6"
}
Done.
This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.