swiftlang / swift-package-manager

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

[SR-11784] Support cyclic package dependencies #4649

Open tkrajacic opened 4 years ago

tkrajacic commented 4 years ago
Previous ID SR-11784
Radar rdar://problem/57246619
Original Reporter @tkrajacic
Type New Feature
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | New Feature | |Assignee | None | |Priority | Medium | md5: 3fef5c515fd571c7aef81009a651501e

Issue Description:

It is convenient to separate out default values of a model into a separate package, so they can be used in multiple stacks for testing (E.g. CoreData tests, Fluent tests on the server etc…)

So given a `Model` package, I would like to use a `TestSupport` package that defines default values for various mocks. For that, the `TestSupport` package needs to import `Model` to extend its types.

Now the `Model` package's tests want to import the `TestSupport` package to make use of the mocks in there, but this crashes Xcode and SPM (but correctly reports as cyclic dependency when using the pubgrub resolver)

If SPM supported cyclic dependencies, this would allow for very clean separation of packages .

beccadax commented 4 years ago

@swift-ci create