The Swift Package Index logo.Swift Package Index

Has it really been five years since Swift Package Index launched? Read our anniversary blog post!

Build Information

Failed to build NyaruDB2, reference main (320682), with Swift 6.1 for Android on 30 May 2025 22:37:02 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-3":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.63.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/galileostudio/nyarudb2.git
Reference: main
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/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
========================================
Build
========================================
Selected platform:         android
Swift version:             6.1
Building package at path:  $PWD
https://github.com/galileostudio/nyarudb2.git
https://github.com/galileostudio/nyarudb2.git
WARNING: environment variable SUPPRESS_SWIFT_6_FLAGS is not set
{
  "dependencies" : [
  ],
  "manifest_display_name" : "NyaruDB2",
  "name" : "NyaruDB2",
  "path" : "/host/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 ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-3":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
android-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:fe1962677657b2408c217cb5cceb3c09bc1d91486e360cebbc6eee461a5945d8
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:android-6.1-latest
Building for debugging...
[0/11] Write sources
[3/11] Write swift-version-24593BA9C3E375BF.txt
[5/25] Compiling NyaruDB2 CompressionMethod.swift
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:52: error: cannot find 'COMPRESSION_LZFSE' in scope
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                    `- error: cannot find 'COMPRESSION_LZFSE' in scope
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: extraneous argument labels 'data:algorithm:' in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: missing arguments for parameters #3, #4 in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: missing arguments for parameters #3, #4 in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:52: error: cannot find 'COMPRESSION_LZ4' in scope
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                    `- error: cannot find 'COMPRESSION_LZ4' in scope
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: extraneous argument labels 'data:algorithm:' in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: missing arguments for parameters #3, #4 in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: missing arguments for parameters #3, #4 in call
 55 |     }
 56 | }
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:75:54: error: cannot find 'COMPRESSION_LZFSE' in scope
 73 |         return try gzipDecompress(data: data)
 74 |     case .lzfse:
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                      `- error: cannot find 'COMPRESSION_LZFSE' in scope
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:77:54: error: cannot find 'COMPRESSION_LZ4' in scope
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                      `- error: cannot find 'COMPRESSION_LZ4' in scope
 78 |     }
 79 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:98:18: error: cannot find 'compression_stream' in scope
 96 |     defer { destinationBuffer.deallocate() }
 97 |
 98 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
 99 |         dst_ptr: destinationBuffer,
100 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:106:16: error: 'nil' requires a contextual type
104 |         ),
105 |         src_size: data.count,
106 |         state: nil
    |                `- error: 'nil' requires a contextual type
107 |     )
108 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:110:22: error: cannot find 'compression_stream_init' in scope
108 |
109 |     // Inicializa o stream para codificação (compressão)
110 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:112:9: error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
110 |     let statusInit = compression_stream_init(
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
113 |         algorithm
114 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:115:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
113 |         algorithm
114 |     )
115 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:118:13: error: cannot find 'compression_stream_destroy' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
118 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
119 |
120 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:137:30: error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
135 |
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
    |                              `- error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
138 |             let status = compression_stream_process(&stream, flag)
139 |             switch status {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:138:26: error: cannot find 'compression_stream_process' in scope
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
138 |             let status = compression_stream_process(&stream, flag)
    |                          `- error: cannot find 'compression_stream_process' in scope
139 |             switch status {
140 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:146:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
144 |                     outputData.append(destinationBuffer, count: count)
145 |                 }
146 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
147 |                     return
148 |                 }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:177:18: error: cannot find 'compression_stream' in scope
175 |     defer { destinationBuffer.deallocate() }
176 |
177 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
178 |         dst_ptr: destinationBuffer,
179 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:185:16: error: 'nil' requires a contextual type
183 |         ),
184 |         src_size: data.count,
185 |         state: nil
    |                `- error: 'nil' requires a contextual type
186 |     )
187 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:188:22: error: cannot find 'compression_stream_init' in scope
186 |     )
187 |
188 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:190:9: error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
188 |     let statusInit = compression_stream_init(
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
191 |         algorithm
192 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:193:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
191 |         algorithm
192 |     )
193 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:196:13: error: cannot find 'compression_stream_destroy' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
196 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
197 |
198 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:214:26: error: cannot find 'compression_stream_process' in scope
212 |
213 |         while true {
214 |             let status = compression_stream_process(&stream, 0)
    |                          `- error: cannot find 'compression_stream_process' in scope
215 |             switch status {
216 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:221:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
219 |                     outputData.append(destinationBuffer, count: count)
220 |                 }
221 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
222 |                     return
223 |                 }
[6/25] Compiling NyaruDB2 Shard.swift
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:52: error: cannot find 'COMPRESSION_LZFSE' in scope
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                    `- error: cannot find 'COMPRESSION_LZFSE' in scope
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: extraneous argument labels 'data:algorithm:' in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: missing arguments for parameters #3, #4 in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: missing arguments for parameters #3, #4 in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:52: error: cannot find 'COMPRESSION_LZ4' in scope
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                    `- error: cannot find 'COMPRESSION_LZ4' in scope
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: extraneous argument labels 'data:algorithm:' in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: missing arguments for parameters #3, #4 in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: missing arguments for parameters #3, #4 in call
 55 |     }
 56 | }
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:75:54: error: cannot find 'COMPRESSION_LZFSE' in scope
 73 |         return try gzipDecompress(data: data)
 74 |     case .lzfse:
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                      `- error: cannot find 'COMPRESSION_LZFSE' in scope
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:77:54: error: cannot find 'COMPRESSION_LZ4' in scope
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                      `- error: cannot find 'COMPRESSION_LZ4' in scope
 78 |     }
 79 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:98:18: error: cannot find 'compression_stream' in scope
 96 |     defer { destinationBuffer.deallocate() }
 97 |
 98 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
 99 |         dst_ptr: destinationBuffer,
100 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:106:16: error: 'nil' requires a contextual type
104 |         ),
105 |         src_size: data.count,
106 |         state: nil
    |                `- error: 'nil' requires a contextual type
107 |     )
108 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:110:22: error: cannot find 'compression_stream_init' in scope
108 |
109 |     // Inicializa o stream para codificação (compressão)
110 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:112:9: error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
110 |     let statusInit = compression_stream_init(
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
113 |         algorithm
114 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:115:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
113 |         algorithm
114 |     )
115 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:118:13: error: cannot find 'compression_stream_destroy' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
118 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
119 |
120 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:137:30: error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
135 |
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
    |                              `- error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
138 |             let status = compression_stream_process(&stream, flag)
139 |             switch status {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:138:26: error: cannot find 'compression_stream_process' in scope
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
138 |             let status = compression_stream_process(&stream, flag)
    |                          `- error: cannot find 'compression_stream_process' in scope
139 |             switch status {
140 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:146:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
144 |                     outputData.append(destinationBuffer, count: count)
145 |                 }
146 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
147 |                     return
148 |                 }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:177:18: error: cannot find 'compression_stream' in scope
175 |     defer { destinationBuffer.deallocate() }
176 |
177 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
178 |         dst_ptr: destinationBuffer,
179 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:185:16: error: 'nil' requires a contextual type
183 |         ),
184 |         src_size: data.count,
185 |         state: nil
    |                `- error: 'nil' requires a contextual type
186 |     )
187 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:188:22: error: cannot find 'compression_stream_init' in scope
186 |     )
187 |
188 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:190:9: error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
188 |     let statusInit = compression_stream_init(
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
191 |         algorithm
192 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:193:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
191 |         algorithm
192 |     )
193 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:196:13: error: cannot find 'compression_stream_destroy' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
196 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
197 |
198 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:214:26: error: cannot find 'compression_stream_process' in scope
212 |
213 |         while true {
214 |             let status = compression_stream_process(&stream, 0)
    |                          `- error: cannot find 'compression_stream_process' in scope
215 |             switch status {
216 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:221:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
219 |                     outputData.append(destinationBuffer, count: count)
220 |                 }
221 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
222 |                     return
223 |                 }
[7/26] Compiling NyaruDB2 CollectionCatalog.swift
/host/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] = [:]
/host/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
/host/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,
/host/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
/host/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,
/host/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)]
/host/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 |
/host/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 |
/host/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 |
/host/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 |
/host/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 |
[8/26] Compiling NyaruDB2 DocumentCollection.swift
/host/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] = [:]
/host/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
/host/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,
/host/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
/host/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,
/host/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)]
/host/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 |
/host/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 |
/host/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 |
/host/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 |
/host/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 |
[9/26] Compiling NyaruDB2 ShardManager.swift
/host/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
/host/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
/host/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
/host/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
/host/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(
/host/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
/host/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)")
[10/26] Compiling NyaruDB2 StatsEngine.swift
/host/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
/host/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
/host/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
/host/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
/host/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(
/host/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
/host/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)")
error: emit-module command failed with exit code 1 (use -v to see invocation)
[11/26] Emitting module NyaruDB2
/host/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] = [:]
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
[12/26] Compiling NyaruDB2 StorageEngine.swift
/host/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 |
/host/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
/host/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 |         }
/host/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")
/host/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
/host/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 |
/host/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
/host/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 {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:367:33: warning: result of call to 'fileExists(atPath:isDirectory:)' is unused
365 |         let collections = items.filter { url in
366 |             var isDirectory: ObjCBool = false
367 |             FileManager.default.fileExists(
    |                                 `- warning: result of call to 'fileExists(atPath:isDirectory:)' is unused
368 |                 atPath: url.path,
369 |                 isDirectory: &isDirectory
/host/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 |             )
/host/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
/host/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) }
/host/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) }
/host/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 |     }
/host/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 |
/host/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>()
/host/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 |         }
/host/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) }
/host/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()
/host/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) }
/host/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) }
/host/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")
/host/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 |
/host/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>()
/host/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(
/host/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(
/host/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()
/host/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()
/host/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 |             )
/host/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)
/host/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 |
/host/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) }
[13/26] Compiling NyaruDB2 BTreeIndex.swift
/host/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 |
/host/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 |
[14/26] Compiling NyaruDB2 IndexManager.swift
/host/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 |
/host/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 |
[15/26] Compiling NyaruDB2 DynamicDecoder.swift
[16/26] Compiling NyaruDB2 FileProtection.swift
[17/26] Compiling NyaruDB2 QueryEngine.swift
/host/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 {
/host/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,
/host/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 |     }
/host/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,
/host/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 {
/host/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 |
/host/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 |
/host/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
/host/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) {
/host/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 |                     )
/host/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
/host/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,
/host/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 |             }
/host/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
/host/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 |                         }
[18/26] Compiling NyaruDB2 QueryPlanner.swift
/host/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 {
/host/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,
/host/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 |     }
/host/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,
/host/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 {
/host/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 |
/host/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 |
/host/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
/host/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) {
/host/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 |                     )
/host/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
/host/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,
/host/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 |             }
/host/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
/host/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 |                         }
[19/26] Compiling NyaruDB2 NyaruDB2.swift
/host/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 |
/host/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 |
/host/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 |
/host/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
/host/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 |
/host/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
/host/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 |
/host/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
/host/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 | }
/host/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)]
/host/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,
/host/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,
/host/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 |
/host/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 |
/host/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 |
/host/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 |
/host/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 |
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-3":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 2>&1
android-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:fe1962677657b2408c217cb5cceb3c09bc1d91486e360cebbc6eee461a5945d8
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:android-6.1-latest
[0/1] Planning build
Building for debugging...
[0/8] Write swift-version-24593BA9C3E375BF.txt
[2/22] Compiling NyaruDB2 CompressionMethod.swift
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:52: error: cannot find 'COMPRESSION_LZFSE' in scope
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                    `- error: cannot find 'COMPRESSION_LZFSE' in scope
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: extraneous argument labels 'data:algorithm:' in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: missing arguments for parameters #3, #4 in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: missing arguments for parameters #3, #4 in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:52: error: cannot find 'COMPRESSION_LZ4' in scope
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                    `- error: cannot find 'COMPRESSION_LZ4' in scope
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: extraneous argument labels 'data:algorithm:' in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: missing arguments for parameters #3, #4 in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: missing arguments for parameters #3, #4 in call
 55 |     }
 56 | }
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:75:54: error: cannot find 'COMPRESSION_LZFSE' in scope
 73 |         return try gzipDecompress(data: data)
 74 |     case .lzfse:
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                      `- error: cannot find 'COMPRESSION_LZFSE' in scope
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:77:54: error: cannot find 'COMPRESSION_LZ4' in scope
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                      `- error: cannot find 'COMPRESSION_LZ4' in scope
 78 |     }
 79 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:98:18: error: cannot find 'compression_stream' in scope
 96 |     defer { destinationBuffer.deallocate() }
 97 |
 98 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
 99 |         dst_ptr: destinationBuffer,
100 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:106:16: error: 'nil' requires a contextual type
104 |         ),
105 |         src_size: data.count,
106 |         state: nil
    |                `- error: 'nil' requires a contextual type
107 |     )
108 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:110:22: error: cannot find 'compression_stream_init' in scope
108 |
109 |     // Inicializa o stream para codificação (compressão)
110 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:112:9: error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
110 |     let statusInit = compression_stream_init(
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
113 |         algorithm
114 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:115:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
113 |         algorithm
114 |     )
115 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:118:13: error: cannot find 'compression_stream_destroy' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
118 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
119 |
120 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:137:30: error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
135 |
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
    |                              `- error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
138 |             let status = compression_stream_process(&stream, flag)
139 |             switch status {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:138:26: error: cannot find 'compression_stream_process' in scope
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
138 |             let status = compression_stream_process(&stream, flag)
    |                          `- error: cannot find 'compression_stream_process' in scope
139 |             switch status {
140 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:146:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
144 |                     outputData.append(destinationBuffer, count: count)
145 |                 }
146 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
147 |                     return
148 |                 }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:177:18: error: cannot find 'compression_stream' in scope
175 |     defer { destinationBuffer.deallocate() }
176 |
177 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
178 |         dst_ptr: destinationBuffer,
179 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:185:16: error: 'nil' requires a contextual type
183 |         ),
184 |         src_size: data.count,
185 |         state: nil
    |                `- error: 'nil' requires a contextual type
186 |     )
187 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:188:22: error: cannot find 'compression_stream_init' in scope
186 |     )
187 |
188 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:190:9: error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
188 |     let statusInit = compression_stream_init(
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
191 |         algorithm
192 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:193:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
191 |         algorithm
192 |     )
193 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:196:13: error: cannot find 'compression_stream_destroy' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
196 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
197 |
198 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:214:26: error: cannot find 'compression_stream_process' in scope
212 |
213 |         while true {
214 |             let status = compression_stream_process(&stream, 0)
    |                          `- error: cannot find 'compression_stream_process' in scope
215 |             switch status {
216 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:221:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
219 |                     outputData.append(destinationBuffer, count: count)
220 |                 }
221 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
222 |                     return
223 |                 }
[3/22] Compiling NyaruDB2 Shard.swift
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:52: error: cannot find 'COMPRESSION_LZFSE' in scope
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                    `- error: cannot find 'COMPRESSION_LZFSE' in scope
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: extraneous argument labels 'data:algorithm:' in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:28: error: missing arguments for parameters #3, #4 in call
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                            `- error: missing arguments for parameters #3, #4 in call
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:52:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 50 |         return try gzipCompress(data: data)
 51 |     case .lzfse:
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:52: error: cannot find 'COMPRESSION_LZ4' in scope
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                    `- error: cannot find 'COMPRESSION_LZ4' in scope
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:20: error: cannot convert return expression of type 'Int32' to return type 'Data'
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                    `- error: cannot convert return expression of type 'Int32' to return type 'Data'
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: extraneous argument labels 'data:algorithm:' in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: extraneous argument labels 'data:algorithm:' in call
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:28: error: missing arguments for parameters #3, #4 in call
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                            `- error: missing arguments for parameters #3, #4 in call
 55 |     }
 56 | }
/root/.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/include/zlib.h:1278:21: note: 'compress' declared here
1276 | */
1277 |
1278 | ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
     |                     `- note: 'compress' declared here
1279 |                              const Bytef *source, uLong sourceLen);
1280 | /*
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:54:35: error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 52 |         return try compress(data: data, algorithm: COMPRESSION_LZFSE)
 53 |     case .lz4:
 54 |         return try compress(data: data, algorithm: COMPRESSION_LZ4)
    |                                   `- error: cannot convert value of type 'Data' to expected argument type 'UnsafeMutablePointer<Bytef>' (aka 'UnsafeMutablePointer<UInt8>')
 55 |     }
 56 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:75:54: error: cannot find 'COMPRESSION_LZFSE' in scope
 73 |         return try gzipDecompress(data: data)
 74 |     case .lzfse:
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
    |                                                      `- error: cannot find 'COMPRESSION_LZFSE' in scope
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:77:54: error: cannot find 'COMPRESSION_LZ4' in scope
 75 |         return try decompress(data: data, algorithm: COMPRESSION_LZFSE)
 76 |     case .lz4:
 77 |         return try decompress(data: data, algorithm: COMPRESSION_LZ4)
    |                                                      `- error: cannot find 'COMPRESSION_LZ4' in scope
 78 |     }
 79 | }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:98:18: error: cannot find 'compression_stream' in scope
 96 |     defer { destinationBuffer.deallocate() }
 97 |
 98 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
 99 |         dst_ptr: destinationBuffer,
100 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:106:16: error: 'nil' requires a contextual type
104 |         ),
105 |         src_size: data.count,
106 |         state: nil
    |                `- error: 'nil' requires a contextual type
107 |     )
108 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:110:22: error: cannot find 'compression_stream_init' in scope
108 |
109 |     // Inicializa o stream para codificação (compressão)
110 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:112:9: error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
110 |     let statusInit = compression_stream_init(
111 |         &stream,
112 |         COMPRESSION_STREAM_ENCODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_ENCODE' in scope
113 |         algorithm
114 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:115:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
113 |         algorithm
114 |     )
115 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:118:13: error: cannot find 'compression_stream_destroy' in scope
116 |         throw CompressionError.compressionFailed
117 |     }
118 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
119 |
120 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:137:30: error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
135 |
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
    |                              `- error: cannot find 'COMPRESSION_STREAM_FINALIZE' in scope
138 |             let status = compression_stream_process(&stream, flag)
139 |             switch status {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:138:26: error: cannot find 'compression_stream_process' in scope
136 |         while true {
137 |             let flag = Int32(COMPRESSION_STREAM_FINALIZE.rawValue)
138 |             let status = compression_stream_process(&stream, flag)
    |                          `- error: cannot find 'compression_stream_process' in scope
139 |             switch status {
140 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:146:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
144 |                     outputData.append(destinationBuffer, count: count)
145 |                 }
146 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
147 |                     return
148 |                 }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:177:18: error: cannot find 'compression_stream' in scope
175 |     defer { destinationBuffer.deallocate() }
176 |
177 |     var stream = compression_stream(
    |                  `- error: cannot find 'compression_stream' in scope
178 |         dst_ptr: destinationBuffer,
179 |         dst_size: dstBufferSize,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:185:16: error: 'nil' requires a contextual type
183 |         ),
184 |         src_size: data.count,
185 |         state: nil
    |                `- error: 'nil' requires a contextual type
186 |     )
187 |
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:188:22: error: cannot find 'compression_stream_init' in scope
186 |     )
187 |
188 |     let statusInit = compression_stream_init(
    |                      `- error: cannot find 'compression_stream_init' in scope
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:190:9: error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
188 |     let statusInit = compression_stream_init(
189 |         &stream,
190 |         COMPRESSION_STREAM_DECODE,
    |         `- error: cannot find 'COMPRESSION_STREAM_DECODE' in scope
191 |         algorithm
192 |     )
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:193:25: error: cannot find 'COMPRESSION_STATUS_OK' in scope
191 |         algorithm
192 |     )
193 |     guard statusInit == COMPRESSION_STATUS_OK else {
    |                         `- error: cannot find 'COMPRESSION_STATUS_OK' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:196:13: error: cannot find 'compression_stream_destroy' in scope
194 |         throw CompressionError.decompressionFailed
195 |     }
196 |     defer { compression_stream_destroy(&stream) }
    |             `- error: cannot find 'compression_stream_destroy' in scope
197 |
198 |     var outputData = Data()
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:214:26: error: cannot find 'compression_stream_process' in scope
212 |
213 |         while true {
214 |             let status = compression_stream_process(&stream, 0)
    |                          `- error: cannot find 'compression_stream_process' in scope
215 |             switch status {
216 |             case COMPRESSION_STATUS_OK, COMPRESSION_STATUS_END:
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:221:30: error: cannot find 'COMPRESSION_STATUS_END' in scope
219 |                     outputData.append(destinationBuffer, count: count)
220 |                 }
221 |                 if status == COMPRESSION_STATUS_END {
    |                              `- error: cannot find 'COMPRESSION_STATUS_END' in scope
222 |                     return
223 |                 }
[4/23] Compiling NyaruDB2 NyaruDB2.swift
[5/23] Compiling NyaruDB2 StorageEngine.swift
/host/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:367:33: warning: result of call to 'fileExists(atPath:isDirectory:)' is unused
365 |         let collections = items.filter { url in
366 |             var isDirectory: ObjCBool = false
367 |             FileManager.default.fileExists(
    |                                 `- warning: result of call to 'fileExists(atPath:isDirectory:)' is unused
368 |                 atPath: url.path,
369 |                 isDirectory: &isDirectory
error: emit-module command failed with exit code 1 (use -v to see invocation)
[6/23] Compiling NyaruDB2 CollectionCatalog.swift
[7/23] Compiling NyaruDB2 DocumentCollection.swift
[8/23] Compiling NyaruDB2 BTreeIndex.swift
[9/23] Compiling NyaruDB2 IndexManager.swift
[10/23] Compiling NyaruDB2 QueryEngine.swift
[11/23] Compiling NyaruDB2 QueryPlanner.swift
[12/23] Emitting module NyaruDB2
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:89:46: error: cannot find type 'compression_algorithm' in scope
 87 | /// - Returns: A `Data` object containing the compressed data.
 88 | /// - Throws: An error if the compression process fails.
 89 | private func compress(data: Data, algorithm: compression_algorithm) throws
    |                                              `- error: cannot find type 'compression_algorithm' in scope
 90 |     -> Data
 91 | {
/host/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/CompressionMethod.swift:167:48: error: cannot find type 'compression_algorithm' in scope
165 | /// - Returns: The decompressed data.
166 | /// - Throws: An error if the decompression process fails.
167 | private func decompress(data: Data, algorithm: compression_algorithm) throws
    |                                                `- error: cannot find type 'compression_algorithm' in scope
168 |     -> Data
169 | {
[13/23] Compiling NyaruDB2 DynamicDecoder.swift
[14/23] Compiling NyaruDB2 FileProtection.swift
[15/23] Compiling NyaruDB2 ShardManager.swift
[16/23] Compiling NyaruDB2 StatsEngine.swift
BUILD FAILURE 6.1 android