Xcode 26 beta 5 xcodebuild crash

Good day!

When your project have total 887 or more SPM local targets and then you try to build it, xcodebuild will be crash.

Crash log:

Thread 2 Crashed::  Dispatch queue: com.apple.root.default-qos.cooperative
0   libxpc.dylib                  	       0x197c4826c _availability_version_check + 8
1   libswiftCore.dylib            	       0x1a9b44428 __isPlatformVersionAtLeast + 92
2   libswiftCore.dylib            	       0x1a9a6e054 _swift_allocObject_ + 1100
3   SWBMacro                      	       0x104a9c408 specialized _ArrayBuffer._consumeAndCreateNew(bufferIsUnique:minimumCapacity:growForAppend:) + 116
4   SWBMacro                      	       0x104a97b58 specialized Array.append<A>(contentsOf:) + 116
5   SWBMacro                      	       0x104a954e8 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 160
6   SWBMacro                      	       0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
7   SWBMacro                      	       0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
8   SWBMacro                      	       0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
9   SWBMacro                      	       0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
10  SWBMacro                      	       0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352

But if you try to build Package.swift via swift build command, it works.

Here you can open sample project:

  1. Just Package.swift with SPM 900 targets
    • Open Package.swift via Xcode 26 any beta and try to build
  2. Xcode workspace with SPM 900 targets
    • Open MyApp.xcworkspace and try to build
  3. You can also make by self the Package.swift (also make required directories for SPM):
// swift-tools-version: 5.9
import PackageDescription

// let count = 800 // no crash
let count = 900 // crash

let targetsNames = (1...count).map { "Pkg1Target\($0)" }
let targets = targetsNames.map { Target.target(name: $0) }
let package = Package(
    name: "Pkg1TargetLibrary",
    platforms: [.iOS(.v16)],
    products: [
        .library(name: "Pkg1TargetLibrary", targets: targets.map(\.name)),
    ],
    targets: targets
)

Just Package.swift with SPM 900 targets

Wow, that's quite the package! Please file this as a bug report with your crash report and reproducer project attached, and post the FB number here for reference.

— Ed Ford,  DTS Engineer

@DTS Engineer Here my crash report with sample project: FB19551898

FWIW, I'm getting this on Xcode 16.4 with no Swift Package Manager. The error alert will popup in groups of 5 or 6. All the buttons just close the alert and lead to another one.

@usaagrumblemo, since you have a different scenario that you think is related, can you share some crash logs with us in a bug report? Please post the FB number here for reference.

— Ed Ford,  DTS Engineer

Xcode 26 beta 5 xcodebuild crash
 
 
Q