Xcodebuild failing issue on macOS CI

Issue

The Swift Test macOS Platform (smoke test) will fail for xcodebuild command.

error: unexpected service error: The Xcode build system has crashed. Build again to continue.

Checking the log message, it seems that we are using Xcode 15.1 Beta 2 on CI.

I can't reproduce it on my local Mac even with the same Beta Xcode version.

I suspect a version bump to any official release version of Xcode(eg. Xcode 15.1/15.2/15.3/15.4) may help solve it. cc @mishal_shah

Besides upgrading the CI toolchain, is there any other suggestion to fix the issue and move forward?

Motivation

Fix a xcframework related issue for swift-package-manager

The upstream maintainer requests me to add a test case for it and do not allow to add a local xcfamework zip file due to sacurity and maintainness concern.

So the only option is build the xcframework from source code on the fly.

However, the xcodeproj file will just crash for xcodebuild command on CI. (Have tried create it from lower Xcode version eg. Xcode 15.0.1/15.1)

1 Like

Update:

Change it to a pure Swift package's xcodebuild still fails on CI for unknown error.

Command line invocation:
    /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild archive -scheme FooKit -archivePath /private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/Miscellaneous_Plugins_SymbolGraphForBinaryDependency.vYoYE9/Miscellaneous_Plugins_SymbolGraphForBinaryDependency/FooKit/.build/FooKit-macosx.xcarchive -derivedDataPath /private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/Miscellaneous_Plugins_SymbolGraphForBinaryDependency.vYoYE9/Miscellaneous_Plugins_SymbolGraphForBinaryDependency/FooKit/.build/xcodebuild/DerivedData -sdk macosx -destination generic/platform=macOS BUILD_LIBRARY_FOR_DISTRIBUTION=YES INSTALL_PATH=Library/Frameworks OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface

User defaults from command line:
    IDEArchivePathOverride = /private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/Miscellaneous_Plugins_SymbolGraphForBinaryDependency.vYoYE9/Miscellaneous_Plugins_SymbolGraphForBinaryDependency/FooKit/.build/FooKit-macosx.xcarchive
    IDEDerivedDataPathOverride = /private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/Miscellaneous_Plugins_SymbolGraphForBinaryDependency.vYoYE9/Miscellaneous_Plugins_SymbolGraphForBinaryDependency/FooKit/.build/xcodebuild/DerivedData
    IDEPackageSupportToolchainOverrideForManifestLoading = com.apple.dt.toolchain.XcodeDefault
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_LIBRARY_FOR_DISTRIBUTION = YES
    INSTALL_PATH = Library/Frameworks
    OTHER_SWIFT_FLAGS = -no-verify-emitted-module-interface
    SDKROOT = macosx14.2
    TOOLCHAINS = default

Resolve Package Graph

<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
<unknown>:0: error: unable to execute command: <unknown>

cc @Max_Desiatov @NeoNacho

@Kyle-Ye we’ve run into this issue as well, +1 on hearing back from the team on this.