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 swift-backtrace, reference pretty-print (c3d60f), with Swift 6.0 for Linux on 2 Nov 2024 20:59:38 UTC.

Swift 6 data race errors: 4

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.56.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/natinusala/swift-backtrace.git
Reference: pretty-print
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/natinusala/swift-backtrace
 * branch            pretty-print -> FETCH_HEAD
 * [new branch]      pretty-print -> origin/pretty-print
HEAD is now at c3d60fe Surround the function name in red
Cloned https://github.com/natinusala/swift-backtrace.git
Revision (git rev-parse @):
c3d60fe020e980902994397d87f54c34b8937787
SUCCESS checkout https://github.com/natinusala/swift-backtrace.git at pretty-print
========================================
Build
========================================
Selected platform:         linux
Swift version:             6.0
Building package at path:  $PWD
https://github.com/natinusala/swift-backtrace.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Building for debugging...
[0/19] Write sources
[1/19] Compiling CBacktrace simple.c
[1/19] Compiling CBacktrace sort.c
[3/19] Compiling CBacktrace state.c
[4/19] Compiling CBacktrace print.c
[5/19] Compiling CBacktrace mmap.c
[6/19] Compiling CBacktrace mmapio.c
[7/19] Write sources
[8/19] Compiling CBacktrace posix.c
[9/19] Compiling CBacktrace fileline.c
[10/19] Compiling CBacktrace backtrace.c
[11/19] Compiling CBacktrace atomic.c
[12/19] Compiling CBacktrace dwarf.c
[13/19] Compiling CBacktrace elf.c
[14/19] Write swift-version-24593BA9C3E375BF.txt
[16/22] Compiling Backtrace Demangle.swift
[17/22] Compiling Backtrace Backtrace.swift
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:24:13: warning: let 'state' is not concurrency-safe because non-'Sendable' type 'OpaquePointer?' may have shared mutable state; this is an error in the Swift 6 language mode
 22 | typealias CBacktraceSyminfoCallback = @convention(c) (_ data: UnsafeMutableRawPointer?, _ pc: UInt, _ filename: UnsafePointer<CChar>?, _ symval: UInt, _ symsize: UInt) -> Void
 23 |
 24 | private let state = backtrace_create_state(nil, /* BACKTRACE_SUPPORTS_THREADS */ 1, nil, nil)
    |             |- warning: let 'state' is not concurrency-safe because non-'Sendable' type 'OpaquePointer?' may have shared mutable state; this is an error in the Swift 6 language mode
    |             |- note: annotate 'state' 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
 25 |
 26 | private let fullCallback: CBacktraceFullCallback? = {
Swift.Optional:1:21: note: generic enum 'Optional' does not conform to the 'Sendable' protocol
1 | @frozen public enum Optional<Wrapped> : ~Copyable where Wrapped : ~Copyable {
  |                     `- note: generic enum 'Optional' does not conform to the 'Sendable' protocol
2 |     case none
3 |     case some(Wrapped)
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:49:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 47 |     str.withCString { ptr in
 48 |         _ = withVaList([ptr]) { vaList in
 49 |             vfprintf(stderr, "%s", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 50 |         }
 51 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:85:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 83 |     str.withCString { ptr in
 84 |         _ = withVaList([ptr]) { vaList in
 85 |             vfprintf(stderr, "%s", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 86 |         }
 87 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:96:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 94 |     if let msg = msg {
 95 |         _ = withVaList([msg, errNo]) { vaList in
 96 |             vfprintf(stderr, "SwiftBacktrace ERROR: %s (errno: %d)\n", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 97 |         }
 98 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:102:58: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
100 |
101 | private func printBacktrace(signal: CInt) {
102 |     _ = fputs("Received signal \(signal). Backtrace:\n", stderr)
    |                                                          `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
103 |     backtrace_full(state, /* skip */ 4, prettyCallback, errorCallback, nil)
104 |     fflush(stderr)
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:104:12: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
102 |     _ = fputs("Received signal \(signal). Backtrace:\n", stderr)
103 |     backtrace_full(state, /* skip */ 4, prettyCallback, errorCallback, nil)
104 |     fflush(stderr)
    |            `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
105 | }
106 |
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
[18/22] Emitting module Backtrace
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:24:13: warning: let 'state' is not concurrency-safe because non-'Sendable' type 'OpaquePointer?' may have shared mutable state; this is an error in the Swift 6 language mode
 22 | typealias CBacktraceSyminfoCallback = @convention(c) (_ data: UnsafeMutableRawPointer?, _ pc: UInt, _ filename: UnsafePointer<CChar>?, _ symval: UInt, _ symsize: UInt) -> Void
 23 |
 24 | private let state = backtrace_create_state(nil, /* BACKTRACE_SUPPORTS_THREADS */ 1, nil, nil)
    |             |- warning: let 'state' is not concurrency-safe because non-'Sendable' type 'OpaquePointer?' may have shared mutable state; this is an error in the Swift 6 language mode
    |             |- note: annotate 'state' 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
 25 |
 26 | private let fullCallback: CBacktraceFullCallback? = {
Swift.Optional:1:21: note: generic enum 'Optional' does not conform to the 'Sendable' protocol
1 | @frozen public enum Optional<Wrapped> : ~Copyable where Wrapped : ~Copyable {
  |                     `- note: generic enum 'Optional' does not conform to the 'Sendable' protocol
2 |     case none
3 |     case some(Wrapped)
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:49:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 47 |     str.withCString { ptr in
 48 |         _ = withVaList([ptr]) { vaList in
 49 |             vfprintf(stderr, "%s", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 50 |         }
 51 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:85:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 83 |     str.withCString { ptr in
 84 |         _ = withVaList([ptr]) { vaList in
 85 |             vfprintf(stderr, "%s", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 86 |         }
 87 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
/host/spi-builder-workspace/Sources/Backtrace/Backtrace.swift:96:22: warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 94 |     if let msg = msg {
 95 |         _ = withVaList([msg, errNo]) { vaList in
 96 |             vfprintf(stderr, "SwiftBacktrace ERROR: %s (errno: %d)\n", vaList)
    |                      `- warning: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
 97 |         }
 98 |     }
CBacktrace.stderr:1:12: note: var declared here
1 | public var stderr: UnsafeMutablePointer<FILE>!
  |            `- note: var declared here
[19/23] Wrapping AST for Backtrace for debugging
[21/25] Emitting module Sample
[22/25] Compiling Sample main.swift
[23/26] Wrapping AST for Sample for debugging
[24/26] Write Objects.LinkFileList
[25/26] Linking Sample
Build complete! (10.22s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "swift-backtrace",
  "name" : "swift-backtrace",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "Backtrace",
      "targets" : [
        "Backtrace"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    },
    {
      "name" : "Sample",
      "targets" : [
        "Sample"
      ],
      "type" : {
        "executable" : null
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "Sample",
      "module_type" : "SwiftTarget",
      "name" : "Sample",
      "path" : "Sources/Sample",
      "product_memberships" : [
        "Sample"
      ],
      "sources" : [
        "main.swift"
      ],
      "target_dependencies" : [
        "Backtrace"
      ],
      "type" : "executable"
    },
    {
      "c99name" : "CBacktrace",
      "module_type" : "ClangTarget",
      "name" : "CBacktrace",
      "path" : "Sources/CBacktrace",
      "product_memberships" : [
        "Backtrace",
        "Sample"
      ],
      "sources" : [
        "atomic.c",
        "backtrace.c",
        "dwarf.c",
        "elf.c",
        "fileline.c",
        "mmap.c",
        "mmapio.c",
        "posix.c",
        "print.c",
        "simple.c",
        "sort.c",
        "state.c"
      ],
      "type" : "library"
    },
    {
      "c99name" : "BacktraceTests",
      "module_type" : "SwiftTarget",
      "name" : "BacktraceTests",
      "path" : "Tests/BacktraceTests",
      "sources" : [
        "BacktraceTests+XCTest.swift",
        "BacktraceTests.swift"
      ],
      "target_dependencies" : [
        "Backtrace"
      ],
      "type" : "test"
    },
    {
      "c99name" : "Backtrace",
      "module_type" : "SwiftTarget",
      "name" : "Backtrace",
      "path" : "Sources/Backtrace",
      "product_memberships" : [
        "Backtrace",
        "Sample"
      ],
      "sources" : [
        "Backtrace.swift",
        "Demangle.swift"
      ],
      "target_dependencies" : [
        "CBacktrace"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.0"
}
basic-6.0-latest: Pulling from finestructure/spi-images
Digest: sha256:47d26c99ca4f1ac0a332c85fd5b13ff4390e72115219984a57a68fe9d1063a05
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.0-latest
Done.