Skip to content

xcodebuild DocC error with Xcode 14 #234

Open
@fraune

Description

@fraune

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

  1. Create a brand new Xcode 14 project targeting iOS with Swift/SwiftUI
  2. Under Project Settings, add swift-log (https://github.com/apple/swift-log.git) as a Package Dependency
  3. Navigate to the project's root folder in Terminal
  4. Execute xcodebuild -quiet
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions