Repository navigation
Xcode 27: SPM silently ignores existing unsupported package minimums #402
Description
Summary
Package@swift-5.9.swift declares values below Xcode 27 minimums (like the xcodeproj, #401). In this case, a package build using Xcode 27's command line tools will silently ignore these, and build for the supported minimums anyway. The problem lies in mismatched expectations.
Steps to Reproduce
In a folder, create two files:
Package.swift
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "Consumer",
products: [.library(name: "Consumer", targets: ["Consumer"])],
dependencies: [
.package(url: "https://github.com/weichsel/ZIPFoundation.git", revision: "e7a17d57c583067eaa6659cd6d9521265b7664e9"),
],
targets: [
.target(name: "Consumer", dependencies: ["ZIPFoundation"]),
]
)Sources/Consumer.swift:
import ZIPFoundationFrom terminal:
xcodebuild \
-scheme Consumer \
-destination "generic/platform=iOS" \
clean build 2>&1 |\
sed -nE \
-e 's/.*-module-name (ZIPFoundation) .* -target ([^ ]+).*/\1 is compiled for \2/p' \
-e '/warning:/p' |\
sort -uExpected Results
The manifest's minimums match what Xcode 27 actually builds
Actual Results
The manifest says iOS 12 (.iOS(.v12)), Xcode builds for iOS 15, and nothing warns:
ZIPFoundation is compiled for arm64-apple-ios15.0
Regression & Version
Not a ZIPFoundation regression. Xcode 27 raised its minimum deployment targets.
Seen with Xcode 27.1, Swift 6.4, ZIPFoundation e7a17d5.
The manifest is silent because of how Xcode 27's PackageDescription deprecates old versions. .watchOS(.v4) is deprecated: 5.7, so it warned in a 5.9 manifest (#387, #393). #388 (676ffa3) moved to .v5, which is deprecated: 6.4, so it only warns in manifests at tools-version 6.4 or later. Same for .macOS(.v10_13), .iOS(.v12) and .tvOS(.v12). The warning went away, but the value is still below Xcode 27's minimum. Checked with test manifests:
- tools 5.9 +
.watchOS(.v4):warning: 'v4' is deprecated: watchOS 9.0 is the oldest supported version - tools 5.9 +
.watchOS(.v5): no warning - tools 6.4 +
.watchOS(.v5):warning: 'v5' is deprecated: watchOS 9.0 is the oldest supported version
Proposed Fix
Create a new Package@swift-6.4.swift, with updated values that will be honored. This allows dependent projects using Xcode 15-26 to continue building successfully using Package@swift-5.9.swift.
The package is a copy of @5.9 with Xcode 27's minimums, plus .swiftLanguageMode(.v5), since tools-version 6.x defaults to Swift 6 mode.
Why not a @6.0 (#345, #384)? Xcode 16–26 would pick that up too, so raising its minimums breaks the same older-Xcode consumers.
Catching this next time
I think a CI check would have caught this:
- compare the manifest's platforms against the newest SDK's minimums
Related Link
- 'v4' is deprecated: watchOS 9.0 is the oldest supported version #393 (superseded by this issue)
- Fix deprecation warning in package manifest #388
- Swift 6 Support #345, Fix Xcode 27 deprecation warning #384
- Fix zlib warning on macOS for Apple targets #399
- Xcode 27:
xcodeprojbuilds fail, deployment targets below minimums #401
Activity