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 Dependiject, reference master (7f5426), with Swift 6.0 for macOS (SPM) on 20 Sep 2024 16:25:07 UTC.

Swift 6 data race errors: 4

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/Tiny-Home-Consulting/Dependiject.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/Tiny-Home-Consulting/Dependiject
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at 7f54260 1.1.0 (#81)
Cloned https://github.com/Tiny-Home-Consulting/Dependiject.git
Revision (git rev-parse @):
7f54260dd54fccaaceb57ff2564da15c39741814
SUCCESS checkout https://github.com/Tiny-Home-Consulting/Dependiject.git at master
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $PWD
https://github.com/Tiny-Home-Consulting/Dependiject.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/2] Write sources
[1/2] Write swift-version--4A847ED0836F2485.txt
[3/13] Compiling Dependiject Util.swift
[4/14] Compiling Dependiject ErasedObservableObject.swift
[5/14] Compiling Dependiject AnyObservableObject.swift
[6/14] Compiling Dependiject Registration.swift
[7/14] Compiling Dependiject Synchronization.swift
<unknown>:0: note: consider making generic parameter 'Self' conform to the 'Sendable' protocol
/Users/admin/builder/spi-builder-workspace/Dependiject/Synchronization.swift:28:5: warning: instance method of non-Sendable type 'Self' cannot be marked as '@Sendable'; this is an error in the Swift 6 language mode
26 |     /// construct that deadlocks if called recursively, such as `NSLock.withLock` or
27 |     /// `DispatchQueue.main.sync`.
28 |     @Sendable
   |     `- warning: instance method of non-Sendable type 'Self' cannot be marked as '@Sendable'; this is an error in the Swift 6 language mode
29 |     func synchronize<T>(_ body: () throws -> T) rethrows -> T
30 | }
[8/14] Compiling Dependiject Resolver.swift
[9/14] Compiling Dependiject RegistrationConvertible.swift
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:58:23: warning: static property 'transient' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
 57 |     /// Call the provided callback every time the dependency is requested.
 58 |     public static let transient = Scope(value: .transient)
    |                       |- warning: static property 'transient' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'transient' 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
 59 |     /// Create a lazy-loaded singleton, and re-use the same one for further requests.
 60 |     /// - Note: This scope is for singletons that are created by the callback. If the singleton is
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:62:23: warning: static property 'singleton' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
    :
 60 |     /// - Note: This scope is for singletons that are created by the callback. If the singleton is
 61 |     /// created elsewhere, use ``Service/init(constant:_:name:)`` instead.
 62 |     public static let singleton = Scope(value: .singleton)
    |                       |- warning: static property 'singleton' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'singleton' 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
 63 |     /// Re-use an existing instance if it exists, but do not hold onto an unused instance.
 64 |     /// - Important: This scope can only be used with classes and actors. Value types are not
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:66:23: warning: static property 'weak' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
    :
 64 |     /// - Important: This scope can only be used with classes and actors. Value types are not
 65 |     /// allowed to be registered weakly.
 66 |     public static let weak = Scope(value: .weak)
    |                       |- warning: static property 'weak' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'weak' 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
 67 |
 68 |     internal enum UnderlyingType: Equatable {
[10/14] Emitting module Dependiject
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:58:23: warning: static property 'transient' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
 57 |     /// Call the provided callback every time the dependency is requested.
 58 |     public static let transient = Scope(value: .transient)
    |                       |- warning: static property 'transient' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'transient' 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
 59 |     /// Create a lazy-loaded singleton, and re-use the same one for further requests.
 60 |     /// - Note: This scope is for singletons that are created by the callback. If the singleton is
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:62:23: warning: static property 'singleton' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
    :
 60 |     /// - Note: This scope is for singletons that are created by the callback. If the singleton is
 61 |     /// created elsewhere, use ``Service/init(constant:_:name:)`` instead.
 62 |     public static let singleton = Scope(value: .singleton)
    |                       |- warning: static property 'singleton' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'singleton' 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
 63 |     /// Re-use an existing instance if it exists, but do not hold onto an unused instance.
 64 |     /// - Important: This scope can only be used with classes and actors. Value types are not
/Users/admin/builder/spi-builder-workspace/Dependiject/RegistrationConvertible.swift:66:23: warning: static property 'weak' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | /// of determining when the callback should be called vs. when the previous return value should be
 53 | /// re-used.
 54 | public struct Scope: Equatable {
    |               `- note: consider making struct 'Scope' conform to the 'Sendable' protocol
 55 |     internal let value: UnderlyingType
 56 |
    :
 64 |     /// - Important: This scope can only be used with classes and actors. Value types are not
 65 |     /// allowed to be registered weakly.
 66 |     public static let weak = Scope(value: .weak)
    |                       |- warning: static property 'weak' is not concurrency-safe because non-'Sendable' type 'Scope' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: annotate 'weak' 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
 67 |
 68 |     internal enum UnderlyingType: Equatable {
<unknown>:0: note: consider making generic parameter 'Self' conform to the 'Sendable' protocol
/Users/admin/builder/spi-builder-workspace/Dependiject/Synchronization.swift:28:5: warning: instance method of non-Sendable type 'Self' cannot be marked as '@Sendable'; this is an error in the Swift 6 language mode
26 |     /// construct that deadlocks if called recursively, such as `NSLock.withLock` or
27 |     /// `DispatchQueue.main.sync`.
28 |     @Sendable
   |     `- warning: instance method of non-Sendable type 'Self' cannot be marked as '@Sendable'; this is an error in the Swift 6 language mode
29 |     func synchronize<T>(_ body: () throws -> T) rethrows -> T
30 | }
[11/14] Compiling Dependiject RegistrationBuilder.swift
[12/14] Compiling Dependiject Factory.swift
[13/14] Compiling Dependiject MultitypeService.swift
[14/14] Compiling Dependiject Store.swift
/Users/admin/builder/spi-builder-workspace/Dependiject/Store.swift:114:17: warning: capture of 'self' with non-sendable type 'Store<ObjectType>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
100 |     /// type.
101 |     @dynamicMemberLookup
102 |     public struct Wrapper {
    |                   `- note: consider making struct 'Wrapper' conform to the 'Sendable' protocol
103 |         private var store: Store
104 |
    :
112 |         ) -> Binding<Subject> {
113 |             return Binding {
114 |                 self.store.wrappedValue[keyPath: keyPath]
    |                 `- warning: capture of 'self' with non-sendable type 'Store<ObjectType>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
115 |             } set: {
116 |                 self.store.wrappedValue[keyPath: keyPath] = $0
/Users/admin/builder/spi-builder-workspace/Dependiject/Store.swift:114:50: 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
112 |         ) -> Binding<Subject> {
113 |             return Binding {
114 |                 self.store.wrappedValue[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
115 |             } set: {
116 |                 self.store.wrappedValue[keyPath: keyPath] = $0
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/Dependiject/Store.swift:116:17: warning: capture of 'self' with non-sendable type 'Store<ObjectType>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
100 |     /// type.
101 |     @dynamicMemberLookup
102 |     public struct Wrapper {
    |                   `- note: consider making struct 'Wrapper' conform to the 'Sendable' protocol
103 |         private var store: Store
104 |
    :
114 |                 self.store.wrappedValue[keyPath: keyPath]
115 |             } set: {
116 |                 self.store.wrappedValue[keyPath: keyPath] = $0
    |                 `- warning: capture of 'self' with non-sendable type 'Store<ObjectType>.Wrapper' in a `@Sendable` closure; this is an error in the Swift 6 language mode
117 |             }
118 |         }
/Users/admin/builder/spi-builder-workspace/Dependiject/Store.swift:116:50: 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
114 |                 self.store.wrappedValue[keyPath: keyPath]
115 |             } set: {
116 |                 self.store.wrappedValue[keyPath: keyPath] = $0
    |                                                  `- 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
117 |             }
118 |         }
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 | }
Build complete! (17.96s)
Fetching https://github.com/tcldr/Entwine.git
[1/2725] Fetching entwine
Fetched https://github.com/tcldr/Entwine.git from cache (1.42s)
Computing version for https://github.com/tcldr/Entwine.git
Computed https://github.com/tcldr/Entwine.git at 0.9.1 (0.70s)
Creating working copy for https://github.com/tcldr/Entwine.git
Working copy of https://github.com/tcldr/Entwine.git resolved at 0.9.1
Build complete.
{
  "dependencies" : [
    {
      "identity" : "entwine",
      "requirement" : {
        "range" : [
          {
            "lower_bound" : "0.9.1",
            "upper_bound" : "1.0.0"
          }
        ]
      },
      "type" : "sourceControl",
      "url" : "https://github.com/tcldr/Entwine.git"
    }
  ],
  "manifest_display_name" : "Dependiject",
  "name" : "Dependiject",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    },
    {
      "name" : "watchos",
      "version" : "6.0"
    },
    {
      "name" : "tvos",
      "version" : "13.0"
    }
  ],
  "products" : [
    {
      "name" : "Dependiject",
      "targets" : [
        "Dependiject"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "swift_languages_versions" : [
    "5"
  ],
  "targets" : [
    {
      "c99name" : "DependijectTests",
      "module_type" : "SwiftTarget",
      "name" : "DependijectTests",
      "path" : "Tests",
      "product_dependencies" : [
        "EntwineTest"
      ],
      "sources" : [
        "BaseFactoryTest.swift",
        "DuplicateRegistrationTest.swift",
        "MultitypeServiceTests.swift",
        "ParallelResolutionTest.swift",
        "RegistrationNameTests.swift",
        "ScopeTests.swift",
        "StoreTests.swift"
      ],
      "target_dependencies" : [
        "Dependiject"
      ],
      "type" : "test"
    },
    {
      "c99name" : "Dependiject",
      "module_type" : "SwiftTarget",
      "name" : "Dependiject",
      "path" : "Dependiject",
      "product_memberships" : [
        "Dependiject"
      ],
      "sources" : [
        "Factory.swift",
        "MultitypeService.swift",
        "Registration.swift",
        "RegistrationBuilder.swift",
        "RegistrationConvertible.swift",
        "Resolver.swift",
        "Store.swift",
        "Synchronization.swift",
        "Util.swift",
        "XUI/AnyObservableObject.swift",
        "XUI/ErasedObservableObject.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.5"
}
Done.