The Swift Package Index logo.Swift Package Index

Build Information

Successful build of KMPObservableViewModel, reference v1.0.3 (b7976b), with Swift 6.1 for macOS (SPM) on 18 Mar 2026 21:58:17 UTC.

Swift 6 data race errors: 2

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64

Build Log

========================================
RunAll
========================================
Builder version: 4.69.2
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/rickclephas/KMP-ObservableViewModel.git
Reference: v1.0.3
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/rickclephas/KMP-ObservableViewModel
 * tag               v1.0.3     -> FETCH_HEAD
HEAD is now at b7976b0 Bump version to 1.0.3
Cloned https://github.com/rickclephas/KMP-ObservableViewModel.git
Revision (git rev-parse @):
b7976b0854921f7fa7b4d5fb3d5b029438a1b32d
SUCCESS checkout https://github.com/rickclephas/KMP-ObservableViewModel.git at v1.0.3
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/rickclephas/KMP-ObservableViewModel.git
https://github.com/rickclephas/KMP-ObservableViewModel.git
{
  "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",
        "ObservableProperties.swift",
        "ObservableViewModel.swift",
        "ObservableViewModelPublisher.swift",
        "ViewModel.swift",
        "ViewModelCancellable.swift"
      ],
      "target_dependencies" : [
        "KMPObservableViewModelCoreObjC"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Building for debugging...
[0/4] Write sources
[2/4] Compiling KMPObservableViewModelCoreObjC KMPObservableViewModelCoreObjC.m
[3/4] Write swift-version-2F0A5646E1D333AE.txt
[5/11] Compiling KMPObservableViewModelCore ViewModel.swift
[6/11] Compiling KMPObservableViewModelCore ChildViewModels.swift
[7/11] Emitting module KMPObservableViewModelCore
[8/11] Compiling KMPObservableViewModelCore ObservableViewModel.swift
[9/11] Compiling KMPObservableViewModelCore ObservableViewModelPublisher.swift
[10/11] Compiling KMPObservableViewModelCore ViewModelCancellable.swift
[11/11] Compiling KMPObservableViewModelCore ObservableProperties.swift
[12/16] Compiling KMPObservableViewModelSwiftUI ObservedViewModel.swift
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:16:6: warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |      `- warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
SwiftUICore.ObservedObject.init:2:35: note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
1 | generic struct ObservedObject {
2 | @MainActor @preconcurrency public init(wrappedValue: ObjectType)}
  |                                   `- note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
3 |
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:23:15: warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |                                 `- note: property declared here
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
   :
21 |     /// The underlying `ViewModel` referenced by the `ObservedViewModel`.
22 |     public var wrappedValue: VM {
23 |         get { observableObject.viewModel }
   |               `- warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
24 |         set {
25 |             let observableObject = observableViewModel(for: newValue)
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:26:18: warning: main actor-isolated property 'observableObject' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |                                 `- note: mutation of this property is only permitted within the actor
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
   :
24 |         set {
25 |             let observableObject = observableViewModel(for: newValue)
26 |             self.observableObject = observableObject
   |                  `- warning: main actor-isolated property 'observableObject' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
27 |             self.projectedValue = ObservableViewModel.Projection(observableObject)
28 |         }
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:35:14: warning: main actor-isolated property 'observableObject' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |                                 `- note: mutation of this property is only permitted within the actor
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
   :
33 |     public init(wrappedValue: VM) {
34 |         let observableObject = observableViewModel(for: wrappedValue)
35 |         self.observableObject = observableObject
   |              `- warning: main actor-isolated property 'observableObject' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
36 |         self.projectedValue = ObservableViewModel.Projection(observableObject)
37 |     }
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:16:6: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |      |- warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
   |      `- note: sending task-isolated '$input_value' to main actor-isolated callee risks causing data races between main actor-isolated and task-isolated uses
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
[13/16] Compiling KMPObservableViewModelSwiftUI StateViewModel.swift
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/StateViewModel.swift:20:35: warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
15 | public struct StateViewModel<VM: ViewModel>: DynamicProperty {
16 |
17 |     @StateObject private var observableObject: ObservableViewModel<VM>
   |                              `- note: property declared here
18 |
19 |     /// The underlying `ViewModel` referenced by the `StateViewModel`.
20 |     public var wrappedValue: VM { observableObject.viewModel }
   |                                   `- warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
21 |
22 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/StateViewModel.swift:24:40: warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
15 | public struct StateViewModel<VM: ViewModel>: DynamicProperty {
16 |
17 |     @StateObject private var observableObject: ObservableViewModel<VM>
   |                              `- note: property declared here
18 |
19 |     /// The underlying `ViewModel` referenced by the `StateViewModel`.
   :
22 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
23 |     public var projectedValue: ObservableViewModel<VM>.Projection {
24 |         ObservableViewModel.Projection(observableObject)
   |                                        `- warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
25 |     }
26 |
[14/16] 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
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
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
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
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
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
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
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
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/16] Emitting module KMPObservableViewModelSwiftUI
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:16:6: warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |      `- warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
SwiftUICore.ObservedObject.init:2:35: note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
1 | generic struct ObservedObject {
2 | @MainActor @preconcurrency public init(wrappedValue: ObjectType)}
  |                                   `- note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
3 |
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/ObservedViewModel.swift:16:6: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
14 | public struct ObservedViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @ObservedObject private var observableObject: ObservableViewModel<VM>
   |      |- warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
   |      `- note: sending task-isolated '$input_value' to main actor-isolated callee risks causing data races between main actor-isolated and task-isolated uses
17 |
18 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
[16/16] Compiling KMPObservableViewModelSwiftUI EnvironmentViewModel.swift
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/EnvironmentViewModel.swift:19:35: warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct EnvironmentViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @EnvironmentObject private var observableObject: ObservableViewModel<VM>
   |                                    `- note: property declared here
17 |
18 |     /// The underlying `ViewModel` referenced by the `EnvironmentViewModel`.
19 |     public var wrappedValue: VM { observableObject.viewModel }
   |                                   `- warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
20 |
21 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/EnvironmentViewModel.swift:23:40: warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct EnvironmentViewModel<VM: ViewModel>: DynamicProperty {
15 |
16 |     @EnvironmentObject private var observableObject: ObservableViewModel<VM>
   |                                    `- note: property declared here
17 |
18 |     /// The underlying `ViewModel` referenced by the `EnvironmentViewModel`.
   :
21 |     /// A projection of the observed `ViewModel` that creates bindings to its properties using dynamic member lookup.
22 |     public var projectedValue: ObservableViewModel<VM>.Projection {
23 |         ObservableViewModel.Projection(observableObject)
   |                                        `- warning: main actor-isolated property 'observableObject' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
24 |     }
25 |
/Users/admin/builder/spi-builder-workspace/KMPObservableViewModelSwiftUI/EnvironmentViewModel.swift:27:21: error: return from initializer without initializing all stored properties
25 |
26 |     /// Creates an `EnvironmentViewModel`.
27 |     public init() { }
   |                     |- error: return from initializer without initializing all stored properties
   |                     `- note: main actor-isolated default value of 'self.observableObject' cannot be used in a nonisolated initalizer
28 | }
29 |
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/8] Compiling KMPObservableViewModelCore ViewModel.swift
[3/8] Compiling KMPObservableViewModelCore ObservableViewModelPublisher.swift
[4/8] Compiling KMPObservableViewModelCore ViewModelCancellable.swift
[5/8] Compiling KMPObservableViewModelCore ObservableViewModel.swift
[6/8] Emitting module KMPObservableViewModelCore
[7/8] Compiling KMPObservableViewModelCore ObservableProperties.swift
[8/8] Compiling KMPObservableViewModelCore ChildViewModels.swift
[9/13] Compiling KMPObservableViewModelSwiftUI StateViewModel.swift
[10/13] Compiling KMPObservableViewModelSwiftUI ObservedViewModel.swift
[11/13] Compiling KMPObservableViewModelSwiftUI ObservableViewModelProjection.swift
[12/13] Emitting module KMPObservableViewModelSwiftUI
[13/13] Compiling KMPObservableViewModelSwiftUI EnvironmentViewModel.swift
Build complete! (1.33s)
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",
        "ObservableProperties.swift",
        "ObservableViewModel.swift",
        "ObservableViewModelPublisher.swift",
        "ViewModel.swift",
        "ViewModelCancellable.swift"
      ],
      "target_dependencies" : [
        "KMPObservableViewModelCoreObjC"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Done.