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 swiftui-shared-object, reference 2.0.0 (487a92), with Swift 6.0 for macOS (SPM) on 28 Nov 2024 12:21:17 UTC.

Swift 6 data race errors: 4

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.1.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures

Build Log

========================================
RunAll
========================================
Builder version: 4.58.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/lorenzofiamingo/swiftui-shared-object.git
Reference: 2.0.0
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/lorenzofiamingo/swiftui-shared-object
 * tag               2.0.0      -> FETCH_HEAD
HEAD is now at 487a922 Update Package.swift
Cloned https://github.com/lorenzofiamingo/swiftui-shared-object.git
Revision (git rev-parse @):
487a922254f669fb2f69ec8816694afc7e596bba
SUCCESS checkout https://github.com/lorenzofiamingo/swiftui-shared-object.git at 2.0.0
========================================
ResolveProductDependencies
========================================
Resolving dependencies ...
{
  "identity": ".resolve-product-dependencies",
  "name": "resolve-dependencies",
  "url": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "version": "unspecified",
  "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "dependencies": [
    {
      "identity": "swiftui-shared-object",
      "name": "swiftui-shared-object",
      "url": "https://github.com/lorenzofiamingo/swiftui-shared-object.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/swiftui-shared-object",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/lorenzofiamingo/swiftui-shared-object.git
[1/94] Fetching swiftui-shared-object
Fetched https://github.com/lorenzofiamingo/swiftui-shared-object.git from cache (0.67s)
Creating working copy for https://github.com/lorenzofiamingo/swiftui-shared-object.git
Working copy of https://github.com/lorenzofiamingo/swiftui-shared-object.git resolved at 2.0.0 (487a922)
warning: '.resolve-product-dependencies': dependency 'swiftui-shared-object' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/lorenzofiamingo/swiftui-shared-object.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.1.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/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
[3/6] Compiling SharedObject SharedRepository.swift
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedRepository.swift:12:21: warning: static property 'objects' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
10 | final class SharedRepository {
11 |
12 | 	private static var objects: [Int: Any] = [:]
   |                     |- warning: static property 'objects' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                     |- note: convert 'objects' to a 'let' constant to make 'Sendable' shared state immutable
   |                     |- note: annotate 'objects' 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
13 |
14 | 	static func getObject<ObjectType>(for key: Int, defaultValue: ObjectType?) -> ObjectType {
[4/6] Compiling SharedObject SharableObject.swift
[5/6] Compiling SharedObject SharedObject.swift
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:16:3: 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 SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |   `- 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 | 	/// The underlying value referenced by the shared object.
SwiftUICore.ObservedObject:7:39: note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
 5 |     }
 6 |     @MainActor @preconcurrency public init(initialValue: ObjectType)
 7 |     @MainActor @preconcurrency public init(wrappedValue: ObjectType)
   |                                       `- note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
 8 |     @MainActor @preconcurrency public var wrappedValue: ObjectType
 9 |     @MainActor @preconcurrency public var projectedValue: ObservedObject<ObjectType>.Wrapper { get }
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:44:29: warning: generic parameter 'ObjectType' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
12 | @available(watchOS 6.0, tvOS 13.0, iOS 13.0, OSX 10.15, *)
13 | @propertyWrapper
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
   |                            `- note: 'ObjectType' previously declared here
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   :
42 | 	}
43 |
44 | 	private final class Object<ObjectType: ObservableObject>: ObservableObject {
   |                             `- warning: generic parameter 'ObjectType' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
45 |
46 | 		private var cancellable: AnyCancellable?
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:20:9: warning: main actor-isolated property 'object' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: property declared here
17 |
18 | 	/// The underlying value referenced by the shared object.
19 | 	public var wrappedValue: ObjectType {
20 | 		get { object.object }
   |         `- warning: main actor-isolated property 'object' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
21 | 		nonmutating set { object.object = newValue }
22 | 	}
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:21:21: warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: mutation of this property is only permitted within the actor
17 |
18 | 	/// The underlying value referenced by the shared object.
19 | 	public var wrappedValue: ObjectType {
20 | 		get { object.object }
21 | 		nonmutating set { object.object = newValue }
   |                     `- warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
22 | 	}
23 |
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:26:9: warning: main actor-isolated property 'object' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: property declared here
17 |
18 | 	/// The underlying value referenced by the shared object.
   :
24 | 	/// A projection of the shared object that creates bindings to its properties using dynamic member lookup.
25 | 	public var projectedValue: SharedObject.Wrapper {
26 | 		.init(object.object)
   |         `- warning: main actor-isolated property 'object' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
27 | 	}
28 |
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:31:3: warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: mutation of this property is only permitted within the actor
17 |
18 | 	/// The underlying value referenced by the shared object.
   :
29 | 	/// Retrieves the shared object with the given id or creates a shared object with an initial wrapped value.
30 | 	public init(wrappedValue: ObjectType, _ id: ID) {
31 | 		object = .init(wrappedValue: wrappedValue, id: id)
   |   `- warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
32 | 	}
33 |
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:36:3: warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: mutation of this property is only permitted within the actor
17 |
18 | 	/// The underlying value referenced by the shared object.
   :
34 | 	/// Retrieves the shared object with the given id.
35 | 	public init(_ id: ID) {
36 | 		object = .init(wrappedValue: nil, id: id)
   |   `- warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
37 | 	}
38 |
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:41:3: warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |                              `- note: mutation of this property is only permitted within the actor
17 |
18 | 	/// The underlying value referenced by the shared object.
   :
39 | 	/// Retrieves the shared object with the given id or creates a shared object with an initial wrapped value provided by the object class.
40 | 	public init(_ id: ID) where ObjectType: SharableObject {
41 | 		object = .init(wrappedValue: ObjectType.initialValue, id: id)
   |   `- warning: main actor-isolated property 'object' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
42 | 	}
43 |
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:74:5: warning: capture of 'self' with non-sendable type 'SharedObject<ObjectType, ID>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
62 | 	/// A wrapper of the underlying observable object that can create bindings to its properties using dynamic member lookup.
63 | 	@dynamicMemberLookup
64 | 	public struct Wrapper {
   |                `- note: consider making struct 'Wrapper' conform to the 'Sendable' protocol
65 |
66 | 		private let object: ObjectType
   :
72 | 		subscript<Subject>(dynamicMember keyPath: ReferenceWritableKeyPath<ObjectType, Subject>) -> Binding<Subject> {
73 | 			.init {
74 | 				object[keyPath: keyPath]
   |     `- warning: capture of 'self' with non-sendable type 'SharedObject<ObjectType, ID>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
75 | 			} set: { newValue in
76 | 				object[keyPath: keyPath] = newValue
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:74:21: warning: capture of 'keyPath' with non-sendable type 'ReferenceWritableKeyPath<ObjectType, Subject>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
72 | 		subscript<Subject>(dynamicMember keyPath: ReferenceWritableKeyPath<ObjectType, Subject>) -> Binding<Subject> {
73 | 			.init {
74 | 				object[keyPath: keyPath]
   |                     `- warning: capture of 'keyPath' with non-sendable type 'ReferenceWritableKeyPath<ObjectType, Subject>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
75 | 			} set: { newValue in
76 | 				object[keyPath: keyPath] = newValue
Swift.ReferenceWritableKeyPath:1:14: note: generic class 'ReferenceWritableKeyPath' does not conform to the 'Sendable' protocol
1 | public class ReferenceWritableKeyPath<Root, Value> : WritableKeyPath<Root, Value> {
  |              `- note: generic class 'ReferenceWritableKeyPath' does not conform to the 'Sendable' protocol
2 |     @objc deinit
3 | }
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:76:5: warning: capture of 'self' with non-sendable type 'SharedObject<ObjectType, ID>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
62 | 	/// A wrapper of the underlying observable object that can create bindings to its properties using dynamic member lookup.
63 | 	@dynamicMemberLookup
64 | 	public struct Wrapper {
   |                `- note: consider making struct 'Wrapper' conform to the 'Sendable' protocol
65 |
66 | 		private let object: ObjectType
   :
74 | 				object[keyPath: keyPath]
75 | 			} set: { newValue in
76 | 				object[keyPath: keyPath] = newValue
   |     `- warning: capture of 'self' with non-sendable type 'SharedObject<ObjectType, ID>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
77 | 			}
78 | 		}
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:76:21: warning: capture of 'keyPath' with non-sendable type 'ReferenceWritableKeyPath<ObjectType, Subject>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
74 | 				object[keyPath: keyPath]
75 | 			} set: { newValue in
76 | 				object[keyPath: keyPath] = newValue
   |                     `- warning: capture of 'keyPath' with non-sendable type 'ReferenceWritableKeyPath<ObjectType, Subject>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
77 | 			}
78 | 		}
Swift.ReferenceWritableKeyPath:1:14: note: generic class 'ReferenceWritableKeyPath' does not conform to the 'Sendable' protocol
1 | public class ReferenceWritableKeyPath<Root, Value> : WritableKeyPath<Root, Value> {
  |              `- note: generic class 'ReferenceWritableKeyPath' does not conform to the 'Sendable' protocol
2 |     @objc deinit
3 | }
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:16:3: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |   |- 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 | 	/// The underlying value referenced by the shared object.
[6/6] Emitting module SharedObject
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:16:3: 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 SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |   `- 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 | 	/// The underlying value referenced by the shared object.
SwiftUICore.ObservedObject:7:39: note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
 5 |     }
 6 |     @MainActor @preconcurrency public init(initialValue: ObjectType)
 7 |     @MainActor @preconcurrency public init(wrappedValue: ObjectType)
   |                                       `- note: calls to initializer 'init(wrappedValue:)' from outside of its actor context are implicitly asynchronous
 8 |     @MainActor @preconcurrency public var wrappedValue: ObjectType
 9 |     @MainActor @preconcurrency public var projectedValue: ObservedObject<ObjectType>.Wrapper { get }
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:44:29: warning: generic parameter 'ObjectType' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
12 | @available(watchOS 6.0, tvOS 13.0, iOS 13.0, OSX 10.15, *)
13 | @propertyWrapper
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
   |                            `- note: 'ObjectType' previously declared here
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   :
42 | 	}
43 |
44 | 	private final class Object<ObjectType: ObservableObject>: ObservableObject {
   |                             `- warning: generic parameter 'ObjectType' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
45 |
46 | 		private var cancellable: AnyCancellable?
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedRepository.swift:12:21: warning: static property 'objects' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
10 | final class SharedRepository {
11 |
12 | 	private static var objects: [Int: Any] = [:]
   |                     |- warning: static property 'objects' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                     |- note: convert 'objects' to a 'let' constant to make 'Sendable' shared state immutable
   |                     |- note: annotate 'objects' 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
13 |
14 | 	static func getObject<ObjectType>(for key: Int, defaultValue: ObjectType?) -> ObjectType {
/Users/admin/builder/spi-builder-workspace/Sources/SharedObject/SharedObject.swift:16:3: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
14 | public struct SharedObject<ObjectType, ID>: DynamicProperty where ObjectType: ObservableObject, ID: Hashable {
15 |
16 | 	@ObservedObject private var object: Object<ObjectType>
   |   |- 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 | 	/// The underlying value referenced by the shared object.
Build complete! (11.05s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "swiftui-shared-object",
  "name" : "swiftui-shared-object",
  "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" : "SharedObject",
      "targets" : [
        "SharedObject"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "SharedObjectTests",
      "module_type" : "SwiftTarget",
      "name" : "SharedObjectTests",
      "path" : "Tests/SharedObjectTests",
      "sources" : [
        "SharedObjectTests.swift",
        "XCTestManifests.swift"
      ],
      "target_dependencies" : [
        "SharedObject"
      ],
      "type" : "test"
    },
    {
      "c99name" : "SharedObject",
      "module_type" : "SwiftTarget",
      "name" : "SharedObject",
      "path" : "Sources/SharedObject",
      "product_memberships" : [
        "SharedObject"
      ],
      "sources" : [
        "SharableObject.swift",
        "SharedObject.swift",
        "SharedRepository.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Done.