Navigation Menu

Skip to content
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-9191] swift package dump-package format unstable #4748

Open
weissi opened this issue Nov 5, 2018 · 7 comments
Open

[SR-9191] swift package dump-package format unstable #4748

weissi opened this issue Nov 5, 2018 · 7 comments
Labels

Comments

@weissi
Copy link
Member

weissi commented Nov 5, 2018

Previous ID SR-9191
Radar rdar://46998530
Original Reporter @weissi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 1fdaaa6d715fefa89964685c799d38cb

Issue Description:

description

swift package dump-package looks like an API to me but its format seems to change which makes this command not very useful... It's not even documented as unstable.

NIO's list_topsorted_dependenies.sh script for example relies on the dependencies having a name property but that seems to be now gone.

expected

the output of

diff -u <(swift package dump-package | jq .) <(/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/bin/swift package dump-package | jq .)

only adds new properties

actual

the format seems to be totally unstable:
$ diff -u <(swift package dump-package | jq .) <(/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/bin/swift package dump-package | jq .)

--- /dev/fd/63  2018-11-05 21:40:30.000000000 +0000
+++ /dev/fd/62  2018-11-05 21:40:30.000000000 +0000
@@ -4,548 +4,555 @@
   "dependencies": [
     {
       "requirement": {
-        "lowerBound": "1.0.0",
-        "type": "range",
-        "upperBound": "2.0.0"
+        "range": [
+          {
+            "lowerBound": "1.0.0",
+            "upperBound": "2.0.0"
+          }
+        ]
       },
       "url": "https://github.com/apple/swift-nio-zlib-support.git"
     }
   ],
+  "manifestVersion": "4",
   "name": "swift-nio",
+  "pkgConfig": null,
   "products": [
     {
       "name": "NIOEchoServer",
-      "product_type": "executable",
       "targets": [
         "NIOEchoServer"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOEchoClient",
-      "product_type": "executable",
       "targets": [
         "NIOEchoClient"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOChatServer",
-      "product_type": "executable",
       "targets": [
         "NIOChatServer"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOChatClient",
-      "product_type": "executable",
       "targets": [
         "NIOChatClient"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOHTTP1Server",
-      "product_type": "executable",
       "targets": [
         "NIOHTTP1Server"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOWebSocketServer",
-      "product_type": "executable",
       "targets": [
         "NIOWebSocketServer"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOPerformanceTester",
-      "product_type": "executable",
       "targets": [
         "NIOPerformanceTester"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIOMulticastChat",
-      "product_type": "executable",
       "targets": [
         "NIOMulticastChat"
-      ]
+      ],
+      "type": {
+        "executable": null
+      }
     },
     {
       "name": "NIO",
-      "product_type": "library",
       "targets": [
         "NIO"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     },
     {
       "name": "NIOTLS",
-      "product_type": "library",
       "targets": [
         "NIOTLS"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     },
     {
       "name": "NIOHTTP1",
-      "product_type": "library",
       "targets": [
         "NIOHTTP1"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     },
     {
       "name": "NIOConcurrencyHelpers",
-      "product_type": "library",
       "targets": [
         "NIOConcurrencyHelpers"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     },
     {
       "name": "NIOFoundationCompat",
-      "product_type": "library",
       "targets": [
         "NIOFoundationCompat"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     },
     {
       "name": "NIOWebSocket",
-      "product_type": "library",
       "targets": [
         "NIOWebSocket"
       ],
-      "type": null
+      "type": {
+        "library": [
+          "automatic"
+        ]
+      }
     }
   ],
+  "providers": null,
+  "swiftLanguageVersions": null,
   "targets": [
     {
       "dependencies": [
         {
-          "name": "CNIOLinux",
-          "type": "byname"
+          "byName": [
+            "CNIOLinux"
+          ]
         },
         {
-          "name": "CNIODarwin",
-          "type": "byname"
+          "byName": [
+            "CNIODarwin"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         },
         {
-          "name": "CNIOAtomics",
-          "type": "byname"
+          "byName": [
+            "CNIOAtomics"
+          ]
         },
         {
-          "name": "NIOPriorityQueue",
-          "type": "byname"
+          "byName": [
+            "NIOPriorityQueue"
+          ]
         },
         {
-          "name": "CNIOSHA1",
-          "type": "byname"
+          "byName": [
+            "CNIOSHA1"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIO",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOFoundationCompat",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIOAtomics",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIOSHA1",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIOLinux",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIODarwin",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "CNIOAtomics",
-          "type": "byname"
+          "byName": [
+            "CNIOAtomics"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOConcurrencyHelpers",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "NIOPriorityQueue",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         },
         {
-          "name": "CNIOHTTPParser",
-          "type": "byname"
+          "byName": [
+            "CNIOHTTPParser"
+          ]
         },
         {
-          "name": "CNIOZlib",
-          "type": "byname"
+          "byName": [
+            "CNIOZlib"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOHTTP1",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOEchoServer",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOEchoClient",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOHTTP1",
-          "type": "byname"
+          "byName": [
+            "NIOHTTP1"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOHTTP1Server",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIOHTTPParser",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [],
       "exclude": [],
       "name": "CNIOZlib",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOTLS",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOChatServer",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOChatClient",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOHTTP1",
-          "type": "byname"
+          "byName": [
+            "NIOHTTP1"
+          ]
         },
         {
-          "name": "CNIOSHA1",
-          "type": "byname"
+          "byName": [
+            "CNIOSHA1"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOWebSocket",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOHTTP1",
-          "type": "byname"
+          "byName": [
+            "NIOHTTP1"
+          ]
         },
         {
-          "name": "NIOWebSocket",
-          "type": "byname"
+          "byName": [
+            "NIOWebSocket"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOWebSocketServer",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOHTTP1",
-          "type": "byname"
+          "byName": [
+            "NIOHTTP1"
+          ]
         },
         {
-          "name": "NIOFoundationCompat",
-          "type": "byname"
+          "byName": [
+            "NIOFoundationCompat"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOPerformanceTester",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOMulticastChat",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "regular"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOFoundationCompat",
-          "type": "byname"
+          "byName": [
+            "NIOFoundationCompat"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOTests",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "test"
     },
     {
       "dependencies": [
         {
-          "name": "NIOConcurrencyHelpers",
-          "type": "byname"
+          "byName": [
+            "NIOConcurrencyHelpers"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOConcurrencyHelpersTests",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "test"
     },
     {
       "dependencies": [
         {
-          "name": "NIOHTTP1",
-          "type": "byname"
+          "byName": [
+            "NIOHTTP1"
+          ]
         },
         {
-          "name": "NIOFoundationCompat",
-          "type": "byname"
+          "byName": [
+            "NIOFoundationCompat"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOHTTP1Tests",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "test"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOTLS",
-          "type": "byname"
+          "byName": [
+            "NIOTLS"
+          ]
         },
         {
-          "name": "NIOFoundationCompat",
-          "type": "byname"
+          "byName": [
+            "NIOFoundationCompat"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOTLSTests",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "test"
     },
     {
       "dependencies": [
         {
-          "name": "NIO",
-          "type": "byname"
+          "byName": [
+            "NIO"
+          ]
         },
         {
-          "name": "NIOWebSocket",
-          "type": "byname"
+          "byName": [
+            "NIOWebSocket"
+          ]
         }
       ],
       "exclude": [],
       "name": "NIOWebSocketTests",
-      "path": null,
-      "publicHeadersPath": null,
-      "sources": null,
       "type": "test"
     }
   ]
@weissi
Copy link
Member Author

weissi commented Nov 5, 2018

@swift-ci create

@belkadan
Copy link

belkadan commented Nov 6, 2018

I don't think "dump" is ever something stable in the Swift ecosystem, but it should probably be documented one way or another.

@weissi
Copy link
Member Author

weissi commented Nov 6, 2018

@belkadan what's its point if it's not stable? And yes, it really ought to be documented.

@belkadan
Copy link

belkadan commented Nov 6, 2018

Debugging. It lets a SwiftPM dev see whether a package got set up correctly. But I could be wrong about this particular case, or there might be a terminology difference between SwiftPM and the compiler.

@ankitspd
Copy link
Member

ankitspd commented Nov 6, 2018

This command was added during early stages of SwiftPM development without any promises of stability. Also, the way json was extracted was super hacky and presented difficultly in maintaining a stable format. However, after the refactor done this year, we're in a much better position to provide a stable format. But we need to put proper testing in place and add a version number before we declare it is stable. I agree that we should mark it as unstable in the documentation until we get stability.

@weissi
Copy link
Member Author

weissi commented Nov 8, 2018

@belkadan if it were for debugging only it should be a hidden command I'd say. When I wrote the cross-compilation support we said that it's maybe not officially supported so swift build --help won't tell you that there's a swift build --destination run-destination.json flag because we didn't want to guarantee anything quite yet. I think the same should apply to all other commands/options.

But I'm glad @aciidb0mb3r alludes to maybe having a stable format soon.

@weissi
Copy link
Member Author

weissi commented Nov 20, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants