Build Information
Successful build of NyaruDB2, reference main (320682
), with Swift 6.1 for macOS (SPM) on 19 May 2025 20:06:01 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.4
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/galileostudio/nyarudb2.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/galileostudio/nyarudb2
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at 3206824 Merge pull request #4 from sciasxp/persistency_lifecycle
Cloned https://github.com/galileostudio/nyarudb2.git
Revision (git rev-parse @):
3206824a00ae9b63e78bce5ec0a2b7cf1d9014a1
SUCCESS checkout https://github.com/galileostudio/nyarudb2.git at main
========================================
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": "nyarudb2",
"name": "NyaruDB2",
"url": "https://github.com/galileostudio/nyarudb2.git",
"version": "unspecified",
"path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/nyarudb2",
"dependencies": [
]
}
]
}
Fetching https://github.com/galileostudio/nyarudb2.git
[1/934] Fetching nyarudb2
Fetched https://github.com/galileostudio/nyarudb2.git from cache (1.04s)
Creating working copy for https://github.com/galileostudio/nyarudb2.git
Working copy of https://github.com/galileostudio/nyarudb2.git resolved at main (3206824)
Found 0 product dependencies
========================================
Build
========================================
Selected platform: macosSpm
Swift version: 6.1
Building package at path: $PWD
https://github.com/galileostudio/nyarudb2.git
https://github.com/galileostudio/nyarudb2.git
{
"dependencies" : [
],
"manifest_display_name" : "NyaruDB2",
"name" : "NyaruDB2",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "ios",
"version" : "15.0"
},
{
"name" : "macos",
"version" : "12.0"
}
],
"products" : [
{
"name" : "NyaruDB2",
"targets" : [
"NyaruDB2"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "QuickStartRunner",
"targets" : [
"QuickStartRunner"
],
"type" : {
"executable" : null
}
},
{
"name" : "Benchmark",
"targets" : [
"Benchmark"
],
"type" : {
"executable" : null
}
}
],
"targets" : [
{
"c99name" : "QuickStartRunner",
"module_type" : "SwiftTarget",
"name" : "QuickStartRunner",
"path" : "Sources/QuickStart",
"product_memberships" : [
"QuickStartRunner"
],
"sources" : [
"QuickStart.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "executable"
},
{
"c99name" : "NyaruDB2Tests",
"module_type" : "SwiftTarget",
"name" : "NyaruDB2Tests",
"path" : "Tests/NyaruDB2Tests",
"sources" : [
"BTreeIndexPersistenceTest.swift",
"BTreeIndexTest.swift",
"CollectionCatalog.swift",
"CompressionMethodTest.swift",
"DocumentCollectionCRUDTest.swift",
"IndexManagerTest.swift",
"NyaruDB2Test.swift",
"PersistenceLifecycleTest.swift",
"QueryEngineIndexTest.swift",
"QueryEngineTest.swift",
"ShardManagerTest.swift",
"StatsEngineTest.swift",
"StorageEngineTest.swift",
"StorageRepartitionCollectionTest.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "test"
},
{
"c99name" : "NyaruDB2",
"module_type" : "SwiftTarget",
"name" : "NyaruDB2",
"path" : "Sources/NyaruDB2",
"product_memberships" : [
"NyaruDB2",
"QuickStartRunner",
"Benchmark"
],
"sources" : [
"Core/CollectionEngine/CollectionCatalog.swift",
"Core/CollectionEngine/DocumentCollection.swift",
"Core/Commons/DynamicDecoder.swift",
"Core/Commons/FileProtection.swift",
"Core/IndexManager/BTreeIndex.swift",
"Core/IndexManager/IndexManager.swift",
"Core/QueryEngine/QueryEngine.swift",
"Core/QueryEngine/QueryPlanner.swift",
"Core/ShardManager/CompressionMethod.swift",
"Core/ShardManager/Shard.swift",
"Core/ShardManager/ShardManager.swift",
"Core/StatsEngine/StatsEngine.swift",
"Core/StorageEngine/StorageEngine.swift",
"NyaruDB2.swift"
],
"type" : "library"
},
{
"c99name" : "Benchmark",
"module_type" : "SwiftTarget",
"name" : "Benchmark",
"path" : "Sources/Benchmark",
"product_memberships" : [
"Benchmark"
],
"sources" : [
"Benchmark.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "executable"
}
],
"tools_version" : "5.9"
}
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/12] Write sources
[2/12] Write Benchmark-entitlement.plist
[2/12] Write QuickStartRunner-entitlement.plist
[5/12] Write swift-version-2F0A5646E1D333AE.txt
[7/26] Compiling NyaruDB2 StorageEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:82:44: warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
80 |
81 | let shardManager = try await getOrCreateShardManager(for: collection)
82 | let shard = try await shardManager.getOrCreateShard(id: partitionValue)
| `- warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
83 |
84 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:114:45: warning: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
104 | /// - Returns: An array of decoded objects of type `T`.
105 | /// - Throws: An error if the fetch operation or decoding process fails.
106 | public func fetchDocuments<T: Codable>(from collection: String) async throws
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
107 | -> [T]
108 | {
:
112 | var allDocs: [T] = []
113 | for shard in shardManager.allShards() {
114 | let docs: [T] = try await shard.loadDocuments()
| `- warning: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
115 | allDocs.append(contentsOf: docs)
116 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:227:44: warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
225 | key: partitionField
226 | )
227 | shard = try await shardManager.getOrCreateShard(id: partitionValue)
| `- warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
228 | } else {
229 | shard = try await shardManager.getOrCreateShard(id: "default")
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:229:44: warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
227 | shard = try await shardManager.getOrCreateShard(id: partitionValue)
228 | } else {
229 | shard = try await shardManager.getOrCreateShard(id: "default")
| `- warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
230 | }
231 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:232:46: warning: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
209 | ///
210 | /// - Note: This method is asynchronous and must be called with `await`.
211 | public func updateDocument<T: Codable>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
212 | _ document: T,
213 | in collection: String,
:
230 | }
231 |
232 | var documents: [T] = try await shard.loadDocuments()
| `- warning: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
233 |
234 | guard let indexToUpdate = documents.firstIndex(where: predicate) else {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:524:48: warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
522 |
523 | for (partitionValue, docsGroup) in groups {
524 | let shard = try await shardManager.getOrCreateShard(
| `- warning: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
525 | id: partitionValue
526 | )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:569:19: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
564 | /// - Returns: An array containing the transformed elements.
565 | /// - Throws: Rethrows any error thrown by the `transform` closure.
566 | func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
567 | async rethrows -> [T]
568 | {
569 | try await withThrowingTaskGroup(of: T.self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
570 | forEach { element in
571 | group.addTask { try await transform(element) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:571:23: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
564 | /// - Returns: An array containing the transformed elements.
565 | /// - Throws: Rethrows any error thrown by the `transform` closure.
566 | func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
567 | async rethrows -> [T]
568 | {
569 | try await withThrowingTaskGroup(of: T.self) { group in
570 | forEach { element in
571 | group.addTask { try await transform(element) }
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
572 | }
573 | return try await group.reduce(into: []) { $0.append($1) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:573:36: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
564 | /// - Returns: An array containing the transformed elements.
565 | /// - Throws: Rethrows any error thrown by the `transform` closure.
566 | func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
567 | async rethrows -> [T]
568 | {
:
571 | group.addTask { try await transform(element) }
572 | }
573 | return try await group.reduce(into: []) { $0.append($1) }
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
574 | }
575 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:82:44: warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
80 |
81 | let shardManager = try await getOrCreateShardManager(for: collection)
82 | let shard = try await shardManager.getOrCreateShard(id: partitionValue)
| |- warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager' to nonisolated instance method 'getOrCreateShard(id:)' risks causing data races between nonisolated and 'self'-isolated uses
83 |
84 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:85:25: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
83 |
84 |
85 | try await shard.appendDocument(document, jsonData: jsonData)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'document' to nonisolated instance method 'appendDocument(_:jsonData:)' risks causing data races between nonisolated and 'self'-isolated uses
86 |
87 | let indexManager = indexManagers[collection] ?? IndexManager<String>()
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:114:45: warning: sending 'shard' risks causing data races; this is an error in the Swift 6 language mode
112 | var allDocs: [T] = []
113 | for shard in shardManager.allShards() {
114 | let docs: [T] = try await shard.loadDocuments()
| |- warning: sending 'shard' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shard' to nonisolated instance method 'loadDocuments()' risks causing data races between nonisolated and 'self'-isolated uses
115 | allDocs.append(contentsOf: docs)
116 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:161:26: warning: sending value of non-Sendable type '[Shard]' risks causing data races; this is an error in the Swift 6 language mode
159 | try await activeShardManagers[collection]?
160 | .allShards()
161 | .asyncForEach { shard in
| |- warning: sending value of non-Sendable type '[Shard]' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type '[Shard]' to nonisolated instance method 'asyncForEach' risks causing races in between 'self'-isolated and nonisolated uses
162 | try await shard.loadDocuments()
163 | .forEach { continuation.yield($0) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:163:57: warning: sending '$0' risks causing data races; this is an error in the Swift 6 language mode
161 | .asyncForEach { shard in
162 | try await shard.loadDocuments()
163 | .forEach { continuation.yield($0) }
| |- warning: sending '$0' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated '$0' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
164 | }
165 | continuation.finish()
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:188:14: warning: sending value of non-Sendable type '(Shard) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
186 |
187 | try await shardManager.allShards()
188 | .asyncForEach { shard in
| |- warning: sending value of non-Sendable type '(Shard) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type '(Shard) async throws -> Void' to nonisolated instance method 'asyncForEach' risks causing races in between 'self'-isolated and nonisolated uses
189 | let docs = try await shard.loadDocuments() as [T]
190 | let newDocs = docs.filter { !predicate($0) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:188:14: warning: sending 'shardManager.allShards' risks causing data races; this is an error in the Swift 6 language mode
186 |
187 | try await shardManager.allShards()
188 | .asyncForEach { shard in
| |- warning: sending 'shardManager.allShards' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager.allShards' to nonisolated instance method 'asyncForEach' risks causing data races between nonisolated and 'self'-isolated uses
189 | let docs = try await shard.loadDocuments() as [T]
190 | let newDocs = docs.filter { !predicate($0) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:227:44: warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
225 | key: partitionField
226 | )
227 | shard = try await shardManager.getOrCreateShard(id: partitionValue)
| |- warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager' to nonisolated instance method 'getOrCreateShard(id:)' risks causing data races between nonisolated and 'self'-isolated uses
228 | } else {
229 | shard = try await shardManager.getOrCreateShard(id: "default")
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:229:44: warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
227 | shard = try await shardManager.getOrCreateShard(id: partitionValue)
228 | } else {
229 | shard = try await shardManager.getOrCreateShard(id: "default")
| |- warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager' to nonisolated instance method 'getOrCreateShard(id:)' risks causing data races between nonisolated and 'self'-isolated uses
230 | }
231 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:240:25: warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
238 | documents[indexToUpdate] = document
239 |
240 | try await shard.saveDocuments(documents)
| |- warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'documents' to nonisolated instance method 'saveDocuments' risks causing data races between nonisolated and 'self'-isolated uses
241 |
242 | let indexManager = indexManagers[collection] ?? IndexManager<String>()
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:290:33: warning: sending value of non-Sendable type '(T) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
288 |
289 | if let indexField = indexField {
290 | try await documents.asyncForEach { document in
| |- warning: sending value of non-Sendable type '(T) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type '(T) async throws -> Void' to nonisolated instance method 'asyncForEach' risks causing races in between 'self'-isolated and nonisolated uses
291 | let jsonData = try JSONEncoder().encode(document)
292 | let indexKey = try DynamicDecoder.extractValue(
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:290:33: warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
288 |
289 | if let indexField = indexField {
290 | try await documents.asyncForEach { document in
| |- warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'documents' to nonisolated instance method 'asyncForEach' risks causing data races between nonisolated and 'self'-isolated uses
291 | let jsonData = try JSONEncoder().encode(document)
292 | let indexKey = try DynamicDecoder.extractValue(
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:314:26: warning: sending value of non-Sendable type '(String, [(document: T, jsonData: Data)]) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
312 | }
313 |
314 | try await groups.forEachAsync { (shardId, groupDocuments) in
| |- warning: sending value of non-Sendable type '(String, [(document: T, jsonData: Data)]) async throws -> Void' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type '(String, [(document: T, jsonData: Data)]) async throws -> Void' to nonisolated instance method 'forEachAsync' risks causing races in between 'self'-isolated and nonisolated uses
315 | let shard = try await shardManager.getOrCreateShard(id: shardId)
316 | let existingDocs: [T] = try await shard.loadDocuments()
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:314:26: warning: sending 'groups' risks causing data races; this is an error in the Swift 6 language mode
312 | }
313 |
314 | try await groups.forEachAsync { (shardId, groupDocuments) in
| |- warning: sending 'groups' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'groups' to nonisolated instance method 'forEachAsync' risks causing data races between nonisolated and 'self'-isolated uses
315 | let shard = try await shardManager.getOrCreateShard(id: shardId)
316 | let existingDocs: [T] = try await shard.loadDocuments()
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:524:48: warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
522 |
523 | for (partitionValue, docsGroup) in groups {
524 | let shard = try await shardManager.getOrCreateShard(
| |- warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager' to nonisolated instance method 'getOrCreateShard(id:)' risks causing data races between nonisolated and 'self'-isolated uses
525 | id: partitionValue
526 | )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:527:29: warning: sending 'docsGroup' risks causing data races; this is an error in the Swift 6 language mode
525 | id: partitionValue
526 | )
527 | try await shard.saveDocuments(docsGroup)
| |- warning: sending 'docsGroup' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'docsGroup' to nonisolated instance method 'saveDocuments' risks causing data races between nonisolated and 'self'-isolated uses
528 | }
529 | try await statsEngine.updateCollectionMetadata(for: collection)
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:534:32: warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
532 | public func cleanupEmptyShards(for collection: String) async throws {
533 | let shardManager = try await getOrCreateShardManager(for: collection)
534 | try await shardManager.cleanupEmptyShards()
| |- warning: sending 'shardManager' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'shardManager' to nonisolated instance method 'cleanupEmptyShards()' risks causing data races between nonisolated and 'self'-isolated uses
535 | }
536 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:571:31: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
569 | try await withThrowingTaskGroup(of: T.self) { group in
570 | forEach { element in
571 | group.addTask { try await transform(element) }
| | `- note: closure captures 'transform' which is accessible to code in the current task
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
572 | }
573 | return try await group.reduce(into: []) { $0.append($1) }
[8/26] Compiling NyaruDB2 Shard.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:162:18: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
160 | {
161 | AsyncThrowingStream { continuation in
162 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
163 | do {
164 | let docs: [T] = try await self.loadDocuments()
| `- note: closure captures 'self' which is accessible to code in the current task
165 | for doc in docs {
166 | continuation.yield(doc)
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:166:38: warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
164 | let docs: [T] = try await self.loadDocuments()
165 | for doc in docs {
166 | continuation.yield(doc)
| |- warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'doc' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
167 | }
168 | continuation.finish()
[9/26] Compiling NyaruDB2 CompressionMethod.swift
[10/26] Compiling NyaruDB2 QueryEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:127:26: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
125 |
126 | // Usa um TaskGroup para executar a busca para cada valor do índice em paralelo
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
128 | for value in values {
129 | group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:23: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
128 | for value in values {
129 | group.addTask {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
130 | try await self.storage.fetchFromIndex(
131 | collection: self.collection,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:137:36: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
135 | }
136 | }
137 | return try await group.reduce(into: []) { $0 += $1 }
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
138 | }
139 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:130:44: warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
128 | for value in values {
129 | group.addTask {
130 | try await self.storage.fetchFromIndex(
| `- warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
131 | collection: self.collection,
132 | field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:162:26: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
160 |
161 |
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
163 | for shard in shards {
164 | group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:23: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
163 | for shard in shards {
164 | group.addTask {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
165 | let docs: [T] = try await shard.loadDocuments()
166 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:153:43: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
151 | private func executeHybrid(plan: ExecutionPlan) async throws -> [T] {
152 |
153 | let allShards = try await storage.getShardManagers(for: collection)
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
154 |
155 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:192:27: warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
190 |
191 | let stream: AsyncThrowingStream<T, Error> =
192 | await storage.fetchDocumentsLazy(from: collection)
| `- warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
193 | for try await doc in stream {
194 | if self.evaluateDocument(doc) {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:352:52: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
350 | do {
351 | // Obtém os shards da coleção
352 | let shards = try await storage.getShardManagers(
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
353 | for: collection
354 | )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:31: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
128 | for value in values {
129 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
130 | try await self.storage.fetchFromIndex(
| `- note: closure captures 'self' which is accessible to code in the current task
131 | collection: self.collection,
132 | field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:31: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
163 | for shard in shards {
164 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
165 | let docs: [T] = try await shard.loadDocuments()
166 |
167 | return docs.filter { self.evaluateDocument($0) }
| `- note: closure captures 'self' which is accessible to code in the current task
168 | }
169 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:349:18: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
347 | public func fetchStream(from storage: StorageEngine) -> AsyncThrowingStream<T, Error> {
348 | AsyncThrowingStream { continuation in
349 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
350 | do {
351 | // Obtém os shards da coleção
352 | let shards = try await storage.getShardManagers(
353 | for: collection
| `- note: closure captures 'self' which is accessible to code in the current task
354 | )
355 | // Itera sobre os shards
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:363:46: warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
361 | // Usa nossa função evaluateDocument que acessa os keyPathPredicates
362 | if self.evaluateDocument(doc) {
363 | continuation.yield(doc)
| |- warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'doc' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
364 | }
365 | }
[11/26] Compiling NyaruDB2 QueryPlanner.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:127:26: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
125 |
126 | // Usa um TaskGroup para executar a busca para cada valor do índice em paralelo
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
128 | for value in values {
129 | group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:23: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
128 | for value in values {
129 | group.addTask {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
130 | try await self.storage.fetchFromIndex(
131 | collection: self.collection,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:137:36: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
135 | }
136 | }
137 | return try await group.reduce(into: []) { $0 += $1 }
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
138 | }
139 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:130:44: warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
128 | for value in values {
129 | group.addTask {
130 | try await self.storage.fetchFromIndex(
| `- warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
131 | collection: self.collection,
132 | field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:162:26: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
160 |
161 |
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
163 | for shard in shards {
164 | group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:23: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
163 | for shard in shards {
164 | group.addTask {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
165 | let docs: [T] = try await shard.loadDocuments()
166 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:153:43: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
151 | private func executeHybrid(plan: ExecutionPlan) async throws -> [T] {
152 |
153 | let allShards = try await storage.getShardManagers(for: collection)
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
154 |
155 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:192:27: warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
17 | /// - planner: The query planner responsible for optimizing and executing the query.
18 | /// - keyPathPredicates: A list of key path-based predicates used to filter the data.
19 | public struct Query<T: Codable> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
20 | private let collection: String
21 | private var predicates: [(field: String, op: QueryOperator)] = []
:
190 |
191 | let stream: AsyncThrowingStream<T, Error> =
192 | await storage.fetchDocumentsLazy(from: collection)
| `- warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
193 | for try await doc in stream {
194 | if self.evaluateDocument(doc) {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:352:52: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
350 | do {
351 | // Obtém os shards da coleção
352 | let shards = try await storage.getShardManagers(
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
353 | for: collection
354 | )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:31: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
127 | return try await withThrowingTaskGroup(of: [T].self) { group in
128 | for value in values {
129 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
130 | try await self.storage.fetchFromIndex(
| `- note: closure captures 'self' which is accessible to code in the current task
131 | collection: self.collection,
132 | field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:31: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
162 | return try await withThrowingTaskGroup(of: [T].self) { group in
163 | for shard in shards {
164 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
165 | let docs: [T] = try await shard.loadDocuments()
166 |
167 | return docs.filter { self.evaluateDocument($0) }
| `- note: closure captures 'self' which is accessible to code in the current task
168 | }
169 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:349:18: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
347 | public func fetchStream(from storage: StorageEngine) -> AsyncThrowingStream<T, Error> {
348 | AsyncThrowingStream { continuation in
349 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
350 | do {
351 | // Obtém os shards da coleção
352 | let shards = try await storage.getShardManagers(
353 | for: collection
| `- note: closure captures 'self' which is accessible to code in the current task
354 | )
355 | // Itera sobre os shards
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:363:46: warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
361 | // Usa nossa função evaluateDocument que acessa os keyPathPredicates
362 | if self.evaluateDocument(doc) {
363 | continuation.yield(doc)
| |- warning: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'doc' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
364 | }
365 | }
[12/27] Compiling NyaruDB2 StatsEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:255:40: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
253 | {
254 |
255 | let shards = try await storage.getShardManagers(for: collection)
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
256 |
257 | var totalDocs = 0
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:321:46: warning: non-sendable result type '[String : IndexMetrics]' cannot be sent from actor-isolated context in call to instance method 'getMetrics()'; this is an error in the Swift 6 language mode
319 | var stats = [String: IndexStat]()
320 | for (collection, indexManager) in await storage.indexManagers {
321 | let metrics = await indexManager.getMetrics()
| `- warning: non-sendable result type '[String : IndexMetrics]' cannot be sent from actor-isolated context in call to instance method 'getMetrics()'; this is an error in the Swift 6 language mode
322 | let counts = await indexManager.getIndexCounts()
323 | var combinedTotalCount = 0
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:26:15: note: consider making struct 'IndexMetrics' conform to the 'Sendable' protocol
24 | /// - `valueDistribution`: A dictionary that tracks the distribution of values associated with the index,
25 | /// where the keys are the values and the values are their respective counts. Defaults to an empty dictionary.
26 | public struct IndexMetrics {
| `- note: consider making struct 'IndexMetrics' conform to the 'Sendable' protocol
27 | public var accessCount: Int = 0
28 | public var lastAccess: Date = .distantPast
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:370:43: warning: non-sendable type '[String : ShardManager]' of property 'activeShardManagers' cannot exit actor-isolated context; this is an error in the Swift 6 language mode
368 | public func getShardStats() async throws -> [ShardStat] {
369 | var shardStats = [ShardStat]()
370 | for (_, manager) in await storage.activeShardManagers {
| `- warning: non-sendable type '[String : ShardManager]' of property 'activeShardManagers' cannot exit actor-isolated context; this is an error in the Swift 6 language mode
371 | for shard in manager.allShards() {
372 | let stat = ShardStat(
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/ShardManager.swift:24:14: note: class 'ShardManager' does not conform to the 'Sendable' protocol
22 | /// - `fileProtectionType`: The file protection type applied to shard files.
23 | /// - `autoMergeTask`: An optional asynchronous task for automatically merging shards.
24 | public class ShardManager {
| `- note: class 'ShardManager' does not conform to the 'Sendable' protocol
25 | private var shards: [String: Shard] = [:]
26 | private let baseURL: URL
[13/27] Compiling NyaruDB2 ShardManager.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/ShardManager.swift:182:43: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
180 | /// of the shard manager.
181 | private func startAutoMergeProcess() {
182 | autoMergeTask = Task<Void, Never> { () async -> Void in
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
183 | while !Task.isCancelled {
184 | do {
185 | // Check and merge small shards (this is a placeholder for the actual merge logic)
186 | try await mergeSmallShards()
| `- note: closure captures 'self' which is accessible to code in the current task
187 | } catch {
188 | print("Auto-merge error: \(error)")
[14/27] Compiling NyaruDB2 DynamicDecoder.swift
[15/27] Compiling NyaruDB2 FileProtection.swift
[16/27] Compiling NyaruDB2 CollectionCatalog.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
7 | /// to ensure a single, globally accessible instance throughout the application.
8 |
9 | public class CollectionCatalog {
| `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
10 |
11 | public static let shared = CollectionCatalog()
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
12 |
13 | private var collections: [String: DocumentCollection] = [:]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:148:46: warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
140 | /// - Throws: An error if the fetch operation fails.
141 | /// - Note: The generic type `T` must conform to the `Codable` protocol.
142 | public func fetch<T: Codable>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
143 | query: [String: Any]? = nil,
144 | shardKey: String? = nil,
:
146 | ) async throws -> [T] {
147 | // Retrieve all documents from the collection (full scan)
148 | let results: [T] = try await storage.fetchDocuments(from: metadata.name)
| `- warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
149 |
150 | // Apply shard filtering if specified
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:203:40: warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
201 | /// - Note: The generic type `T` must conform to the `Codable` protocol.
202 | public func query<T: Codable>() async throws -> Query<T> {
203 | let indexStats = await statsEngine.getIndexStats() // Using StatsEngine directly.
| `- warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
204 | let shardStats = try await statsEngine.getShardStats()
205 | return Query<T>(collection: metadata.name,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
91 | /// - accessCount: The number of times the index has been accessed.
92 | /// - lastAccess: The date and time when the index was last accessed.
93 | public struct IndexStat {
| `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
94 | public var totalCount: Int
95 | public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:204:44: warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
202 | public func query<T: Codable>() async throws -> Query<T> {
203 | let indexStats = await statsEngine.getIndexStats() // Using StatsEngine directly.
204 | let shardStats = try await statsEngine.getShardStats()
| `- warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
205 | return Query<T>(collection: metadata.name,
206 | storage: storage,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | /// - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | /// The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
| `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 | public let docCount: Int
155 | public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:71:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
69 | public func insert<T: Codable>(_ document: T) async throws {
70 | let indexField = metadata.indexes.first
71 | try await storage.insertDocument(document, collection: metadata.name, indexField: indexField)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'insertDocument(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
72 | }
73 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:82:27: warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
80 | public func bulkInsert<T: Codable>(_ documents: [T]) async throws {
81 | let indexField = metadata.indexes.first
82 | try await storage.bulkInsertDocuments(documents, collection: metadata.name, indexField: indexField)
| |- warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'documents' to actor-isolated instance method 'bulkInsertDocuments(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
83 | }
84 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:130:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
128 | /// - Note: This method is asynchronous and must be called with `await`.
129 | public func update<T: Codable>(_ document: T, matching predicate: @escaping (T) -> Bool) async throws {
130 | try await storage.updateDocument(document, in: metadata.name, matching: predicate)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
131 | }
132 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:130:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
128 | /// - Note: This method is asynchronous and must be called with `await`.
129 | public func update<T: Codable>(_ document: T, matching predicate: @escaping (T) -> Bool) async throws {
130 | try await storage.updateDocument(document, in: metadata.name, matching: predicate)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
131 | }
132 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:194:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
192 | /// - Note: The `predicate` closure is executed asynchronously.
193 | public func delete<T: Codable>(where predicate: @escaping (T) -> Bool) async throws {
194 | try await storage.deleteDocuments(where: predicate, from: metadata.name)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'deleteDocuments(where:from:)' risks causing data races between actor-isolated and task-isolated uses
195 | }
196 |
[17/27] Compiling NyaruDB2 DocumentCollection.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
7 | /// to ensure a single, globally accessible instance throughout the application.
8 |
9 | public class CollectionCatalog {
| `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
10 |
11 | public static let shared = CollectionCatalog()
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
12 |
13 | private var collections: [String: DocumentCollection] = [:]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:148:46: warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
140 | /// - Throws: An error if the fetch operation fails.
141 | /// - Note: The generic type `T` must conform to the `Codable` protocol.
142 | public func fetch<T: Codable>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
143 | query: [String: Any]? = nil,
144 | shardKey: String? = nil,
:
146 | ) async throws -> [T] {
147 | // Retrieve all documents from the collection (full scan)
148 | let results: [T] = try await storage.fetchDocuments(from: metadata.name)
| `- warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
149 |
150 | // Apply shard filtering if specified
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:203:40: warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
201 | /// - Note: The generic type `T` must conform to the `Codable` protocol.
202 | public func query<T: Codable>() async throws -> Query<T> {
203 | let indexStats = await statsEngine.getIndexStats() // Using StatsEngine directly.
| `- warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
204 | let shardStats = try await statsEngine.getShardStats()
205 | return Query<T>(collection: metadata.name,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
91 | /// - accessCount: The number of times the index has been accessed.
92 | /// - lastAccess: The date and time when the index was last accessed.
93 | public struct IndexStat {
| `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
94 | public var totalCount: Int
95 | public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:204:44: warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
202 | public func query<T: Codable>() async throws -> Query<T> {
203 | let indexStats = await statsEngine.getIndexStats() // Using StatsEngine directly.
204 | let shardStats = try await statsEngine.getShardStats()
| `- warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
205 | return Query<T>(collection: metadata.name,
206 | storage: storage,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | /// - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | /// The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
| `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 | public let docCount: Int
155 | public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:71:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
69 | public func insert<T: Codable>(_ document: T) async throws {
70 | let indexField = metadata.indexes.first
71 | try await storage.insertDocument(document, collection: metadata.name, indexField: indexField)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'insertDocument(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
72 | }
73 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:82:27: warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
80 | public func bulkInsert<T: Codable>(_ documents: [T]) async throws {
81 | let indexField = metadata.indexes.first
82 | try await storage.bulkInsertDocuments(documents, collection: metadata.name, indexField: indexField)
| |- warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'documents' to actor-isolated instance method 'bulkInsertDocuments(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
83 | }
84 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:130:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
128 | /// - Note: This method is asynchronous and must be called with `await`.
129 | public func update<T: Codable>(_ document: T, matching predicate: @escaping (T) -> Bool) async throws {
130 | try await storage.updateDocument(document, in: metadata.name, matching: predicate)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
131 | }
132 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:130:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
128 | /// - Note: This method is asynchronous and must be called with `await`.
129 | public func update<T: Codable>(_ document: T, matching predicate: @escaping (T) -> Bool) async throws {
130 | try await storage.updateDocument(document, in: metadata.name, matching: predicate)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
131 | }
132 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:194:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
192 | /// - Note: The `predicate` closure is executed asynchronously.
193 | public func delete<T: Codable>(where predicate: @escaping (T) -> Bool) async throws {
194 | try await storage.deleteDocuments(where: predicate, from: metadata.name)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'deleteDocuments(where:from:)' risks causing data races between actor-isolated and task-isolated uses
195 | }
196 |
[18/27] Compiling NyaruDB2 BTreeIndex.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:98:25: warning: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
96 | return
97 | }
98 | await indexTree.insert(key: key, data: data)
| |- warning: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'key' to actor-isolated instance method 'insert(key:data:)' risks causing data races between actor-isolated and 'self'-isolated uses
99 | }
100 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:117:32: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
115 |
116 | guard let indexTree = indices[field] else { return [] }
117 | return await indexTree.search(key: value) ?? []
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'value' to actor-isolated instance method 'search(key:)' risks causing data races between actor-isolated and 'self'-isolated uses
118 | }
119 |
[19/27] Compiling NyaruDB2 IndexManager.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:98:25: warning: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
96 | return
97 | }
98 | await indexTree.insert(key: key, data: data)
| |- warning: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'key' to actor-isolated instance method 'insert(key:data:)' risks causing data races between actor-isolated and 'self'-isolated uses
99 | }
100 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:117:32: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
115 |
116 | guard let indexTree = indices[field] else { return [] }
117 | return await indexTree.search(key: value) ?? []
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'value' to actor-isolated instance method 'search(key:)' risks causing data races between actor-isolated and 'self'-isolated uses
118 | }
119 |
[20/27] Emitting module NyaruDB2
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
7 | /// to ensure a single, globally accessible instance throughout the application.
8 |
9 | public class CollectionCatalog {
| `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
10 |
11 | public static let shared = CollectionCatalog()
| |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
12 |
13 | private var collections: [String: DocumentCollection] = [:]
[21/27] Compiling NyaruDB2 NyaruDB2.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:150:34: warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
147 | /// - Returns: An array of decoded objects of type `T`.
148 | /// - Throws: An error if the fetch operation fails or if decoding the documents fails.
149 | public func fetch<T: Codable>(from collection: String) async throws -> [T] {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
150 | return try await storage.fetchDocuments(from: collection)
| `- warning: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
151 | }
152 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:166:23: warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
163 | ///
164 | /// - Note: The generic type `T` must conform to the `Codable` protocol.
165 | public func fetchLazy<T: Codable>(from collection: String) async -> AsyncThrowingStream<T, Error> {
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
166 | await storage.fetchDocumentsLazy(from: collection)
| `- warning: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
167 | }
168 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:222:38: warning: non-sendable result type 'CollectionStats' cannot be sent from actor-isolated context in call to instance method 'getCollectionStats'; this is an error in the Swift 6 language mode
220 | /// - Note: This function is asynchronous and must be awaited.
221 | public func getCollectionStats(for collection: String) async throws -> CollectionStats {
222 | return try await statsEngine.getCollectionStats(collection)
| `- warning: non-sendable result type 'CollectionStats' cannot be sent from actor-isolated context in call to instance method 'getCollectionStats'; this is an error in the Swift 6 language mode
223 | }
224 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:36:15: note: consider making struct 'CollectionStats' conform to the 'Sendable' protocol
34 | /// - totalSizeInBytes: The total size of the collection in bytes.
35 | /// - shardDetails: An array of metadata information for each shard.
36 | public struct CollectionStats: Codable {
| `- note: consider making struct 'CollectionStats' conform to the 'Sendable' protocol
37 | public let collectionName: String
38 | public let numberOfShards: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:234:38: warning: non-sendable result type 'GlobalStats' cannot be sent from actor-isolated context in call to instance method 'getGlobalStats()'; this is an error in the Swift 6 language mode
232 | /// - Throws: An error if the statistics retrieval fails.
233 | public func getGlobalStats() async throws -> GlobalStats {
234 | return try await statsEngine.getGlobalStats()
| `- warning: non-sendable result type 'GlobalStats' cannot be sent from actor-isolated context in call to instance method 'getGlobalStats()'; this is an error in the Swift 6 language mode
235 | }
236 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:75:15: note: consider making struct 'GlobalStats' conform to the 'Sendable' protocol
73 | /// - totalDocuments: The total number of documents across all collections.
74 | /// - totalSizeInBytes: The total size of the database in bytes.
75 | public struct GlobalStats: Codable {
| `- note: consider making struct 'GlobalStats' conform to the 'Sendable' protocol
76 | public let totalCollections: Int
77 | public let totalDocuments: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:244:34: warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
242 | /// - Throws: An error if the operation to fetch index statistics fails.
243 | public func getIndexStats() async throws -> [String: IndexStat] {
244 | return await statsEngine.getIndexStats()
| `- warning: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
245 | }
246 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
91 | /// - accessCount: The number of times the index has been accessed.
92 | /// - lastAccess: The date and time when the index was last accessed.
93 | public struct IndexStat {
| `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
94 | public var totalCount: Int
95 | public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:255:38: warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
253 | /// - Throws: An error if the statistics could not be retrieved.
254 | public func getShardStats() async throws -> [ShardStat] {
255 | return try await statsEngine.getShardStats()
| `- warning: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
256 | }
257 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | /// - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | /// The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
| `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 | public let docCount: Int
155 | public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:32:28: warning: sending 'compressionMethod' risks causing data races; this is an error in the Swift 6 language mode
30 | fileProtectionType: FileProtectionType = .none
31 | ) throws {
32 | self.storage = try StorageEngine(
| |- warning: sending 'compressionMethod' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'compressionMethod' to actor-isolated callee risks causing data races between actor-isolated and task-isolated uses
33 | path: path,
34 | compressionMethod: compressionMethod,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:32:28: warning: sending 'fileProtectionType' risks causing data races; this is an error in the Swift 6 language mode
30 | fileProtectionType: FileProtectionType = .none
31 | ) throws {
32 | self.storage = try StorageEngine(
| |- warning: sending 'fileProtectionType' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'fileProtectionType' to actor-isolated callee risks causing data races between actor-isolated and task-isolated uses
33 | path: path,
34 | compressionMethod: compressionMethod,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:85:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
83 | indexField: String? = nil
84 | ) async throws {
85 | try await storage.insertDocument(document, collection: collection, indexField: indexField)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'insertDocument(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
86 | }
87 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:102:27: warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
100 | indexField: String? = nil
101 | ) async throws {
102 | try await storage.bulkInsertDocuments(documents, collection: collection, indexField: indexField)
| |- warning: sending 'documents' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'documents' to actor-isolated instance method 'bulkInsertDocuments(_:collection:indexField:)' risks causing data races between actor-isolated and task-isolated uses
103 | }
104 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:124:27: warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
122 | indexField: String? = nil
123 | ) async throws {
124 | try await storage.updateDocument(document, in: collection, matching: predicate, indexField: indexField)
| |- warning: sending 'document' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'document' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
125 | }
126 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:124:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
122 | indexField: String? = nil
123 | ) async throws {
124 | try await storage.updateDocument(document, in: collection, matching: predicate, indexField: indexField)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'updateDocument(_:in:matching:indexField:)' risks causing data races between actor-isolated and task-isolated uses
125 | }
126 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:140:27: warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
138 | from collection: String
139 | ) async throws {
140 | try await storage.deleteDocuments(where: predicate, from: collection)
| |- warning: sending 'predicate' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'predicate' to actor-isolated instance method 'deleteDocuments(where:from:)' risks causing data races between actor-isolated and task-isolated uses
141 | }
142 |
[22/31] Compiling QuickStartRunner QuickStart.swift
[23/31] Emitting module QuickStartRunner
[23/31] Write Objects.LinkFileList
[25/31] Compiling Benchmark Benchmark.swift
/Users/admin/builder/spi-builder-workspace/Sources/Benchmark/Benchmark.swift:232:51: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
230 | let targetPartition = "Test"
231 |
232 | let shards = try await db.storage.getShardManagers(for: "test")
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
233 | .filter { $0.id == targetPartition }
234 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/Benchmark/Benchmark.swift:5:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'NyaruDB2'
3 | #endif
4 | import Foundation
5 | import NyaruDB2
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'NyaruDB2'
6 |
7 |
/Users/admin/builder/spi-builder-workspace/Sources/Benchmark/Benchmark.swift:281:51: warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
279 |
280 | let targetPartition = "Test"
281 | let shards = try await db.storage.getShardManagers(for: "test")
| `- warning: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
282 | .filter { $0.id == targetPartition }
283 | guard !shards.isEmpty else {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
44 | /// - `fileProtectionType`: The file protection level applied to the shard's storage.
45 | /// - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
46 | public class Shard {
| `- note: class 'Shard' does not conform to the 'Sendable' protocol
47 | public let id: String
48 | public let url: URL
[26/31] Emitting module Benchmark
[26/31] Write Objects.LinkFileList
[27/31] Linking QuickStartRunner
[28/31] Applying QuickStartRunner
[29/31] Linking Benchmark
[30/31] Applying Benchmark
Build complete! (6.52s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "NyaruDB2",
"name" : "NyaruDB2",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "ios",
"version" : "15.0"
},
{
"name" : "macos",
"version" : "12.0"
}
],
"products" : [
{
"name" : "NyaruDB2",
"targets" : [
"NyaruDB2"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "QuickStartRunner",
"targets" : [
"QuickStartRunner"
],
"type" : {
"executable" : null
}
},
{
"name" : "Benchmark",
"targets" : [
"Benchmark"
],
"type" : {
"executable" : null
}
}
],
"targets" : [
{
"c99name" : "QuickStartRunner",
"module_type" : "SwiftTarget",
"name" : "QuickStartRunner",
"path" : "Sources/QuickStart",
"product_memberships" : [
"QuickStartRunner"
],
"sources" : [
"QuickStart.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "executable"
},
{
"c99name" : "NyaruDB2Tests",
"module_type" : "SwiftTarget",
"name" : "NyaruDB2Tests",
"path" : "Tests/NyaruDB2Tests",
"sources" : [
"BTreeIndexPersistenceTest.swift",
"BTreeIndexTest.swift",
"CollectionCatalog.swift",
"CompressionMethodTest.swift",
"DocumentCollectionCRUDTest.swift",
"IndexManagerTest.swift",
"NyaruDB2Test.swift",
"PersistenceLifecycleTest.swift",
"QueryEngineIndexTest.swift",
"QueryEngineTest.swift",
"ShardManagerTest.swift",
"StatsEngineTest.swift",
"StorageEngineTest.swift",
"StorageRepartitionCollectionTest.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "test"
},
{
"c99name" : "NyaruDB2",
"module_type" : "SwiftTarget",
"name" : "NyaruDB2",
"path" : "Sources/NyaruDB2",
"product_memberships" : [
"NyaruDB2",
"QuickStartRunner",
"Benchmark"
],
"sources" : [
"Core/CollectionEngine/CollectionCatalog.swift",
"Core/CollectionEngine/DocumentCollection.swift",
"Core/Commons/DynamicDecoder.swift",
"Core/Commons/FileProtection.swift",
"Core/IndexManager/BTreeIndex.swift",
"Core/IndexManager/IndexManager.swift",
"Core/QueryEngine/QueryEngine.swift",
"Core/QueryEngine/QueryPlanner.swift",
"Core/ShardManager/CompressionMethod.swift",
"Core/ShardManager/Shard.swift",
"Core/ShardManager/ShardManager.swift",
"Core/StatsEngine/StatsEngine.swift",
"Core/StorageEngine/StorageEngine.swift",
"NyaruDB2.swift"
],
"type" : "library"
},
{
"c99name" : "Benchmark",
"module_type" : "SwiftTarget",
"name" : "Benchmark",
"path" : "Sources/Benchmark",
"product_memberships" : [
"Benchmark"
],
"sources" : [
"Benchmark.swift"
],
"target_dependencies" : [
"NyaruDB2"
],
"type" : "executable"
}
],
"tools_version" : "5.9"
}
Done.