[Amendment] SE-0226: Package Manager Target Based Dependency Resolution

Review for an amendment to SE-0226: Package Manager Target Based Dependency Resolution, begins now and runs through March 22, 2021.

The amendment goal is to address a usability issue introduced in the original design of target based dependencies and was discussed in a recent pitch thread on the topic.


Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to the review manager or direct message in the Swift forums).

What goes into a review of a proposal?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift.

When reviewing a proposal, here are some questions to consider:

  • What is your evaluation of the proposal?
  • Is the problem being addressed significant enough to warrant a change to Swift?
  • Does this proposal fit well with the feel and direction of Swift?
  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

Thank you for helping improve the Swift programming language and ecosystem.

Tom Doron
Review Manager

3 Likes

Starting with the SwiftPM version following 5.4 (exact number TBD), SwiftPM will actively discourage the use of the name attribute on the package dependency declaration (will emit warning when used with tools-version >= TBD) and instead will compute an identity for the declared dependency by using the last path component of the dependency URL (or path in the case of local dependencies) in the dependencies section.

Can a git repository be located at the root path?

.package(url: "https://example.com/", from: "1.0.0"),

If so, the last path component (and computed package identity) would be "/" or "".

While it is far from ideal, SwiftPM has been using the last-path component of the package URL for identity purposes for a long time. Our goal is to address that with SE-0292. Until that point, I think SwiftPM should reject such URLs.

With that context in mind, this amendment does not try to change the existing behavior in that sense -- it only removes the requirement of setting an explicit name attribute which has to match the one the package author picked in their manifest file.

SE-0226 Amendment: Package Manager Target Based Dependency Resolution has been accepted. If you'd like to continue discussing this, please do so in that thread.