This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.

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 iap-pure-client with Swift 6.0 for macOS (SPM).

Swift 6 data race errors: 3

Build Command

env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete

Build Log

========================================
RunAll
========================================
Builder version: 4.40.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/buhe/iap-pure-client.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/buhe/iap-pure-client
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at d2f101d "Add iapMap to IAPManager and update payment status in checkPaymentStatus and SKPaymentTransactionObserver."
Cloned https://github.com/buhe/iap-pure-client.git
Revision (git rev-parse @):
d2f101d06e560750626bd07d4129ab27efef087b
SUCCESS checkout https://github.com/buhe/iap-pure-client.git at main
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $workDir
https://github.com/buhe/iap-pure-client.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a 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-6F35C1178C84523A.txt
[3/7] Compiling IAP IAPMaganer.swift
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:12:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | import StoreKit
  8 |
  9 | public class IAPManager: NSObject, ObservableObject {
    |              `- note: class 'IAPManager' does not conform to the 'Sendable' protocol
 10 |
 11 |     var callback: ((_ pid: String) -> Void)? = nil
 12 |     public static let shared = IAPManager()
    |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- 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
 13 |     @Published public var products = [SKProduct]()
 14 |     fileprivate var productRequest: SKProductsRequest!
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:65:37: warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 63 |                                 if utcMilliseconds > expires {
 64 |                                     // timeout
 65 |                                     vaild = false
    |                                     `- warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 66 |                                 }
 67 |                             } else {
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:69:33: warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 67 |                             } else {
 68 |                                 print("no latest_receipt_info. ")
 69 |                                 vaild = false
    |                                 `- warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 70 |                             }
 71 |                         } catch {
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:73:29: warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 71 |                         } catch {
 72 |                             print("Pasre server error: \(error)")
 73 |                             vaild = false
    |                             `- warning: mutation of captured var 'vaild' in concurrently-executing code; this is an error in the Swift 6 language mode
 74 |                         }
 75 |                     }
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:125:13: warning: capture of 'self' with non-sendable type 'IAPManager' in a `@Sendable` closure; this is an error in the Swift 6 language mode
  7 | import StoreKit
  8 |
  9 | public class IAPManager: NSObject, ObservableObject {
    |              `- note: class 'IAPManager' does not conform to the 'Sendable' protocol
 10 |
 11 |     var callback: ((_ pid: String) -> Void)? = nil
    :
123 |         }
124 |         DispatchQueue.main.async {
125 |             self.products = response.products
    |             `- warning: capture of 'self' with non-sendable type 'IAPManager' in a `@Sendable` closure; this is an error in the Swift 6 language mode
126 |         }
127 |     }
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPViewModel.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
 6 | import SwiftUI
 7 |
 8 | public class IAPViewModel :ObservableObject {
   |              `- note: class 'IAPViewModel' does not conform to the 'Sendable' protocol
 9 |     @Published public var loading = false
10 |
11 |     public static let shared: IAPViewModel = IAPViewModel()
   |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
   |                       |- 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
12 | }
13 |
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:125:13: warning: sending 'self' risks causing data races; this is an error in the Swift 6 language mode
123 |         }
124 |         DispatchQueue.main.async {
125 |             self.products = response.products
    |             |- 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
126 |         }
127 |     }
[4/7] Compiling IAP IAPCache.swift
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPCache.swift:11:23: warning: static property 'five' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
 9 |
10 | public struct IAPCache {
11 |     public static var five = IAPCache()
   |                       |- warning: static property 'five' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
   |                       |- note: convert 'five' to a 'let' constant to make 'Sendable' shared state immutable
   |                       |- note: annotate 'five' 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
12 |
13 |     var cacheRetry: Int
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:12:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | import StoreKit
  8 |
  9 | public class IAPManager: NSObject, ObservableObject {
    |              `- note: class 'IAPManager' does not conform to the 'Sendable' protocol
 10 |
 11 |     var callback: ((_ pid: String) -> Void)? = nil
 12 |     public static let shared = IAPManager()
    |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- 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
 13 |     @Published public var products = [SKProduct]()
 14 |     fileprivate var productRequest: SKProductsRequest!
[5/7] Compiling IAP iap_pure_client.swift
[6/7] Emitting module IAP
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPCache.swift:11:23: warning: static property 'five' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
 9 |
10 | public struct IAPCache {
11 |     public static var five = IAPCache()
   |                       |- warning: static property 'five' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
   |                       |- note: convert 'five' to a 'let' constant to make 'Sendable' shared state immutable
   |                       |- note: annotate 'five' 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
12 |
13 |     var cacheRetry: Int
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPMaganer.swift:12:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | import StoreKit
  8 |
  9 | public class IAPManager: NSObject, ObservableObject {
    |              `- note: class 'IAPManager' does not conform to the 'Sendable' protocol
 10 |
 11 |     var callback: ((_ pid: String) -> Void)? = nil
 12 |     public static let shared = IAPManager()
    |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPManager' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- 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
 13 |     @Published public var products = [SKProduct]()
 14 |     fileprivate var productRequest: SKProductsRequest!
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPViewModel.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
 6 | import SwiftUI
 7 |
 8 | public class IAPViewModel :ObservableObject {
   |              `- note: class 'IAPViewModel' does not conform to the 'Sendable' protocol
 9 |     @Published public var loading = false
10 |
11 |     public static let shared: IAPViewModel = IAPViewModel()
   |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
   |                       |- 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
12 | }
13 |
[7/7] Compiling IAP IAPViewModel.swift
/Users/admin/builder/spi-builder-workspace/Sources/IAP/IAPViewModel.swift:11:23: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
 6 | import SwiftUI
 7 |
 8 | public class IAPViewModel :ObservableObject {
   |              `- note: class 'IAPViewModel' does not conform to the 'Sendable' protocol
 9 |     @Published public var loading = false
10 |
11 |     public static let shared: IAPViewModel = IAPViewModel()
   |                       |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'IAPViewModel' may have shared mutable state; this is an error in the Swift 6 language mode
   |                       |- 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
12 | }
13 |
Build complete! (32.40s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "iap-pure-client",
  "name" : "iap-pure-client",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "12.0"
    }
  ],
  "products" : [
    {
      "name" : "IAP",
      "targets" : [
        "IAP"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "iap_pure_clientTests",
      "module_type" : "SwiftTarget",
      "name" : "iap-pure-clientTests",
      "path" : "Tests/iap-pure-clientTests",
      "sources" : [
        "iap_pure_clientTests.swift"
      ],
      "target_dependencies" : [
        "IAP"
      ],
      "type" : "test"
    },
    {
      "c99name" : "IAP",
      "module_type" : "SwiftTarget",
      "name" : "IAP",
      "path" : "Sources/IAP",
      "product_memberships" : [
        "IAP"
      ],
      "sources" : [
        "IAPCache.swift",
        "IAPMaganer.swift",
        "IAPViewModel.swift",
        "iap_pure_client.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.7.1"
}
Done.
This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.