You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 thePackage
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:
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
The text was updated successfully, but these errors were encountered: