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 sMock, reference master (831a80), with Swift 6.0 for macOS (SPM) on 3 Nov 2024 03:33:16 UTC.

Swift 6 data race errors: 7

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/Alkenso/sMock.git
Reference: master
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/Alkenso/sMock
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at 831a80a Merge branch 'refactoring'
Cloned https://github.com/Alkenso/sMock.git
Revision (git rev-parse @):
831a80a4cef948c0b0a4bbaf812f7b6f4b101ba1
SUCCESS checkout https://github.com/Alkenso/sMock.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": "smock",
      "name": "sMock",
      "url": "https://github.com/Alkenso/sMock.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/sMock",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/Alkenso/sMock.git
[1/208] Fetching smock
Fetched https://github.com/Alkenso/sMock.git from cache (0.82s)
Creating working copy for https://github.com/Alkenso/sMock.git
Working copy of https://github.com/Alkenso/sMock.git resolved at master (831a80a)
warning: '.resolve-product-dependencies': dependency 'smock' 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/Alkenso/sMock.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 sMock sMock.swift
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:45:23: warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 43 |     /// By default, in such cases sMock will trigger XCTFail.
 44 |     /// Change this handler in 'setUp' method either on each test case or in the very beginning of the individual test.
 45 |     public static var unexpectedCallBehavior: UnexpectedCallBehavior = .failTest
    |                       |- warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'unexpectedCallBehavior' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'unexpectedCallBehavior' 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
 46 |
 47 |     /// Timeout used when calling `waitForExpectations() -> Bool` method.
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:49:23: warning: static property 'waitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 47 |     /// Timeout used when calling `waitForExpectations() -> Bool` method.
 48 |     /// Change this value in 'setUp' method either on each test case or in the very beginning of the individual test.
 49 |     public static var waitTimeout: TimeInterval = 0.5
    |                       |- warning: static property 'waitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'waitTimeout' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'waitTimeout' 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
 50 |
 51 |     /// Wait for currently registered sMock expectations.
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:80:23: warning: static property 'explicitCurrentTestCase' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 78 |     /// Set this variable before using any mock objects.
 79 |     /// Usually set it in 'setUp' method of concrete XCTestCase, assigning 'self' to it.
 80 |     public static var explicitCurrentTestCase: XCTestCase? = nil
    |                       |- warning: static property 'explicitCurrentTestCase' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'explicitCurrentTestCase' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'explicitCurrentTestCase' 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
 81 | }
 82 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:94:24: warning: static property 'expectations' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 92 |
 93 |     private static let expectationsSyncQueue = DispatchQueue(label: "sMock.expectationsSyncQueue")
 94 |     private static var expectations: [XCTestExpectation] = []
    |                        |- warning: static property 'expectations' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'expectations' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'expectations' 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
 95 | }
 96 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:112:16: warning: static property 'defaultUnexpectedCallBehavior' is not concurrency-safe because non-'Sendable' type 'sMock.UnexpectedCallBehavior' may have shared mutable state; this is an error in the Swift 6 language mode
 29 | /// sMock configuration.
 30 | extension sMock {
 31 |     public enum UnexpectedCallBehavior {
    |                 `- note: consider making enum 'UnexpectedCallBehavior' conform to the 'Sendable' protocol
 32 |         /// Only warns (print) about unexpected call of mocked entities.
 33 |         case warning
    :
110 |
111 | private extension sMock {
112 |     static let defaultUnexpectedCallBehavior: UnexpectedCallBehavior = .failTest
    |                |- warning: static property 'defaultUnexpectedCallBehavior' is not concurrency-safe because non-'Sendable' type 'sMock.UnexpectedCallBehavior' may have shared mutable state; this is an error in the Swift 6 language mode
    |                |- note: annotate 'defaultUnexpectedCallBehavior' 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
113 |     static var defaultWaitTimeout: TimeInterval = 0.5
114 | }
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:113:16: warning: static property 'defaultWaitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
111 | private extension sMock {
112 |     static let defaultUnexpectedCallBehavior: UnexpectedCallBehavior = .failTest
113 |     static var defaultWaitTimeout: TimeInterval = 0.5
    |                |- warning: static property 'defaultWaitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                |- note: convert 'defaultWaitTimeout' to a 'let' constant to make 'Sendable' shared state immutable
    |                |- note: annotate 'defaultWaitTimeout' 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
114 | }
115 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:119:16: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'MocksSupport' may have shared mutable state; this is an error in the Swift 6 language mode
116 | // MARK: - MocksSupport
117 |
118 | class MocksSupport {
    |       `- note: class 'MocksSupport' does not conform to the 'Sendable' protocol
119 |     static let shared = MocksSupport()
    |                |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'MocksSupport' 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
120 |
121 |     var currentTestCase: XCTestCase {
[4/8] Compiling sMock MockMethod.swift
[5/8] Compiling sMock _MockFunctionBase.swift
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:45:23: warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 43 |     /// By default, in such cases sMock will trigger XCTFail.
 44 |     /// Change this handler in 'setUp' method either on each test case or in the very beginning of the individual test.
 45 |     public static var unexpectedCallBehavior: UnexpectedCallBehavior = .failTest
    |                       |- warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'unexpectedCallBehavior' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'unexpectedCallBehavior' 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
 46 |
 47 |     /// Timeout used when calling `waitForExpectations() -> Bool` method.
/Users/admin/builder/spi-builder-workspace/Sources/sMock/_MockFunctionBase.swift:285:13: warning: capture of 'self' with non-sendable type 'ArgumentCaptor<Args>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
272 | // MARK: - Capturing arguments
273 |
274 | public class ArgumentCaptor<Args> {
    |              `- note: generic class 'ArgumentCaptor' does not conform to the 'Sendable' protocol
275 |     private var queue = DispatchQueue(label: "ArgumentCaptor")
276 |     private var capturedArgs: [Args] = []
    :
283 |     func capture(_ args: Args) {
284 |         queue.async {
285 |             self.capturedArgs.append(args)
    |             `- warning: capture of 'self' with non-sendable type 'ArgumentCaptor<Args>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
286 |         }
287 |     }
/Users/admin/builder/spi-builder-workspace/Sources/sMock/_MockFunctionBase.swift:285:38: warning: capture of 'args' with non-sendable type 'Args' in a `@Sendable` closure; this is an error in the Swift 6 language mode
272 | // MARK: - Capturing arguments
273 |
274 | public class ArgumentCaptor<Args> {
    |                             `- note: consider making generic parameter 'Args' conform to the 'Sendable' protocol
275 |     private var queue = DispatchQueue(label: "ArgumentCaptor")
276 |     private var capturedArgs: [Args] = []
    :
283 |     func capture(_ args: Args) {
284 |         queue.async {
285 |             self.capturedArgs.append(args)
    |                                      `- warning: capture of 'args' with non-sendable type 'Args' in a `@Sendable` closure; this is an error in the Swift 6 language mode
286 |         }
287 |     }
[6/8] Emitting module sMock
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:45:23: warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 43 |     /// By default, in such cases sMock will trigger XCTFail.
 44 |     /// Change this handler in 'setUp' method either on each test case or in the very beginning of the individual test.
 45 |     public static var unexpectedCallBehavior: UnexpectedCallBehavior = .failTest
    |                       |- warning: static property 'unexpectedCallBehavior' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'unexpectedCallBehavior' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'unexpectedCallBehavior' 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
 46 |
 47 |     /// Timeout used when calling `waitForExpectations() -> Bool` method.
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:49:23: warning: static property 'waitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 47 |     /// Timeout used when calling `waitForExpectations() -> Bool` method.
 48 |     /// Change this value in 'setUp' method either on each test case or in the very beginning of the individual test.
 49 |     public static var waitTimeout: TimeInterval = 0.5
    |                       |- warning: static property 'waitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'waitTimeout' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'waitTimeout' 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
 50 |
 51 |     /// Wait for currently registered sMock expectations.
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:80:23: warning: static property 'explicitCurrentTestCase' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 78 |     /// Set this variable before using any mock objects.
 79 |     /// Usually set it in 'setUp' method of concrete XCTestCase, assigning 'self' to it.
 80 |     public static var explicitCurrentTestCase: XCTestCase? = nil
    |                       |- warning: static property 'explicitCurrentTestCase' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: convert 'explicitCurrentTestCase' to a 'let' constant to make 'Sendable' shared state immutable
    |                       |- note: annotate 'explicitCurrentTestCase' 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
 81 | }
 82 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:94:24: warning: static property 'expectations' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
 92 |
 93 |     private static let expectationsSyncQueue = DispatchQueue(label: "sMock.expectationsSyncQueue")
 94 |     private static var expectations: [XCTestExpectation] = []
    |                        |- warning: static property 'expectations' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                        |- note: convert 'expectations' to a 'let' constant to make 'Sendable' shared state immutable
    |                        |- note: annotate 'expectations' 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
 95 | }
 96 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:112:16: warning: static property 'defaultUnexpectedCallBehavior' is not concurrency-safe because non-'Sendable' type 'sMock.UnexpectedCallBehavior' may have shared mutable state; this is an error in the Swift 6 language mode
 29 | /// sMock configuration.
 30 | extension sMock {
 31 |     public enum UnexpectedCallBehavior {
    |                 `- note: consider making enum 'UnexpectedCallBehavior' conform to the 'Sendable' protocol
 32 |         /// Only warns (print) about unexpected call of mocked entities.
 33 |         case warning
    :
110 |
111 | private extension sMock {
112 |     static let defaultUnexpectedCallBehavior: UnexpectedCallBehavior = .failTest
    |                |- warning: static property 'defaultUnexpectedCallBehavior' is not concurrency-safe because non-'Sendable' type 'sMock.UnexpectedCallBehavior' may have shared mutable state; this is an error in the Swift 6 language mode
    |                |- note: annotate 'defaultUnexpectedCallBehavior' 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
113 |     static var defaultWaitTimeout: TimeInterval = 0.5
114 | }
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:113:16: warning: static property 'defaultWaitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
111 | private extension sMock {
112 |     static let defaultUnexpectedCallBehavior: UnexpectedCallBehavior = .failTest
113 |     static var defaultWaitTimeout: TimeInterval = 0.5
    |                |- warning: static property 'defaultWaitTimeout' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
    |                |- note: convert 'defaultWaitTimeout' to a 'let' constant to make 'Sendable' shared state immutable
    |                |- note: annotate 'defaultWaitTimeout' 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
114 | }
115 |
/Users/admin/builder/spi-builder-workspace/Sources/sMock/sMock.swift:119:16: warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'MocksSupport' may have shared mutable state; this is an error in the Swift 6 language mode
116 | // MARK: - MocksSupport
117 |
118 | class MocksSupport {
    |       `- note: class 'MocksSupport' does not conform to the 'Sendable' protocol
119 |     static let shared = MocksSupport()
    |                |- warning: static property 'shared' is not concurrency-safe because non-'Sendable' type 'MocksSupport' 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
120 |
121 |     var currentTestCase: XCTestCase {
[7/8] Compiling sMock MockClosure.swift
[8/8] Compiling sMock Matcher.swift
Build complete! (12.15s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "sMock",
  "name" : "sMock",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "sMock",
      "targets" : [
        "sMock"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "sMockTests",
      "module_type" : "SwiftTarget",
      "name" : "sMockTests",
      "path" : "Sources/sMockTests",
      "sources" : [
        "ClosureTests.swift",
        "MatcherTests.swift"
      ],
      "target_dependencies" : [
        "sMock"
      ],
      "type" : "test"
    },
    {
      "c99name" : "sMock",
      "module_type" : "SwiftTarget",
      "name" : "sMock",
      "path" : "Sources/sMock",
      "product_memberships" : [
        "sMock"
      ],
      "sources" : [
        "Matcher.swift",
        "MockClosure.swift",
        "MockMethod.swift",
        "_MockFunctionBase.swift",
        "sMock.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.1"
}
Done.