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 SimpleAnalytics, reference 3.0.0 (2442ad), with Swift 6.0 for macOS (SPM) on 3 Nov 2024 10:27:50 UTC.

Swift 6 data race errors: 3

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/dennisbirch/simple-analytics.git
Reference: 3.0.0
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/dennisbirch/simple-analytics
 * tag               3.0.0      -> FETCH_HEAD
HEAD is now at 2442ad7 Remove use of UserDefaults from framework and add configuration parameter for device identifier
Cloned https://github.com/dennisbirch/simple-analytics.git
Revision (git rev-parse @):
2442ad7d7556fcbe7e55124148912e92750ea699
SUCCESS checkout https://github.com/dennisbirch/simple-analytics.git at 3.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": "simple-analytics",
      "name": "SimpleAnalytics",
      "url": "https://github.com/dennisbirch/simple-analytics.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/simple-analytics",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/dennisbirch/simple-analytics.git
[1/470] Fetching simple-analytics
Fetched https://github.com/dennisbirch/simple-analytics.git from cache (1.11s)
Creating working copy for https://github.com/dennisbirch/simple-analytics.git
Working copy of https://github.com/dennisbirch/simple-analytics.git resolved at 3.0.0 (2442ad7)
warning: '.resolve-product-dependencies': dependency 'simple-analytics' 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/dennisbirch/simple-analytics.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 SimpleAnalytics SimpleAnalytics.swift
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/SimpleAnalytics.swift:5:24: warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 3 |
 4 | public struct SimpleAnalytics {
 5 |     private static var logger = OSLog(subsystem: "SimpleAnalytics", category: "")
   |                        |- warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                        |- note: convert 'logger' to a 'let' constant to make 'Sendable' shared state immutable
   |                        |- note: annotate 'logger' 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
 6 |
 7 |     public static func debugLog(_ message: StaticString, _ arg: String? = nil) {
[4/8] Emitting module SimpleAnalytics
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:86:6: warning: extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode
 84 |     ///
 85 |     /// This method is required for configuring the framework on macOS.
 86 |     @available (iOS, deprecated: 13.0, message: "Please use the setEndpoint(_:, sharedApp:) method")
    |      `- warning: extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode
 87 |     @objc public static func setEndpoint(_ urlString: String, deviceID: String, submissionCompletionCallback: (() -> Void)? = nil) {
 88 |         shared.endpoint = urlString
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:48:24: warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 46 |     private var shouldSubmitAtAppDismiss = true
 47 |
 48 |     private static var shared = AppAnalytics(deviceID: "")
    |                        |- warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'shared' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'shared' 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
 49 |     private static let persistenceFileName = "PersistedAnalytics"
 50 |
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/SimpleAnalytics.swift:5:24: warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 3 |
 4 | public struct SimpleAnalytics {
 5 |     private static var logger = OSLog(subsystem: "SimpleAnalytics", category: "")
   |                        |- warning: static property 'logger' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
   |                        |- note: convert 'logger' to a 'let' constant to make 'Sendable' shared state immutable
   |                        |- note: annotate 'logger' 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
 6 |
 7 |     public static func debugLog(_ message: StaticString, _ arg: String? = nil) {
[5/8] Compiling SimpleAnalytics AnalyticsItem.swift
[6/8] Compiling SimpleAnalytics AnalyticsSubmitter.swift
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AnalyticsSubmitter.swift:62:21: warning: capture of 'errorHandler' with non-sendable type '([AnalyticsItem], [AnalyticsCount]) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 60 |                 if let taskError = error {
 61 |                     SimpleAnalytics.debugLog("Error posting analytics request: %@", taskError.localizedDescription)
 62 |                     errorHandler(items, itemCounts)
    |                     |- warning: capture of 'errorHandler' with non-sendable type '([AnalyticsItem], [AnalyticsCount]) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
    |                     `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
 63 |                 } else {
 64 |                     if let httpResponse = response as? HTTPURLResponse {
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AnalyticsSubmitter.swift:86:25: warning: capture of 'successHandler' with non-sendable type '(String) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 84 |                     if let data = data {
 85 |                         let message = self.handleResponseData(data)
 86 |                         successHandler(message)
    |                         |- warning: capture of 'successHandler' with non-sendable type '(String) -> Void' in a `@Sendable` closure; this is an error in the Swift 6 language mode
    |                         `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
 87 |                     } else {
 88 |                         errorHandler(items, itemCounts)
[7/8] Compiling SimpleAnalytics AnalyticsCount.swift
[8/8] Compiling SimpleAnalytics AppAnalytics.swift
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:86:6: warning: extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode
 84 |     ///
 85 |     /// This method is required for configuring the framework on macOS.
 86 |     @available (iOS, deprecated: 13.0, message: "Please use the setEndpoint(_:, sharedApp:) method")
    |      `- warning: extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode
 87 |     @objc public static func setEndpoint(_ urlString: String, deviceID: String, submissionCompletionCallback: (() -> Void)? = nil) {
 88 |         shared.endpoint = urlString
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:48:24: warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 46 |     private var shouldSubmitAtAppDismiss = true
 47 |
 48 |     private static var shared = AppAnalytics(deviceID: "")
    |                        |- warning: static property 'shared' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'shared' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'shared' 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
 49 |     private static let persistenceFileName = "PersistedAnalytics"
 50 |
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:320:13: warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 14 | import os.log
 15 |
 16 | @objc public class AppAnalytics: NSObject {
    |                    `- note: class 'AppAnalytics' does not conform to the 'Sendable' protocol
 17 |     // MARK: - Public & Accessible Properties
 18 |
    :
318 |
319 |         DispatchQueue.global().async { [weak self] in
320 |             self?.submitItems(items, counters: counters, with: submitter)
    |             `- warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
321 |         }
322 |     }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:320:64: warning: capture of 'submitter' with non-sendable type 'any AnalyticsSubmitting' in a `@Sendable` closure; this is an error in the Swift 6 language mode
318 |
319 |         DispatchQueue.global().async { [weak self] in
320 |             self?.submitItems(items, counters: counters, with: submitter)
    |                                                                `- warning: capture of 'submitter' with non-sendable type 'any AnalyticsSubmitting' in a `@Sendable` closure; this is an error in the Swift 6 language mode
321 |         }
322 |     }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AnalyticsSubmitter.swift:10:10: note: protocol 'AnalyticsSubmitting' does not conform to the 'Sendable' protocol
  8 | import Foundation
  9 |
 10 | protocol AnalyticsSubmitting {
    |          `- note: protocol 'AnalyticsSubmitting' does not conform to the 'Sendable' protocol
 11 |     func submitItems(_ items: [AnalyticsItem], itemCounts: [AnalyticsCount],
 12 |                      successHandler: @escaping(String) -> Void,
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:328:31: warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 14 | import os.log
 15 |
 16 | @objc public class AppAnalytics: NSObject {
    |                    `- note: class 'AppAnalytics' does not conform to the 'Sendable' protocol
 17 |     // MARK: - Public & Accessible Properties
 18 |
    :
326 |             DispatchQueue.main.async {
327 |                 SimpleAnalytics.debugLog("Success submitting analytics: %@", message)
328 |                 if let base = self?.baseItemCount {
    |                               `- warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
329 |                     self?.maxItemCount = base
330 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:328:31: warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
326 |             DispatchQueue.main.async {
327 |                 SimpleAnalytics.debugLog("Success submitting analytics: %@", message)
328 |                 if let base = self?.baseItemCount {
    |                               `- warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
329 |                     self?.maxItemCount = base
330 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:329:21: warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
327 |                 SimpleAnalytics.debugLog("Success submitting analytics: %@", message)
328 |                 if let base = self?.baseItemCount {
329 |                     self?.maxItemCount = base
    |                     `- warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
330 |                 }
331 |             }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:346:17: warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 14 | import os.log
 15 |
 16 | @objc public class AppAnalytics: NSObject {
    |                    `- note: class 'AppAnalytics' does not conform to the 'Sendable' protocol
 17 |     // MARK: - Public & Accessible Properties
 18 |
    :
344 |             DispatchQueue.main.async {
345 |                 SimpleAnalytics.debugLog("Analytics submission failed. Restoring items.")
346 |                 self?.resetItems(errorItems, counters: errorCounters)
    |                 `- warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
347 | #if os(iOS)
348 |                 if let task = self?.backgroundTaskID,
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:346:17: warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
344 |             DispatchQueue.main.async {
345 |                 SimpleAnalytics.debugLog("Analytics submission failed. Restoring items.")
346 |                 self?.resetItems(errorItems, counters: errorCounters)
    |                 `- warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
347 | #if os(iOS)
348 |                 if let task = self?.backgroundTaskID,
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:353:37: warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
351 |                 }
352 | #elseif os(macOS)
353 |                 if let completion = self?.submissionCompletionCallback {
    |                                     `- warning: reference to captured var 'self' in concurrently-executing code; this is an error in the Swift 6 language mode
354 |                     completion()
355 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:386:17: warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
 14 | import os.log
 15 |
 16 | @objc public class AppAnalytics: NSObject {
    |                    `- note: class 'AppAnalytics' does not conform to the 'Sendable' protocol
 17 |     // MARK: - Public & Accessible Properties
 18 |
    :
384 | #elseif os(macOS)
385 |             DispatchQueue.main.async { [weak self] in
386 |                 self?.clearAndSubmitItems()
    |                 `- warning: capture of 'self' with non-sendable type 'AppAnalytics?' in a `@Sendable` closure; this is an error in the Swift 6 language mode
387 |             }
388 | #endif
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:328:31: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
326 |             DispatchQueue.main.async {
327 |                 SimpleAnalytics.debugLog("Success submitting analytics: %@", message)
328 |                 if let base = self?.baseItemCount {
    |                               |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
    |                               `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
329 |                     self?.maxItemCount = base
330 |                 }
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:346:17: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
344 |             DispatchQueue.main.async {
345 |                 SimpleAnalytics.debugLog("Analytics submission failed. Restoring items.")
346 |                 self?.resetItems(errorItems, counters: errorCounters)
    |                 |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
    |                 `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
347 | #if os(iOS)
348 |                 if let task = self?.backgroundTaskID,
/Users/admin/builder/spi-builder-workspace/Sources/SimpleAnalytics/AppAnalytics.swift:386:17: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
384 | #elseif os(macOS)
385 |             DispatchQueue.main.async { [weak self] in
386 |                 self?.clearAndSubmitItems()
    |                 |- warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
    |                 `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
387 |             }
388 | #endif
Build complete! (10.63s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "SimpleAnalytics",
  "name" : "SimpleAnalytics",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "10.0"
    },
    {
      "name" : "macos",
      "version" : "10.12"
    }
  ],
  "products" : [
    {
      "name" : "SimpleAnalytics",
      "targets" : [
        "SimpleAnalytics"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "SimpleAnalyticsTests",
      "module_type" : "SwiftTarget",
      "name" : "SimpleAnalyticsTests",
      "path" : "Tests/SimpleAnalyticsTests",
      "sources" : [
        "SimpleAnalyticsTests.swift",
        "SubmissionTests.swift"
      ],
      "target_dependencies" : [
        "SimpleAnalytics"
      ],
      "type" : "test"
    },
    {
      "c99name" : "SimpleAnalytics",
      "module_type" : "SwiftTarget",
      "name" : "SimpleAnalytics",
      "path" : "Sources/SimpleAnalytics",
      "product_memberships" : [
        "SimpleAnalytics"
      ],
      "sources" : [
        "AnalyticsCount.swift",
        "AnalyticsItem.swift",
        "AnalyticsSubmitter.swift",
        "AppAnalytics.swift",
        "SimpleAnalytics.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.2"
}
Done.