Skip to content

Fix the suffix of dependency urls in Package.swift #1073

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

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

Kyome22
Copy link
Contributor

@Kyome22 Kyome22 commented Oct 24, 2024

Bug/issue #, if applicable:

Summary

I unified the URLs of external packages defined in Package.swift's dependencies to have suffix .git.
In the Swift Package Manager ecosystem, it is often better to have .git at the end of the repository URL.

Dependencies

n/a

Testing

n/a

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [n/a] Added tests
  • Ran the ./bin/test script and it succeeded
  • [n/a] Updated documentation if necessary

@omochi
Copy link

omochi commented Oct 24, 2024

The reasons why it’s better to include .git are explained in detail here.
apple/swift-algorithms#194

@d-ronnqvist
Copy link
Contributor

These two reasons from the linked PR make this worthwhile in my opinion, even if it sounds like SwiftPM successfully resolves the dependencies regardless.

All this does is add the .git suffix to the package URL for swift-numerics. Why do this?

  • Consistency. A majority of the other Apple-published Swift ecosystem packages (swift-logging, swift-crypto, swift-certificates, swift-asn1, swift-collections, swift-docc, swift-nio, swift-argument-parser, swift-atomics, and so on) use the .git-suffixed form, if not exclusively, then more often than not.
  • It makes a difference. If, for example, the same dependency is specified more than once in a given dependency graph and the use of the suffix is inconsistent, SwiftPM does take notice (although the message is only shown when -v is in use):
info: 'swift-algorithms': dependency on 'swift-numerics' is represented by similar locations
('https://github.com/apple/swift-numerics.git' and 'https://github.com/apple/swift-numerics')
which are treated as the same canonical location 'github.com/apple/swift-numerics'.

@Kyome22 Kyome22 changed the title Fix the prefix of dependency urls in Package.swift Fix the suffix of dependency urls in Package.swift Nov 3, 2024
@d-ronnqvist
Copy link
Contributor

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 30bc32e into swiftlang:main Nov 19, 2024
2 checks passed
QuietMisdreavus pushed a commit to QuietMisdreavus/swift-docc that referenced this pull request Nov 20, 2024
QuietMisdreavus pushed a commit that referenced this pull request Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants