-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(swiftpm): Gracefully handle dependencies specified by branch name
If a `Package.swift` file specifies a dependency with a branch name, such as [1], the result of its analysis based on running [2] yields "unspecified" as version string for that particular dependency. A speciality of this package manger, similar to `GoMod`, is that creating the dependency tree (via [2]) includes resolving the revisions for all dependencies. From investigating various project setups, it seems that the lockfile entries for `remoteSourceControl` dependencies (see property `PinV2.kind`) always have a revision / SHA1. So, for `remoteSourceControl`, which is the only kind currently handled, the lockfile entry contains all information needed while the entries from [2] lack the version / revision. Fix both, the version string issues as well as the `vcsInfo.revision` ones, by creating the result from the lockfile entries and only use the entries from [2] as a fallback. Fixes #8167. [1] `.package(url: "git@github.com:my-org/my-project.git", branch: "my-feature")` [2] `swift package show-dependencies` Signed-off-by: Frank Viernau <frank_viernau@epam.com>
- Loading branch information
Showing
2 changed files
with
75 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.