swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.67k stars 1.32k forks source link

[SR-4385] Enable SPM to describe which packages are edited #5057

Open swift-ci opened 7 years ago

swift-ci commented 7 years ago
Previous ID SR-4385
Radar None
Original Reporter djones6 (JIRA User)
Type New Feature
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | New Feature, StarterBug | |Assignee | None | |Priority | Medium | md5: cd414a7c57207ae4a22460897a82f609

Issue Description:

As of Swift 3.1, if I put a package into editable mode, the source for that package ends up in Packages/ and so it is easy to see which packages are currently considered 'edited'.

However, this isn't so easy when combined with the --build-path option. For example:

swift package --build-path=build1 fetch
swift package --build-path=build1 edit <package> --revision master
swift package --build-path=build2 fetch

...results in build1 using the source in Packages/<package> but build2 does not.

The existing command show-dependencies gives clues as to which packages are being edited - in the example above, a package would be shown as <package>.git@unspecified in build1 but a tagged version in build 2.

It would be useful to have a way to definitively list which sources are being used to build a given build directory.

This is particularly the case as of SE-0149 because a package could be linked to source elsewhere via --path. For convenience, a symlink is placed in Packages/ but if multiple builds used a different path for the same dependency, the link would only reflect the state of one of those builds.

aciidgh commented 7 years ago

We should do two things here:

  1. show-dependencies should clearly state if a dependency is edited.
  2. Instead of failing on second edit when there is a symlink in Packages/, overwrite it with a warning.
swift-ci commented 6 years ago

Comment by Shintaro Katafuchi (JIRA)

Can I possibly work on the issue?

aciidgh commented 6 years ago

Yep, go ahead!

belkadan commented 4 years ago

Resetting assignee for all Starter Bugs that haven't been modified since 2018.