SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
526 stars 40 forks source link

xcodebuild: error: Unable to find a device matching the provided destination specifier: { platform:macos, arch:arm64 } #3128

Closed finestructure closed 2 months ago

finestructure commented 2 months ago

We're trying to start Swift 6 compatibility testing and there seems to be a change in how the -destination flag works in xcodebuild with Xcode 16.0b1.

Here's what's failing:

git clone https://github.com/SwiftPackageIndex/SemanticVersion.git && cd SemanticVersion
git checkout 0.4.0
mkdir .stats
env DEVELOPER_DIR=/Applications/Xcode-16.0.0-Beta.app xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride=$PWD/.dependencies -skipMacroValidation -skipPackagePluginValidation -derivedDataPath $PWD/.derivedData build -scheme SemanticVersion -destination platform=macos,arch=arm64 OTHER_SWIFT_FLAGS="-stats-output-dir .stats" -strict-concurrency=complete
xcodebuild: error: Unable to find a device matching the provided destination specifier:
        { platform:macos, arch:arm64 }

    The requested device could not be found because no available devices matched the request.

    Available destinations for the "SemanticVersion" scheme:
        { platform:macOS, arch:arm64e, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:arm64, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:x86_64, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:arm64e, variant:Mac Catalyst, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:arm64, variant:Mac Catalyst, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:macOS, arch:arm64, variant:DriverKit, id:00006022-001C21123EA8201E, name:My Mac }
        { platform:DriverKit, name:Any DriverKit Host }
        { platform:macOS, name:Any Mac }
        { platform:macOS, variant:Mac Catalyst, name:Any Mac }

This used to work in all previous Xcode versions, for example Xcode 15.4:

git clone https://github.com/SwiftPackageIndex/SemanticVersion.git && cd SemanticVersion
git checkout 0.4.0
mkdir .stats
env DEVELOPER_DIR=/Applications/Xcode-15.4.0.app xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride=$PWD/.dependencies -skipMacroValidation -skipPackagePluginValidation -derivedDataPath $PWD/.derivedData build -scheme SemanticVersion -destination platform=macos,arch=arm64 OTHER_SWIFT_FLAGS="-stats-output-dir .stats" -strict-concurrency=complete
finestructure commented 2 months ago

Variants I've tried:

finestructure commented 2 months ago

Crisis averted, looks like the string is simply case-sensitive now:

finestructure commented 2 months ago

I wonder now if all the other platforms will also fail unless I update their strings šŸ¤”

finestructure commented 2 months ago

The good news is that Xcode <16 accepts macOS and iOS just fine so we should be safe updating them.

finestructure commented 2 months ago

Confirmed, we do need to update all identifiers to work with Xcode 16:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
        { generic:1, platform:ios }