The Swift Package Index logo.Swift Package Index

Build Information

Successful build of NotificationManager, reference main (383a4c), with Swift 6.1 for macOS (SPM) on 5 Oct 2026 06:04:12 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: 5.1.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/timokoethe/NotificationManager.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/timokoethe/NotificationManager
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 383a4c0 Serialize pending notification operations (#13)
Cloned https://github.com/timokoethe/NotificationManager.git
Revision (git rev-parse @):
383a4c0ccd9ccb5ba55c74b6180b64d7b5c42b99
SUCCESS checkout https://github.com/timokoethe/NotificationManager.git at main
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/timokoethe/NotificationManager.git
https://github.com/timokoethe/NotificationManager.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "NotificationManager",
  "name" : "NotificationManager",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.15"
    },
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "visionos",
      "version" : "1.0"
    }
  ],
  "products" : [
    {
      "name" : "NotificationManager",
      "targets" : [
        "NotificationManager"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "NotificationManagerTests",
      "module_type" : "SwiftTarget",
      "name" : "NotificationManagerTests",
      "path" : "Tests/NotificationManagerTests",
      "sources" : [
        "NotificationManagerTests.swift"
      ],
      "target_dependencies" : [
        "NotificationManager"
      ],
      "type" : "test"
    },
    {
      "c99name" : "NotificationManager",
      "module_type" : "SwiftTarget",
      "name" : "NotificationManager",
      "path" : "Sources/NotificationManager",
      "product_memberships" : [
        "NotificationManager"
      ],
      "sources" : [
        "NotificationManager.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.9"
}
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/4] Compiling NotificationManager NotificationManager.swift
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:54:24: warning: static property 'pendingOperations' is not concurrency-safe because non-'Sendable' type 'PendingNotificationOperations' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | public struct NotificationManager {
 53 |     private static let defaultAuthorizationOptions: UNAuthorizationOptions = [.alert, .sound, .badge]
 54 |     private static let pendingOperations = PendingNotificationOperations()
    |                        |- warning: static property 'pendingOperations' is not concurrency-safe because non-'Sendable' type 'PendingNotificationOperations' may have shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: add '@MainActor' to make static property 'pendingOperations' part of global actor 'MainActor'
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 55 |     private static var centerOverride: (any UserNotificationCenter)?
 56 |     static var center: any UserNotificationCenter {
    :
452 | /// Registers operations synchronously, then waits for each predecessor to finish.
453 | /// A serial task chain also preserves ordering across suspension points.
454 | private final class PendingNotificationOperations {
    |                     `- note: class 'PendingNotificationOperations' does not conform to the 'Sendable' protocol
455 |     private let lock = NSLock()
456 |     private var tail: Task<Void, Never>?
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:55:24: warning: static property 'centerOverride' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 53 |     private static let defaultAuthorizationOptions: UNAuthorizationOptions = [.alert, .sound, .badge]
 54 |     private static let pendingOperations = PendingNotificationOperations()
 55 |     private static var centerOverride: (any UserNotificationCenter)?
    |                        |- warning: static property 'centerOverride' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'centerOverride' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: add '@MainActor' to make static property 'centerOverride' part of global actor 'MainActor'
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 56 |     static var center: any UserNotificationCenter {
 57 |         get { centerOverride ?? UNUserNotificationCenter.current() }
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:302:40: warning: type 'UNNotificationRequest' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
300 |     public static func getPendingNotificationRequests() async -> [UNNotificationRequest] {
301 |         let notificationCenter = center
302 |         return await pendingOperations.enqueue {
    |                                        `- warning: type 'UNNotificationRequest' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
303 |             await notificationCenter.pendingNotificationRequests()
304 |         }.value
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: class 'UNNotificationRequest' does not conform to the 'Sendable' protocol
14 |
15 | API_AVAILABLE(macos(10.14), ios(10.0), watchos(3.0), tvos(10.0))
16 | @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
   |            `- note: class 'UNNotificationRequest' does not conform to the 'Sendable' protocol
17 |
18 | // The unique identifier for this notification request. It can be used to replace or remove a pending notification request or a delivered notification.
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:2:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'UserNotifications'
  1 | import Foundation
  2 | import UserNotifications
    | `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'UserNotifications'
  3 |
  4 | protocol UserNotificationCenter {
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:304:11: warning: type 'UNNotificationRequest' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
302 |         return await pendingOperations.enqueue {
303 |             await notificationCenter.pendingNotificationRequests()
304 |         }.value
    |           `- warning: type 'UNNotificationRequest' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
305 |     }
306 |
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h:16:12: note: class 'UNNotificationRequest' does not conform to the 'Sendable' protocol
14 |
15 | API_AVAILABLE(macos(10.14), ios(10.0), watchos(3.0), tvos(10.0))
16 | @interface UNNotificationRequest : NSObject <NSCopying, NSSecureCoding>
   |            `- note: class 'UNNotificationRequest' does not conform to the 'Sendable' protocol
17 |
18 | // The unique identifier for this notification request. It can be used to replace or remove a pending notification request or a delivered notification.
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:476:25: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
474 |         defer { lock.unlock() }
475 |         let previous = tail
476 |         let task = Task {
    |                         `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
477 |             await previous?.value
478 |             return try await operation()
    |                              `- note: closure captures 'operation' which is accessible to code in the current task
479 |         }
480 |         // Failure must not prevent later operations (especially removals).
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:463:25: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
461 |         defer { lock.unlock() }
462 |         let previous = tail
463 |         let task = Task {
    |                         `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
464 |             await previous?.value
465 |             return await operation()
    |                          `- note: closure captures 'operation' which is accessible to code in the current task
466 |         }
467 |         tail = Task { _ = await task.value }
[4/4] Emitting module NotificationManager
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:54:24: warning: static property 'pendingOperations' is not concurrency-safe because non-'Sendable' type 'PendingNotificationOperations' may have shared mutable state; this is an error in the Swift 6 language mode
 52 | public struct NotificationManager {
 53 |     private static let defaultAuthorizationOptions: UNAuthorizationOptions = [.alert, .sound, .badge]
 54 |     private static let pendingOperations = PendingNotificationOperations()
    |                        |- warning: static property 'pendingOperations' is not concurrency-safe because non-'Sendable' type 'PendingNotificationOperations' may have shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: add '@MainActor' to make static property 'pendingOperations' part of global actor 'MainActor'
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 55 |     private static var centerOverride: (any UserNotificationCenter)?
 56 |     static var center: any UserNotificationCenter {
    :
452 | /// Registers operations synchronously, then waits for each predecessor to finish.
453 | /// A serial task chain also preserves ordering across suspension points.
454 | private final class PendingNotificationOperations {
    |                     `- note: class 'PendingNotificationOperations' does not conform to the 'Sendable' protocol
455 |     private let lock = NSLock()
456 |     private var tail: Task<Void, Never>?
/Users/admin/builder/spi-builder-workspace/Sources/NotificationManager/NotificationManager.swift:55:24: warning: static property 'centerOverride' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 53 |     private static let defaultAuthorizationOptions: UNAuthorizationOptions = [.alert, .sound, .badge]
 54 |     private static let pendingOperations = PendingNotificationOperations()
 55 |     private static var centerOverride: (any UserNotificationCenter)?
    |                        |- warning: static property 'centerOverride' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'centerOverride' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: add '@MainActor' to make static property 'centerOverride' part of global actor 'MainActor'
    |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 56 |     static var center: any UserNotificationCenter {
 57 |         get { centerOverride ?? UNUserNotificationCenter.current() }
Build complete! (4.51s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "NotificationManager",
  "name" : "NotificationManager",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "macos",
      "version" : "10.15"
    },
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "visionos",
      "version" : "1.0"
    }
  ],
  "products" : [
    {
      "name" : "NotificationManager",
      "targets" : [
        "NotificationManager"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "NotificationManagerTests",
      "module_type" : "SwiftTarget",
      "name" : "NotificationManagerTests",
      "path" : "Tests/NotificationManagerTests",
      "sources" : [
        "NotificationManagerTests.swift"
      ],
      "target_dependencies" : [
        "NotificationManager"
      ],
      "type" : "test"
    },
    {
      "c99name" : "NotificationManager",
      "module_type" : "SwiftTarget",
      "name" : "NotificationManager",
      "path" : "Sources/NotificationManager",
      "product_memberships" : [
        "NotificationManager"
      ],
      "sources" : [
        "NotificationManager.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.9"
}
Done.