pointfreeco / swift-issue-reporting

Report issues in your application and library code as Xcode runtime warnings, breakpoints, assertions, and do so in a testable manner.
https://www.pointfree.co
MIT License
391 stars 64 forks source link

multiple similar targets error has occured #92

Closed shimastripe closed 3 months ago

shimastripe commented 3 months ago

Problems

My Package.resolved is below

{
  "pins": [
    {
      "identity": "swift-issue-reporting",
      "kind": "remoteSourceControl",
      "location": "https://github.com/pointfreeco/swift-issue-reporting",
      "state": {
        "revision": "926f43898706eaa127db79ac42138e1ad7e85a3f",
        "version": "1.2.0"
      }
    },
    {
      "identity": "xctest-dynamic-overlay",
      "kind": "remoteSourceControl",
      "location": "https://github.com/pointfreeco/xctest-dynamic-overlay",
      "state": {
        "revision": "926f43898706eaa127db79ac42138e1ad7e85a3f",
        "version": "1.2.0"
      }
    }
  ]
}
stephencelis commented 3 months ago

@shimastripe Both Perception and Dependencies have had releases that point at Issue Reporting, so you should just need to update your package dependencies to avoid this error. Because I believe this issue is the same as #91 I'm going to close, but please follow up there if you still have issues.

shimastripe commented 3 months ago

@stephencelis Thanks for the follow up. I overlooked that there was a new version of each.

pewkachu commented 3 months ago

this is a breaking change, it should be 2.0.0, it just broke our builds

dsmailes commented 3 months ago

I'm seeing this error on any version of swiftui-navigation other than 1.5.2.

mbrandonw commented 3 months ago

this is a breaking change, it should be 2.0.0, it just broke our builds

Hi @pewkachu, very sorry for the troubles. We did not realize this would be such a breaking change. There's not much we can do now about it now, but it should be a simple matter of updating your dependencies to the newest patch version.

I'm seeing this error on any version of swiftui-navigation other than 1.5.2.

Hi @dsmailes, the error doesn't have to do with swiftui-navigation, it has to do with its dependencies, in particular this one. You can either upgrade all of your dependencies to the newest version to fix, or you can add an explicit dependency on xctest-dynamic-overlay pinned to the previous version:

.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", exact: "1.1.2"),
dsmailes commented 3 months ago

@mbrandonw much appreciated, thanks!

pewkachu commented 3 months ago

@mbrandonw we just can't keep up with your speed, and we are still on the old version of TCA %)

mbrandonw commented 3 months ago

Hi @pewkachu, it should still be possible to explicitly pin dependencies to fix the problem. Can you share what versions of our dependencies you are using?

dsmailes commented 3 months ago

@mbrandonw sorry, unless I've completely misunderstood. I've added an explicit dependency on xctest-dynamic-overlay to my project, but I still end up with:

multiple targets named 'XCTestDynamicOverlay' in: 'swift-issue-reporting', 'xctest-dynamic-overlay'

Unless you meant to pin the dependency of swiftui-navigation on xctest-dynamic-overlay to 1.1.2 ? Apologies if I've got this backwards.

mbrandonw commented 3 months ago

Hi @dsmailes, ah sorry, I misspoke. You are going to want to pin both xctest-dynamic-overlay and swiftui-navigation.

.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", exact: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation", exact: "1.5.1"),
dsmailes commented 3 months ago

@mbrandonw thanks for coming back on this. Sadly I can't get 1.5.0 or 1.5.1 to resolve with 1.1.2 of xc-test-dynamic-overlay added. Error is still:

multiple targets named 'XCTestDynamicOverlay' in: 'swift-issue-reporting'

mbrandonw commented 3 months ago

Hi @dsmailes, thanks for your patience with this. I just tested locally and got this to work:

.package(url: "https://github.com/pointfreeco/swift-case-paths", exact: "1.5.2"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", exact: "1.3.0"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation", exact: "1.5.0"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", exact: "1.1.2"),

We unfortunately have to pin all of the dependencies using xctest-dynamic-overlay. We are still in the process of investigating other mitigation strategies, but hopefully this will serve as a stopgap.

dsmailes commented 3 months ago

@mbrandonw that's looking good, thanks so much for taking the time.

Just for context, because I hadn't made it clear so far (apologies) the reason I need to pin to 1.5.0 is because we have some strict concurrency warnings to deal with if we update to 1.5.2.

yuryks commented 3 months ago

Here is a full list of packages that are using xctest-dynamic-overlay.

.package(url: "https://github.com/pointfreeco/swift-case-paths", exact: Version(1, 5, 2)),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", exact: Version(1, 3, 0)),
.package(url: "https://github.com/pointfreeco/swiftui-navigation", exact: Version(1, 5, 0)),
.package(url: "https://github.com/pointfreeco/swift-dependencies", exact: Version(1, 3, 3)),
.package(url: "https://github.com/pointfreeco/swift-clocks", exact: Version(1, 0, 2)),
.package(url: "https://github.com/pointfreeco/combine-schedulers", exact: Version(1, 0, 0)),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", exact: Version(1, 1, 2)),
mbrandonw commented 3 months ago

We released 1.2.1 yesterday that should fix all of these issues. Just update to that version of this library and there’s no need to pin any other libraries.

yuryks commented 3 months ago

Great to hear. Thanks for quick fix.


UPD: We are still on TCA 1.3.0. Updating xctest-dynamic-overlay to 1.2.1 did not help 🥲.

mbrandonw commented 3 months ago

Hi @yuryks, that is surprising. Can you provide more details?

yuryks commented 3 months ago

In test project on local machine everything works as expected. But fastlane on CI is still failing. 🤔

mbrandonw commented 3 months ago

@yuryks Sounds like you are not committing your Package.resolved file. If you were, then CI should be using the exact same versions as your local environment.

yuryks commented 3 months ago

Package.resolved file committed to repo. I guess here is the issue in Fastlane build_ios_app lane SPM resolving on Bitrise CI

Dir.chdir("../my-package") do
  sh("swift package resolve")
end
build_ios_app(
  skip_package_dependencies_resolution: true,
  disable_package_automatic_updates: false,
  cloned_source_packages_path: "../my-package/.build"
  ...
)

Now builds on Bitrise CI are successful.

UPD Project example tca123-xdo121.zip

@mbrandonw


UPD The issue resolved on Bitrise CI. Now everything works as expected.