swift-log: xcodebuild DocC error with Xcode 14
Expected behavior
My team and I normally build our app with a CLI command like this:
xcodebuild -quiet -workspace MyApp.xcworkspace -scheme MyApp
Actual behavior
After updating Xcode from 13 to 14, running our xcodebuild
command now fails with the following error:
2022-09-16 11:05:28.019 xcodebuild[47484:558966] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x600000287c00: name:Documentation.docc path:group:Documentation.docc> Failed to load container at path: /Users/username/Library/Developer/Xcode/DerivedData/MyApp-darnasgcpehipbceilnyjlqsmpxt/SourcePackages/checkouts/swift-log/Sources/Logging/Documentation.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Documentation.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Documentation.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
Steps to reproduce
- Create a brand new Xcode 14 project targeting iOS with Swift/SwiftUI
- Under Project Settings, add
swift-log
(https://github.com/apple/swift-log.git) as a Package Dependency - Navigate to the project’s root folder in Terminal
- Execute
xcodebuild -quiet
- This error shows up
If possible, minimal yet complete reproducer code (or URL to code)
I found a related issue on the Swift forums that was posted a few months back: https://forums.swift.org/t/xcode-and-swift-package-manager/44704
I tried modifying the xcodebuild
flags for derivedDataPath
and clonedSourcePackagesDirPath
, but it did not appear to change how this issue was affecting my builds.
SwiftLog version/commit hash
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "6fe203dc33195667ce1759bf0182975e4653ba1c",
"version": "1.4.4"
}
}
Swift & OS version (output of swift --version && uname -a
)
swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
Target: x86_64-apple-macosx12.0
Darwin x2-l-fraune 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 5
- Comments: 24 (8 by maintainers)
We’re looking into this, thanks for reporting
@neonichu @tomerd confirming that
xcodebuild -scheme <name>
works for me. The Docc error messages are not preventing the build to complete.I’m a bit confused. What is this ‘less / not supported path’ or legacy-style builds for building projects with packages? We use xcodebuild in our CI system, and don’t know any other way to build Xcode workspaces (which uses SPM packages). We are passing the sdk to use, which scheme to use, etc… Is there another way to do this?
for example:
/usr/bin/xcodebuild -sdk iphoneos -configuration Release -workspace /Users/agent/azagent-A3/_work/3/s/app.xcworkspace -scheme MyScheme build ENABLE_BITCODE=NO CODE_SIGN_STYLE=Automatic | /usr/local/bin/xcpretty -r junit --no-color
If there are other ways to do this better, I gladly hear it.@tomerd here are steps to reproduce on my project
Building from Xcode GUI works.