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 HSObserver, reference master (acbb61), with Swift 6.0 for macOS (SPM) on 1 Nov 2024 17:40:07 UTC.

Swift 6 data race errors: 1

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

Build Log

========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/ConfusedVorlon/HSObserver.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/ConfusedVorlon/HSObserver
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at acbb61e Merge branch 'feature/objc' into develop
Cloned https://github.com/ConfusedVorlon/HSObserver.git
Revision (git rev-parse @):
acbb61ea94518871ddea3571bf0d1aba24384584
SUCCESS checkout https://github.com/ConfusedVorlon/HSObserver.git at master
========================================
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": "hsobserver",
      "name": "HSObserver",
      "url": "https://github.com/ConfusedVorlon/HSObserver.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/HSObserver",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/ConfusedVorlon/HSObserver.git
[1/172] Fetching hsobserver
Fetched https://github.com/ConfusedVorlon/HSObserver.git from cache (0.70s)
Creating working copy for https://github.com/ConfusedVorlon/HSObserver.git
Working copy of https://github.com/ConfusedVorlon/HSObserver.git resolved at master (acbb61e)
warning: '.resolve-product-dependencies': dependency 'hsobserver' 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/ConfusedVorlon/HSObserver.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
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version--7754E27361AE5C74.txt
[3/8] Compiling HSObserver NSNotification+HSObserver.swift
[4/8] Compiling HSObserver HSObserves.swift
[5/8] Compiling HSObserver HSObserver.swift
/Users/admin/builder/spi-builder-workspace/Sources/HSObserver/HSObserver.swift:164:70: warning: converting non-sendable function value to '@Sendable (Notification) -> Void' may introduce data races
162 |                                                               object: object,
163 |                                                               queue: queue,
164 |                                                               using: block)
    |                                                                      `- warning: converting non-sendable function value to '@Sendable (Notification) -> Void' may introduce data races
165 |                 notificationObservers.append(notificationObserver)
166 |             }
/Users/admin/builder/spi-builder-workspace/Sources/HSObserver/HSObserver.swift:128:23: warning: sending 'notification' risks causing data races; this is an error in the Swift 6 language mode
126 |             Task {
127 |                 @MainActor in
128 |                 block(notification)
    |                       |- warning: sending 'notification' risks causing data races; this is an error in the Swift 6 language mode
    |                       `- note: task-isolated 'notification' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
129 |             }
130 |         }
/Users/admin/builder/spi-builder-workspace/Sources/HSObserver/HSObserver.swift:126:18: warning: task or actor isolated value cannot be sent; this is an error in the Swift 6 language mode
124 |         let regularBlock:((Notification) -> Swift.Void) = {
125 |             notification in
126 |             Task {
    |                  `- warning: task or actor isolated value cannot be sent; this is an error in the Swift 6 language mode
127 |                 @MainActor in
128 |                 block(notification)
[6/8] Compiling HSObserver HSHasObservers.swift
/Users/admin/builder/spi-builder-workspace/Sources/HSObserver/HSHasObservers.swift:20:13: warning: var 'observerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
18 | }
19 |
20 | private var observerKey: Void?
   |             |- warning: var 'observerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |             |- note: convert 'observerKey' to a 'let' constant to make 'Sendable' shared state immutable
   |             |- note: annotate 'observerKey' 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
21 | public extension HSHasObservers {
22 |     private func _getObservers() -> [HSObserves] {
[7/8] Emitting module HSObserver
/Users/admin/builder/spi-builder-workspace/Sources/HSObserver/HSHasObservers.swift:20:13: warning: var 'observerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
18 | }
19 |
20 | private var observerKey: Void?
   |             |- warning: var 'observerKey' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |             |- note: convert 'observerKey' to a 'let' constant to make 'Sendable' shared state immutable
   |             |- note: annotate 'observerKey' 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
21 | public extension HSHasObservers {
22 |     private func _getObservers() -> [HSObserves] {
[8/8] Compiling HSObserver HSKeyPathObserver.swift
Build complete! (8.09s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "HSObserver",
  "name" : "HSObserver",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "HSObserver",
      "targets" : [
        "HSObserver"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "HSObserverTests",
      "module_type" : "SwiftTarget",
      "name" : "HSObserverTests",
      "path" : "Tests/HSObserverTests",
      "sources" : [
        "HSObserverTests.swift",
        "XCTestManifests.swift"
      ],
      "target_dependencies" : [
        "HSObserver"
      ],
      "type" : "test"
    },
    {
      "c99name" : "HSObserver",
      "module_type" : "SwiftTarget",
      "name" : "HSObserver",
      "path" : "Sources/HSObserver",
      "product_memberships" : [
        "HSObserver"
      ],
      "sources" : [
        "HSHasObservers.swift",
        "HSKeyPathObserver.swift",
        "HSObserver.swift",
        "HSObserves.swift",
        "NSNotification+HSObserver.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Done.