The Swift Package Index logo.Swift Package Index

Track the adoption of Swift 6 strict concurrency checks for data race safety. How many packages are Ready for Swift 6?

Build Information

Failed to build LLM, reference main (59da7c), with Swift 6.0 for Linux on 6 Nov 2024 18:20:56 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/eastriverlee/LLM.swift.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/eastriverlee/LLM.swift
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 59da7ca Merge pull request #37 from eastriverlee/35-package-is-broken-due-to-llamacpp-sampling-v2-api-change
Cloned https://github.com/eastriverlee/LLM.swift.git
Revision (git rev-parse @):
59da7ca14c78e039b426f871893e5dfd10e02cfc
SUCCESS checkout https://github.com/eastriverlee/LLM.swift.git at main
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $PWD
https://github.com/eastriverlee/LLM.swift.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Fetching https://github.com/ggerganov/llama.cpp/
[1/124601] Fetching llama.cpp
Fetched https://github.com/ggerganov/llama.cpp/ from cache (22.22s)
Fetching https://github.com/kishikawakatsumi/swift-power-assert
[1/5089] Fetching swift-power-assert
Fetched https://github.com/kishikawakatsumi/swift-power-assert from cache (0.45s)
Computing version for https://github.com/kishikawakatsumi/swift-power-assert
Computed https://github.com/kishikawakatsumi/swift-power-assert at 0.12.0 (0.39s)
Fetching https://github.com/apple/swift-syntax.git
[1/66379] Fetching swift-syntax
Fetched https://github.com/apple/swift-syntax.git from cache (4.22s)
Computing version for https://github.com/apple/swift-syntax.git
Computed https://github.com/apple/swift-syntax.git at 509.1.1 (0.57s)
Creating working copy for https://github.com/apple/swift-syntax.git
Working copy of https://github.com/apple/swift-syntax.git resolved at 509.1.1
Creating working copy for https://github.com/kishikawakatsumi/swift-power-assert
Working copy of https://github.com/kishikawakatsumi/swift-power-assert resolved at 0.12.0
Creating working copy for https://github.com/ggerganov/llama.cpp/
Working copy of https://github.com/ggerganov/llama.cpp/ resolved at master (5c333e0)
Building for debugging...
[0/14] Compiling ggml-alloc.c
[0/14] Write swift-version-24593BA9C3E375BF.txt
[2/14] Compiling ggml-backend.cpp
[3/14] Compiling llama-grammar.cpp
[4/14] Compiling ggml.c
[5/14] Compiling unicode-data.cpp
[6/14] Write sources
[7/14] Compiling llama-sampling.cpp
[8/14] Compiling ggml-aarch64.c
[9/14] Compiling llama-vocab.cpp
[10/14] Compiling ggml-quants.c
[11/14] Compiling ggml-cpu.c
[12/14] Compiling unicode.cpp
[13/14] Compiling llama.cpp
error: emit-module command failed with exit code 1 (use -v to see invocation)
[15/16] Emitting module LLM
/host/spi-builder-workspace/Sources/LLM/LLM.swift:44:6: error: unknown attribute 'Published'
 42 |     public var path: [CChar]
 43 |
 44 |     @Published public private(set) var output = ""
    |      `- error: unknown attribute 'Published'
 45 |     @MainActor public func setOutput(to newOutput: consuming String) {
 46 |         output = newOutput
/host/spi-builder-workspace/Sources/LLM/LLM.swift:12:17: error: cannot find type 'ObservableObject' in scope
 10 | }
 11 |
 12 | open class LLM: ObservableObject {
    |                 `- error: cannot find type 'ObservableObject' in scope
 13 |     public var model: Model
 14 |     public var history: [Chat]
/host/spi-builder-workspace/Sources/LLM/LLM.swift:559:23: warning: static property 'mistral' is not concurrency-safe because non-'Sendable' type 'Template' may have shared mutable state; this is an error in the Swift 6 language mode
474 | }
475 |
476 | public struct Template {
    |               `- note: consider making struct 'Template' conform to the 'Sendable' protocol
477 |     public typealias Attachment = (prefix: String, suffix: String)
478 |     public let system: Attachment
    :
557 |     }
558 |
559 |     public static let mistral = Template(
    |                       |- warning: static property 'mistral' is not concurrency-safe because non-'Sendable' type 'Template' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'mistral' with '@MainActor' if property should only be accessed from the main actor
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
560 |         user: ("[INST] ", " [/INST]"),
561 |         bot: ("", "</s> "),
/host/spi-builder-workspace/Sources/LLM/LLM.swift:262:24: warning: static property 'stopSequenceEndIndex' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
260 |     private func process(_ token: Token, to output: borrowing AsyncStream<String>.Continuation) -> Bool {
261 |         struct saved {
262 |             static var stopSequenceEndIndex = 0
    |                        |- warning: static property 'stopSequenceEndIndex' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'stopSequenceEndIndex' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'stopSequenceEndIndex' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
263 |             static var letters: [CChar] = []
264 |         }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:263:24: warning: static property 'letters' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
261 |         struct saved {
262 |             static var stopSequenceEndIndex = 0
263 |             static var letters: [CChar] = []
    |                        |- warning: static property 'letters' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'letters' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'letters' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
264 |         }
265 |         guard token != model.endToken else { return false }
[16/16] Compiling LLM LLM.swift
<module-includes>:1:10: note: in file included from <module-includes>:1:
1 | #include "/host/spi-builder-workspace/.build/checkouts/llama.cpp/spm-headers/llama.h"
  |          `- note: in file included from <module-includes>:1:
2 |
/host/spi-builder-workspace/.build/checkouts/llama.cpp/spm-headers/llama.h: 0:
<module-includes>:1:10: note: in file included from <module-includes>:1:
1 | #include "/host/spi-builder-workspace/.build/checkouts/llama.cpp/spm-headers/llama.h"
  |          `- note: in file included from <module-includes>:1:
2 |
/host/spi-builder-workspace/.build/checkouts/llama.cpp/spm-headers/llama.h: 0:
/host/spi-builder-workspace/Sources/LLM/LLM.swift:44:6: error: unknown attribute 'Published'
 42 |     public var path: [CChar]
 43 |
 44 |     @Published public private(set) var output = ""
    |      `- error: unknown attribute 'Published'
 45 |     @MainActor public func setOutput(to newOutput: consuming String) {
 46 |         output = newOutput
/host/spi-builder-workspace/Sources/LLM/LLM.swift:12:17: error: cannot find type 'ObservableObject' in scope
 10 | }
 11 |
 12 | open class LLM: ObservableObject {
    |                 `- error: cannot find type 'ObservableObject' in scope
 13 |     public var model: Model
 14 |     public var history: [Chat]
/host/spi-builder-workspace/Sources/LLM/LLM.swift:559:23: warning: static property 'mistral' is not concurrency-safe because non-'Sendable' type 'Template' may have shared mutable state; this is an error in the Swift 6 language mode
474 | }
475 |
476 | public struct Template {
    |               `- note: consider making struct 'Template' conform to the 'Sendable' protocol
477 |     public typealias Attachment = (prefix: String, suffix: String)
478 |     public let system: Attachment
    :
557 |     }
558 |
559 |     public static let mistral = Template(
    |                       |- warning: static property 'mistral' is not concurrency-safe because non-'Sendable' type 'Template' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'mistral' with '@MainActor' if property should only be accessed from the main actor
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
560 |         user: ("[INST] ", " [/INST]"),
561 |         bot: ("", "</s> "),
/host/spi-builder-workspace/Sources/LLM/LLM.swift:78:36: error: 'ProcessInfo' initializer is inaccessible due to 'internal' protection level
 76 |         let model = llama_load_model_from_file(self.path, modelParams)!
 77 |         params = llama_context_default_params()
 78 |         let processorCount = Int32(ProcessInfo().processorCount)
    |                                    `- error: 'ProcessInfo' initializer is inaccessible due to 'internal' protection level
 79 |         self.maxTokenCount = Int(min(maxTokenCount, llama_n_ctx_train(model)))
 80 |         params.n_ctx = UInt32(self.maxTokenCount)
FoundationEssentials.ProcessInfo (internal):4:14: note: 'init()' declared here
2 |     public static let processInfo: ProcessInfo
3 |     deinit
4 |     internal init()
  |              `- note: 'init()' declared here
5 | }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:140:42: warning: capture of 'updateProgress' with non-sendable type '(Double) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
138 |     ) async throws {
139 |         let url = try await huggingFaceModel.download(to: url, as: name) { progress in
140 |             Task { await MainActor.run { updateProgress(progress) } }
    |                                          |- warning: capture of 'updateProgress' with non-sendable type '(Double) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
    |                                          `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
141 |         }
142 |         self.init(
/host/spi-builder-workspace/Sources/LLM/LLM.swift:262:24: warning: static property 'stopSequenceEndIndex' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
260 |     private func process(_ token: Token, to output: borrowing AsyncStream<String>.Continuation) -> Bool {
261 |         struct saved {
262 |             static var stopSequenceEndIndex = 0
    |                        |- warning: static property 'stopSequenceEndIndex' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'stopSequenceEndIndex' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'stopSequenceEndIndex' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
263 |             static var letters: [CChar] = []
264 |         }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:263:24: warning: static property 'letters' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
261 |         struct saved {
262 |             static var stopSequenceEndIndex = 0
263 |             static var letters: [CChar] = []
    |                        |- warning: static property 'letters' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'letters' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'letters' with '@MainActor' if property should only be accessed from the main actor
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
264 |         }
265 |         guard token != model.endToken else { return false }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:668:53: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
666 |     fileprivate var exists: Bool { FileManager.default.fileExists(atPath: path) }
667 |     fileprivate func getData() async throws -> Data {
668 |         let (data, response) = try await URLSession.shared.data(from: self)
    |                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
669 |         let statusCode = (response as! HTTPURLResponse).statusCode
670 |         guard statusCode / 100 == 2 else { throw HuggingFaceError.network(statusCode: statusCode) }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:669:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
667 |     fileprivate func getData() async throws -> Data {
668 |         let (data, response) = try await URLSession.shared.data(from: self)
669 |         let statusCode = (response as! HTTPURLResponse).statusCode
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
670 |         guard statusCode / 100 == 2 else { throw HuggingFaceError.network(statusCode: statusCode) }
671 |         return data
/host/spi-builder-workspace/Sources/LLM/LLM.swift:674:26: error: cannot find type 'NSKeyValueObservation' in scope
672 |     }
673 |     fileprivate func downloadData(to destination: URL, _ updateProgress: @escaping (Double) -> Void) async throws {
674 |         var observation: NSKeyValueObservation!
    |                          `- error: cannot find type 'NSKeyValueObservation' in scope
675 |         let url: URL = try await withCheckedThrowingContinuation { continuation in
676 |             let task = URLSession.shared.downloadTask(with: self) { url, response, error in
/host/spi-builder-workspace/Sources/LLM/LLM.swift:676:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
674 |         var observation: NSKeyValueObservation!
675 |         let url: URL = try await withCheckedThrowingContinuation { continuation in
676 |             let task = URLSession.shared.downloadTask(with: self) { url, response, error in
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
677 |                 if let error { return continuation.resume(throwing: error) }
678 |                 guard let url else { return continuation.resume(throwing: HuggingFaceError.urlIsNilForSomeReason) }
/host/spi-builder-workspace/Sources/LLM/LLM.swift:679:65: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
677 |                 if let error { return continuation.resume(throwing: error) }
678 |                 guard let url else { return continuation.resume(throwing: HuggingFaceError.urlIsNilForSomeReason) }
679 |                 let statusCode = (response as! HTTPURLResponse).statusCode
    |                                                                 `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
680 |                 guard statusCode / 100 == 2 else { return continuation.resume(throwing: HuggingFaceError.network(statusCode: statusCode)) }
681 |                 continuation.resume(returning: url)
BUILD FAILURE 6.0 linux