Is the order of the pins in Package.resolved significant?

are the pins in Package.resolved sorted in any way? will a dependency’s own dependencies always appear earlier in the list?

Currently SwiftPM happens to write out the pins file in alphabetical order by identity for the sake of determinism. However, semantically speaking the pins are unordered; if you shuffle them manually, SwiftPM will still consider them equal and not overwrite your changes.

hmm. what would be the easiest way to get the pins in a correct partial order?

From outside libSwiftPM? Maybe load swift package show-dependencies --format json, flatten the tree, then reverse?

1 Like

that’s a good idea, thanks!