Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13994

Dependency fails when already exists under different URL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Package Manager
    • Labels:
      None
    • Environment:

      Xcode 12.2 (12B45b)

      Description

      Hey! So I ran into a bit of a bizarre bug with Swift Package Manager yesterday when adding a dependency to my project. I've reproduced it in a fresh project and attached it to this project.

      Take a project with this structure:

      MyCodebase pulls in a remote (can be a local dependency, doesn't matter) dependency (DependencyOne) which itself has a dependency on another (DependenceTwo).

      This works. No problems at this point.

      Now if MyCodebase adds a new dependency onto DependencyTwo using the same URL. This works, still no problem.

      However... if, when I add DependencyTwo to MyCodebase, I use a different URL for same package (for example without the .git extension) then the dependency is removed from the side panel (in Xcode) and the package will no longer be detected.

      The only error you get is when you try to include DependencyTwo into a target (via the dependencies array). At that point it will simply say that DependencyTwo doesn't exist, which is of course very confusing when you've specified it above (and that's not raising any problems).

      Hope that all makes sense... bit of a weird one! This was all made worse by the fact I didn't realise the dependency I was trying to add was already a dependency of the project since it was a couple packages down a chain.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Sherlouk James Sherlock
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: