Skip to content

Test target name conflict #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jjorn opened this issue Apr 18, 2019 · 3 comments
Closed

Test target name conflict #26

jjorn opened this issue Apr 18, 2019 · 3 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@jjorn
Copy link

jjorn commented Apr 18, 2019

We have a test target i.e. named "Tests" in our project und define it like this:

targets: [
    .target(...),
    .testTarget(name: "Tests", dependencies: [SomeTestDependency], path: "Tests")
]

Then we import a framework via Accio. This framework contains a test target with the same name as we do:

targets: [
    .target(...),
    .testTarget(name: "Tests", dependencies: [TestDependencyA, TestDependencyB])
]

As a result, Accio does not work anymore:

✨  Generating dependency graph ...
❌  error: multiple targets named 'Tests' in: SomeTestDependency, MyProject
@Jeehut Jeehut added the bug Something isn't working label Apr 18, 2019
@Jeehut
Copy link
Contributor

Jeehut commented Apr 18, 2019

That's actually an issue with SwiftPM and the related discussion can be found here:
https://forums.swift.org/t/multiple-target-issue-with-spm/16696

I asked for further information there ...

@Jeehut
Copy link
Contributor

Jeehut commented Apr 19, 2019

Okay, this issue was clarified now on the thread:

  • Once SE-226 is implemented in SwiftPM, this issue will be resolved.
  • You can track progress of its implementation in SR-8658.

As far as I can see, this issue would even arise if we tried to manually remove any unnecessary targets from the manifest files of checked out projects (I didn't try though, so someone might try that). So I would say, this is something we can't fix without completely reimplementing dependency resolution ourselves, which is a non-goal of this project given SwiftPM already does it and improvements were already accepted by the community. Therefore I think we can close this.

If someone comes across this, please try one of the following workarounds:

  1. Fork the project which has the conflicting target name and remove it from the manifest there.
  2. Rename your conflicting target to prevent conflicts.

If anyone has an idea, how we could resolve this in Accio, feel free to comment and I'll reopen. Another way of speeding this up would to help implement SR-8658.

@Jeehut Jeehut closed this as completed Apr 19, 2019
@Jeehut Jeehut added the wontfix This will not be worked on label Apr 19, 2019
@Jeehut
Copy link
Contributor

Jeehut commented Apr 19, 2019

Ah, I think we could provide a link to this thread when someone comes across this issue like we did for #3. I'm reopnening this until such an output is implemented.

@Jeehut Jeehut reopened this Apr 19, 2019
@Jeehut Jeehut closed this as completed in d609fee Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants