swiftlang / swift-package-manager

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

[SR-11513] Package Manager Reports Bogus “Cyclic Dependency” #4661

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-11513
Radar rdar://problem/55665943
Original Reporter SDGGiesbrecht (JIRA User)
Type Bug
Environment The same thing occurs on both macOS 10.14 (Mojave) and Ubuntu 18 (Bionic). The bug is completely new to Swift 5.1. Earlier versions of Swift handled this situation just fine.
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 091f476a2b16b059d29fb51e98572f8a

Issue Description:

If the directory name of the package under development collides with the final path component of a dependency, the package manager refuses to do anything, falsely reporting a cyclic dependency.

This three‐line script triggers it using the package manager’s own demonstration packages:

git clone https://github.com/apple/example-package-deckofplayingcards example-package-fisheryates
cd example-package-fisheryates
swift build

And this is the resulting complaint:

error: the package example-package-fisheryates[[...]/example-package-fisheryates] depends on itself
error: cyclic dependency declaration found: DeckOfPlayingCards -> DeckOfPlayingCards

The first half of the error does not always appear.

With --enable-pubgrub-resolver the only output is “Illegal instruction: 4” instead.

aciidgh commented 5 years ago

This is used for the overriding behavior for path-based dependencies. Perhaps we can do something better here but PubGrub shouldn't crash at the very least.

aciidgh commented 5 years ago

@swift-ci create