New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-14972] SwiftPM describe does not include target dependencies #4399
Comments
Comment by Kiel (JIRA) Further, notice the dump package command does not list the sources for the target but the describe command does. This is frustrating to work with when you need to provide a tool a description of a target and its dependencies. |
@swift-ci create |
`dump-package` shows the manifest contents vs. `describe` looks at the entire package, so `dump-package` can't actually show information about on-disk source files. It also seems right that `target_dependencies` is empty, the target in question doesn't have any target dependencies, as far as I can see. What should be there, though, is an entry in `product_dependencies` for the dependency on the "Collections" product from the "swift-collections" package. That seems like a bug to me. I think it also could make sense to convey via the help text what the difference between the two commands is. |
I can reproduce the issue in 5.4, but it seems fixed already in 5.5: {
"dependencies" : [
{
"identity" : "swift-collections",
"name" : "swift-collections",
"requirement" : {
"range" : [
{
"lower_bound" : "0.0.1",
"upper_bound" : "1.0.0"
}
]
},
"url" : "https://github.com/apple/swift-collections"
}
],
"name" : "bugpackage",
"path" : "/Users/neonacho/Downloads/bugpackage",
"platforms" : [
],
"products" : [
{
"name" : "bugpackage",
"targets" : [
"bugpackage"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "bugpackageTests",
"module_type" : "SwiftTarget",
"name" : "bugpackageTests",
"path" : "Tests/bugpackageTests",
"sources" : [
"bugpackageTests.swift"
],
"target_dependencies" : [
"bugpackage"
],
"type" : "test"
},
{
"c99name" : "bugpackage",
"module_type" : "SwiftTarget",
"name" : "bugpackage",
"path" : "Sources/bugpackage",
"product_dependencies" : [
"Collections"
],
"product_memberships" : [
"bugpackage"
],
"sources" : [
"bugpackage.swift"
],
"type" : "library"
}
],
"tools_version" : "5.3"
} |
Resolving as it seems like this is fixed already in 5.5 |
Attachment: Download
Environment
Xcode 12.5.1
Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
Target: x86_64-apple-darwin20.6.0
Additional Detail from JIRA
md5: 461cdc7ea06b5a3a2a2f5bc9a2fb56fc
Issue Description:
`swift package describe --type json` generates an empty array for `target_dependencies` fields. But `swift package dump-package` produces the correct JSON output. This is inconsistent. As a developer, I do not know which command I should rely on.
Details
Using the attached sample package, with a dependency on `swift-collections`, I get this JSON output with the `swift package describe --type json` command:
When I use `swift package dump-package`, I see the dependency listed:
The text was updated successfully, but these errors were encountered: