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 UserDefaultsKey, reference 1.0.0 (d2323f), with Swift 6.1 for macOS (SPM) on 26 Apr 2025 12:25:22 UTC.

Swift 6 data race errors: 2

Build Command

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

Build Log

========================================
RunAll
========================================
Builder version: 4.61.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/danielctull/UserDefaultsKey.git
Reference: 1.0.0
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/danielctull/UserDefaultsKey
 * tag               1.0.0      -> FETCH_HEAD
HEAD is now at d2323f6 Fix typo
Cloned https://github.com/danielctull/UserDefaultsKey.git
Revision (git rev-parse @):
d2323f6683fd3154ea1aac694d45c9ad052aa7a8
SUCCESS checkout https://github.com/danielctull/UserDefaultsKey.git at 1.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": "userdefaultskey",
      "name": "UserDefaultsKey",
      "url": "https://github.com/danielctull/UserDefaultsKey.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/UserDefaultsKey",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/danielctull/UserDefaultsKey.git
[1/246] Fetching userdefaultskey
Fetched https://github.com/danielctull/UserDefaultsKey.git from cache (0.63s)
Creating working copy for https://github.com/danielctull/UserDefaultsKey.git
Working copy of https://github.com/danielctull/UserDefaultsKey.git resolved at 1.0.0 (d2323f6)
warning: '.resolve-product-dependencies': dependency 'userdefaultskey' is not used by any target
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/danielctull/UserDefaultsKey.git
https://github.com/danielctull/UserDefaultsKey.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "UserDefaultsKey",
  "name" : "UserDefaultsKey",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "UserDefaultsKey",
      "targets" : [
        "UserDefaultsKey"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "UserDefaultsKeyTests",
      "module_type" : "SwiftTarget",
      "name" : "UserDefaultsKeyTests",
      "path" : "Tests/UserDefaultsKeyTests",
      "sources" : [
        "KeyTests.swift",
        "PropertyWrapperTests.swift",
        "String+Random.swift",
        "Unwrap.swift"
      ],
      "target_dependencies" : [
        "UserDefaultsKey"
      ],
      "type" : "test"
    },
    {
      "c99name" : "UserDefaultsKey",
      "module_type" : "SwiftTarget",
      "name" : "UserDefaultsKey",
      "path" : "Sources/UserDefaultsKey",
      "product_memberships" : [
        "UserDefaultsKey"
      ],
      "sources" : [
        "KeyValueObservation.swift",
        "PropertyWrapper-Dynamic.swift",
        "PropertyWrapper-Static.swift",
        "UserDefaults.swift",
        "UserDefaultsKey.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.1"
}
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/2] Write sources
[1/2] Write swift-version-2F0A5646E1D333AE.txt
[3/8] Compiling UserDefaultsKey UserDefaultsKey.swift
[4/8] Compiling UserDefaultsKey KeyValueObservation.swift
[5/8] Compiling UserDefaultsKey PropertyWrapper-Static.swift
[6/8] Compiling UserDefaultsKey UserDefaults.swift
[7/8] Compiling UserDefaultsKey PropertyWrapper-Dynamic.swift
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:44: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
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |      `- warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
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/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:55:9: warning: main actor-isolated property 'observable' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |                                 `- note: mutation of this property is only permitted within the actor
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
   :
53 |         self.key = key
54 |         self.defaults = defaults
55 |         observable = Observable(defaults: defaults, key: key)
   |         `- warning: main actor-isolated property 'observable' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode
56 |     }
57 |
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:60:15: warning: main actor-isolated property 'observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |                                 `- note: property declared here
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
   :
58 |     /// The value stored in user defaults for the given key.
59 |     public var wrappedValue: Value {
60 |         get { observable.value }
   |               `- warning: main actor-isolated property 'observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
61 |         set { observable.value = newValue }
62 |     }
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:61:15: warning: main actor-isolated property 'observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |                                 `- note: property declared here
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
   :
59 |     public var wrappedValue: Value {
60 |         get { observable.value }
61 |         set { observable.value = newValue }
   |               `- warning: main actor-isolated property 'observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
62 |     }
63 |
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:65:60: warning: main actor-isolated subscript 'subscript(dynamicMember:)' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
63 |
64 |     /// A binding to the value in stored in user defaults.
65 |     public var projectedValue: Binding<Value> { $observable.value }
   |                                                            `- warning: main actor-isolated subscript 'subscript(dynamicMember:)' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
66 |
67 |     public mutating func update() { _observable.update() }
SwiftUICore.ObservedObject.Wrapper.subscript:3:35: note: subscript declared here
1 | generic struct ObservedObject {
2 |   struct Wrapper {
3 | @MainActor @preconcurrency public subscript<Subject>(dynamicMember keyPath: ReferenceWritableKeyPath<ObjectType, Subject>) -> Binding<Subject> { get }  }
  |                                   `- note: subscript declared here
4 | }
5 |
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:65:49: warning: main actor-isolated property '$observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |                                 `- note: property declared here
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
   :
63 |
64 |     /// A binding to the value in stored in user defaults.
65 |     public var projectedValue: Binding<Value> { $observable.value }
   |                                                 `- warning: main actor-isolated property '$observable' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
66 |
67 |     public mutating func update() { _observable.update() }
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:44:6: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |      |- 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
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
[8/8] Emitting module UserDefaultsKey
/Users/admin/builder/spi-builder-workspace/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:44: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
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |      `- warning: call to main actor-isolated initializer 'init(wrappedValue:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
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/Sources/UserDefaultsKey/PropertyWrapper-Dynamic.swift:44:6: warning: sending '$input_value' risks causing data races; this is an error in the Swift 6 language mode
42 |     let defaults: UserDefaults
43 |     let key: UserDefaultsKey<Value>
44 |     @ObservedObject private var observable: Observable<Value>
   |      |- 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
45 |
46 |     /// Creates a dynamic UserDefault property wrapper to access the value for
Build complete! (8.12s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "UserDefaultsKey",
  "name" : "UserDefaultsKey",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "UserDefaultsKey",
      "targets" : [
        "UserDefaultsKey"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "UserDefaultsKeyTests",
      "module_type" : "SwiftTarget",
      "name" : "UserDefaultsKeyTests",
      "path" : "Tests/UserDefaultsKeyTests",
      "sources" : [
        "KeyTests.swift",
        "PropertyWrapperTests.swift",
        "String+Random.swift",
        "Unwrap.swift"
      ],
      "target_dependencies" : [
        "UserDefaultsKey"
      ],
      "type" : "test"
    },
    {
      "c99name" : "UserDefaultsKey",
      "module_type" : "SwiftTarget",
      "name" : "UserDefaultsKey",
      "path" : "Sources/UserDefaultsKey",
      "product_memberships" : [
        "UserDefaultsKey"
      ],
      "sources" : [
        "KeyValueObservation.swift",
        "PropertyWrapper-Dynamic.swift",
        "PropertyWrapper-Static.swift",
        "UserDefaults.swift",
        "UserDefaultsKey.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.1"
}
Done.