swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.67k stars 1.32k forks source link

[SR-15065] SPM package-collection-generate fails on binary targets #4394

Open swift-ci opened 2 years ago

swift-ci commented 2 years ago
Previous ID SR-15065
Radar rdar://problem/82263304
Original Reporter coolme2 (JIRA User)
Type Bug
Environment macOS 11.4 Xcode 13 beta 5 SwiftPM tools 5.5 (from Xcode distribution) package-collection-generate compiled from HEAD
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 2 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 38f5f53590e0c8ec5a77ec68cc1be7e9

Issue Description:

package-collection-generate throws the following error:

$ xcrun package-collection-generate -v ~/bin/swift-cots-packages.json cots-collection.json

error: InternalError(description: "Internal error. Please file a bug at https://bugs.swift.org with this info. unknown binary artifact for \'TMXProfiling\'")

By using verbose logging, narrowed it down to the following emitting the same error, which is called during generation:

$ swift package describe   
error: InternalError(description: "Internal error. Please file a bug at https://bugs.swift.org with this info. unknown binary artifact for \'TMXProfiling\'")

Running the same command using Swift 5.3/Xcode 12.3, the command succeeds with the following:

$ swift package describe
Name: TrustDefender
Path: /Users/coolme2/workspace/src/td/com.threatmetrix.trustdefendermobile
Modules:
    Name: TMXProfilingConnections
    C99name: TMXProfilingConnections
    Type: binary
    Module type: BinaryTarget
    Path: /Users/coolme2/workspace/src/td/com.threatmetrix.trustdefendermobile/build/TMXProfilingConnections.xcframework
    Sources: 

    Name: TMXProfiling
    C99name: TMXProfiling
    Type: binary
    Module type: BinaryTarget
    Path: /Users/coolme2/workspace/src/td/com.threatmetrix.trustdefendermobile/build/TMXProfiling.xcframework
    Sources: 

Also verified that the target name in Package.swift for the binary target (TMXProfiling) matches that of the modulemap per the xcframework documentation.

typesanitizer commented 2 years ago

@swift-ci create

swift-ci commented 2 years ago

Comment by Ben Chatelain (JIRA)

A fix for the above issue with the describe command has been merged:

https://github.com/apple/swift-package-manager/pull/3810

Hopefully, that will be included in the next Xcode swift toolchain.