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

Swift 6 data race errors: 1

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/dkk/WrappingHStack.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/dkk/WrappingHStack
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 425d948 Update WrappingHStack.podspec
Cloned https://github.com/dkk/WrappingHStack.git
Revision (git rev-parse @):
425d9488ba55f58f0b34498c64c054c77fc2a44b
SUCCESS checkout https://github.com/dkk/WrappingHStack.git at main
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.0
Building package at path:  $workDir
https://github.com/dkk/WrappingHStack.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/8] Compiling WrappingHStack NewLine.swift
[4/8] Compiling WrappingHStack ViewType.swift
[5/8] Compiling WrappingHStack ContentManager.swift
[6/8] Compiling WrappingHStack WrappingHStack.swift
/Users/admin/builder/spi-builder-workspace/Sources/WrappingHStack/WrappingHStack.swift:14:20: warning: static property 'defaultValue' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
 12 | public struct WrappingHStack: View {
 13 |     private struct HeightPreferenceKey: PreferenceKey {
 14 |         static var defaultValue = CGFloat.zero
    |                    |- warning: static property 'defaultValue' 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 'defaultValue' to a 'let' constant to make 'Sendable' shared state immutable
    |                    |- note: annotate 'defaultValue' 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
 15 |         static func reduce(value: inout CGFloat , nextValue: () -> CGFloat) {
 16 |             value = nextValue()
/Users/admin/builder/spi-builder-workspace/Sources/WrappingHStack/WrappingHStack.swift:76:33: warning: call to main actor-isolated initializer 'init(rootView:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
 68 | // Based on https://alejandromp.com/blog/implementing-a-equally-spaced-stack-in-swiftui-thanks-to-tupleview/
 69 | public extension WrappingHStack {
 70 |     @inline(__always) private static func getWidth<V: View>(of view: V) -> Double {
    |                                           `- note: add '@MainActor' to make static method 'getWidth(of:)' part of global actor 'MainActor'
 71 |         if view is NewLine {
 72 |             return .infinity
    :
 74 |
 75 | #if os(macOS)
 76 |         let hostingController = NSHostingController(rootView: view)
    |                                 `- warning: call to main actor-isolated initializer 'init(rootView:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
 77 | #else
 78 |         let hostingController = UIHostingController(rootView: view)
SwiftUI.NSHostingController:7:23: note: calls to initializer 'init(rootView:)' from outside of its actor context are implicitly asynchronous
 5 | @available(visionOS, unavailable)
 6 | @MainActor open class NSHostingController<Content> : NSViewController where Content : View {
 7 |     @MainActor public init(rootView: Content)
   |                       `- note: calls to initializer 'init(rootView:)' from outside of its actor context are implicitly asynchronous
 8 |     @MainActor public init?(coder: NSCoder, rootView: Content)
 9 |     @MainActor required dynamic public init?(coder: NSCoder)
/Users/admin/builder/spi-builder-workspace/Sources/WrappingHStack/WrappingHStack.swift:80:34: warning: call to main actor-isolated instance method 'sizeThatFits(in:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
 68 | // Based on https://alejandromp.com/blog/implementing-a-equally-spaced-stack-in-swiftui-thanks-to-tupleview/
 69 | public extension WrappingHStack {
 70 |     @inline(__always) private static func getWidth<V: View>(of view: V) -> Double {
    |                                           `- note: add '@MainActor' to make static method 'getWidth(of:)' part of global actor 'MainActor'
 71 |         if view is NewLine {
 72 |             return .infinity
    :
 78 |         let hostingController = UIHostingController(rootView: view)
 79 | #endif
 80 |         return hostingController.sizeThatFits(in: CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)).width
    |                                  `- warning: call to main actor-isolated instance method 'sizeThatFits(in:)' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
 81 |     }
 82 |
SwiftUI.NSHostingController:31:28: note: calls to instance method 'sizeThatFits(in:)' from outside of its actor context are implicitly asynchronous
29 |     @MainActor public var sceneBridgingOptions: NSHostingSceneBridgingOptions { get set }
30 |     @MainActor override dynamic open var preferredContentSize: NSSize { get set }
31 |     @MainActor public func sizeThatFits(in size: CGSize) -> CGSize
   |                            `- note: calls to instance method 'sizeThatFits(in:)' from outside of its actor context are implicitly asynchronous
32 |     @MainActor public func _render(seconds: Double)
33 |     @MainActor public func _forEachIdentifiedView(body: (_IdentifiedViewProxy) -> Void)
/Users/admin/builder/spi-builder-workspace/Sources/WrappingHStack/WrappingHStack.swift:76:33: warning: sending 'view' risks causing data races; this is an error in the Swift 6 language mode
 74 |
 75 | #if os(macOS)
 76 |         let hostingController = NSHostingController(rootView: view)
    |                                 |- warning: sending 'view' risks causing data races; this is an error in the Swift 6 language mode
    |                                 `- note: sending task-isolated 'view' to main actor-isolated callee risks causing data races between main actor-isolated and task-isolated uses
 77 | #else
 78 |         let hostingController = UIHostingController(rootView: view)
[7/8] Compiling WrappingHStack InternalWrappingHStack.swift
[8/8] Emitting module WrappingHStack
/Users/admin/builder/spi-builder-workspace/Sources/WrappingHStack/WrappingHStack.swift:14:20: warning: static property 'defaultValue' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
 12 | public struct WrappingHStack: View {
 13 |     private struct HeightPreferenceKey: PreferenceKey {
 14 |         static var defaultValue = CGFloat.zero
    |                    |- warning: static property 'defaultValue' 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 'defaultValue' to a 'let' constant to make 'Sendable' shared state immutable
    |                    |- note: annotate 'defaultValue' 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
 15 |         static func reduce(value: inout CGFloat , nextValue: () -> CGFloat) {
 16 |             value = nextValue()
Build complete! (32.69s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "WrappingHStack",
  "name" : "WrappingHStack",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "13.0"
    },
    {
      "name" : "macos",
      "version" : "10.15"
    }
  ],
  "products" : [
    {
      "name" : "WrappingHStack",
      "targets" : [
        "WrappingHStack"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "WrappingHStack",
      "module_type" : "SwiftTarget",
      "name" : "WrappingHStack",
      "path" : "Sources/WrappingHStack",
      "product_memberships" : [
        "WrappingHStack"
      ],
      "sources" : [
        "ContentManager.swift",
        "InternalWrappingHStack.swift",
        "NewLine.swift",
        "ViewType.swift",
        "WrappingHStack.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.3"
}
Done.
This is a staging environment. For live and up-to-date package information, visit swiftpackageindex.com.