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

Rename packages to match names inferred from git URLs #680

Closed
1 of 2 tasks
jbelkins opened this issue Nov 4, 2022 · 0 comments · Fixed by smithy-lang/smithy-swift#464, awslabs/aws-crt-swift#93 or #678
Closed
1 of 2 tasks
Labels
feature-request A feature should be added or improved.

Comments

@jbelkins
Copy link
Contributor

jbelkins commented Nov 4, 2022

Description

Since the introduction of SPM, a package manifest has included a field for providing a "declared" name (i.e. set in the name property of the Package structure) that is used in other manifests to identify a package as a dependency.

In SE-0226, Swift package naming was altered to derive the name from the Git URL for the package. While the preferred way to identify a dependency is by the inferred name, Package retained the declared name field to provide backward compatibility with dependencies declared before this improvement. (Note that referring to a package by its declared name is now deprecated, but use of deprecated APIs in a package manifest does not throw warnings.)

The rationale for this change is that it allows the package manager to resolve what dependencies it needs for a specific target without resorting to downloading every dependency referenced in a manifest to see what name is declared in each dependency's own manifest.

Most other Swift packages have moved to (or been created with) a declared package name that matches the inferred name. While latest Swift tools allow a manifest to identify a package by either name, consistent naming brings the following advantages:

  • Consumers who move to the inferred name will get the advantage of faster dependency resolution as promised by SE-0226.
  • Certain common tools, such as swift package edit with the --path extension (which is used by Swift-VSCode's GUI package management tools), break when the declared name and the inferred name do not match.

This will cause a breaking change but the update to requiring package manifests will be trivial; package manifests need only require this package by the new/inferred name. I do not expect our Git URL to change, so this name will be permanent unless SPM changes naming conventions again.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
1 participant