The Swift Package Index logo.Swift Package Index

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

Build Information

Successful build of KMPObservableViewModel, reference master (fadba0), with Swift 6.0 for macOS (SPM) on 25 Sep 2024 21:13:20 UTC.

Swift 6 data race errors: 1

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.0.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete

Build Log

========================================
RunAll
========================================
Builder version: 4.54.2
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/rickclephas/KMP-ObservableViewModel.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/rickclephas/KMP-ObservableViewModel
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at fadba04 Update compatibility info
Cloned https://github.com/rickclephas/KMP-ObservableViewModel.git
Revision (git rev-parse @):
fadba0435ae50e013ec622421a48884756bfd7c6
SUCCESS checkout https://github.com/rickclephas/KMP-ObservableViewModel.git at master
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/rickclephas/KMP-ObservableViewModel.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.0.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Building for debugging...
[0/4] Write sources
[2/4] Compiling KMPObservableViewModelCoreObjC KMPObservableViewModelCoreObjC.m
[3/4] Write swift-version--4A847ED0836F2485.txt
[5/10] Compiling KMPObservableViewModelCore ViewModel.swift
[6/10] Compiling KMPObservableViewModelCore ObservableViewModel.swift
[7/10] Compiling KMPObservableViewModelCore ChildViewModels.swift
[8/10] Emitting module KMPObservableViewModelCore
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelCore/ObservableViewModelPublishers.swift:10:13: warning: var 'observableViewModelPublishersKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 8 | import Foundation
 9 |
10 | private var observableViewModelPublishersKey: Void?
   |             |- warning: var 'observableViewModelPublishersKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |             |- note: convert 'observableViewModelPublishersKey' to a 'let' constant to make 'Sendable' shared state immutable
   |             |- note: annotate 'observableViewModelPublishersKey' 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
11 |
12 | private class WeakObservableViewModelPublishers {
[9/10] Compiling KMPObservableViewModelCore ObservableViewModelPublishers.swift
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelCore/ObservableViewModelPublishers.swift:10:13: warning: var 'observableViewModelPublishersKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 8 | import Foundation
 9 |
10 | private var observableViewModelPublishersKey: Void?
   |             |- warning: var 'observableViewModelPublishersKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |             |- note: convert 'observableViewModelPublishersKey' to a 'let' constant to make 'Sendable' shared state immutable
   |             |- note: annotate 'observableViewModelPublishersKey' 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
11 |
12 | private class WeakObservableViewModelPublishers {
[10/10] Compiling KMPObservableViewModelCore ObservableViewModelPublisher.swift
[11/15] Compiling KMPObservableViewModelSwiftUI StateViewModel.swift
[12/15] Compiling KMPObservableViewModelSwiftUI ObservedViewModel.swift
[13/15] Emitting module KMPObservableViewModelSwiftUI
[14/15] Compiling KMPObservableViewModelSwiftUI ObservableViewModelProjection.swift
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservableViewModelProjection.swift:25:17: warning: capture of 'self' with non-sendable type 'ObservableViewModel<VM>.Projection' in a `@Sendable` closure; this is an error in the Swift 6 language mode
13 |     /// A projection of a `ViewModel` that creates bindings to its properties using dynamic member lookup.
14 |     @dynamicMemberLookup
15 |     struct Projection {
   |            `- note: consider making struct 'Projection' conform to the 'Sendable' protocol
16 |
17 |         internal let observableObject: ObservableViewModel<VM>
   :
23 |         public subscript<T>(dynamicMember keyPath: WritableKeyPath<VM, T>) -> Binding<T> {
24 |             Binding {
25 |                 observableObject.viewModel[keyPath: keyPath]
   |                 `- warning: capture of 'self' with non-sendable type 'ObservableViewModel<VM>.Projection' in a `@Sendable` closure; this is an error in the Swift 6 language mode
26 |             } set: { value in
27 |                 var viewModel = observableObject.viewModel
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservableViewModelProjection.swift:25:53: warning: capture of 'keyPath' with non-sendable type 'WritableKeyPath<VM, T>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
23 |         public subscript<T>(dynamicMember keyPath: WritableKeyPath<VM, T>) -> Binding<T> {
24 |             Binding {
25 |                 observableObject.viewModel[keyPath: keyPath]
   |                                                     `- warning: capture of 'keyPath' with non-sendable type 'WritableKeyPath<VM, T>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
26 |             } set: { value in
27 |                 var viewModel = observableObject.viewModel
Swift.WritableKeyPath:1:14: note: generic class 'WritableKeyPath' does not conform to the 'Sendable' protocol
1 | public class WritableKeyPath<Root, Value> : KeyPath<Root, Value> {
  |              `- note: generic class 'WritableKeyPath' does not conform to the 'Sendable' protocol
2 |     @objc deinit
3 | }
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservableViewModelProjection.swift:27:33: warning: capture of 'self' with non-sendable type 'ObservableViewModel<VM>.Projection' in a `@Sendable` closure; this is an error in the Swift 6 language mode
13 |     /// A projection of a `ViewModel` that creates bindings to its properties using dynamic member lookup.
14 |     @dynamicMemberLookup
15 |     struct Projection {
   |            `- note: consider making struct 'Projection' conform to the 'Sendable' protocol
16 |
17 |         internal let observableObject: ObservableViewModel<VM>
   :
25 |                 observableObject.viewModel[keyPath: keyPath]
26 |             } set: { value in
27 |                 var viewModel = observableObject.viewModel
   |                                 `- warning: capture of 'self' with non-sendable type 'ObservableViewModel<VM>.Projection' in a `@Sendable` closure; this is an error in the Swift 6 language mode
28 |                 viewModel[keyPath: keyPath] = value
29 |             }
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservableViewModelProjection.swift:28:36: warning: capture of 'keyPath' with non-sendable type 'WritableKeyPath<VM, T>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
26 |             } set: { value in
27 |                 var viewModel = observableObject.viewModel
28 |                 viewModel[keyPath: keyPath] = value
   |                                    `- warning: capture of 'keyPath' with non-sendable type 'WritableKeyPath<VM, T>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
29 |             }
30 |         }
Swift.WritableKeyPath:1:14: note: generic class 'WritableKeyPath' does not conform to the 'Sendable' protocol
1 | public class WritableKeyPath<Root, Value> : KeyPath<Root, Value> {
  |              `- note: generic class 'WritableKeyPath' does not conform to the 'Sendable' protocol
2 |     @objc deinit
3 | }
[15/15] Compiling KMPObservableViewModelSwiftUI EnvironmentViewModel.swift
Build complete! (13.66s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "KMPObservableViewModel",
  "name" : "KMPObservableViewModel",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    },
    {
      "name" : "tvos",
      "version" : "13.0"
    },
    {
      "name" : "watchos",
      "version" : "6.0"
    }
  ],
  "products" : [
    {
      "name" : "KMPObservableViewModelCore",
      "targets" : [
        "KMPObservableViewModelCore"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    },
    {
      "name" : "KMPObservableViewModelSwiftUI",
      "targets" : [
        "KMPObservableViewModelSwiftUI"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "swift_languages_versions" : [
    "5"
  ],
  "targets" : [
    {
      "c99name" : "KMPObservableViewModelSwiftUI",
      "module_type" : "SwiftTarget",
      "name" : "KMPObservableViewModelSwiftUI",
      "path" : "KMPObservableViewModelSwiftUI",
      "product_memberships" : [
        "KMPObservableViewModelSwiftUI"
      ],
      "sources" : [
        "EnvironmentViewModel.swift",
        "ObservableViewModelProjection.swift",
        "ObservedViewModel.swift",
        "StateViewModel.swift"
      ],
      "target_dependencies" : [
        "KMPObservableViewModelCore"
      ],
      "type" : "library"
    },
    {
      "c99name" : "KMPObservableViewModelCoreObjC",
      "module_type" : "ClangTarget",
      "name" : "KMPObservableViewModelCoreObjC",
      "path" : "KMPObservableViewModelCoreObjC",
      "product_memberships" : [
        "KMPObservableViewModelCore",
        "KMPObservableViewModelSwiftUI"
      ],
      "sources" : [
        "KMPObservableViewModelCoreObjC.m"
      ],
      "type" : "library"
    },
    {
      "c99name" : "KMPObservableViewModelCore",
      "module_type" : "SwiftTarget",
      "name" : "KMPObservableViewModelCore",
      "path" : "KMPObservableViewModelCore",
      "product_memberships" : [
        "KMPObservableViewModelCore",
        "KMPObservableViewModelSwiftUI"
      ],
      "sources" : [
        "ChildViewModels.swift",
        "ObservableViewModel.swift",
        "ObservableViewModelPublisher.swift",
        "ObservableViewModelPublishers.swift",
        "ViewModel.swift"
      ],
      "target_dependencies" : [
        "KMPObservableViewModelCoreObjC"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Done.