Skip to content
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

Linking fails in Xcode 15 when swift-certificates is used in a package that is linked to an application test target #144

Open
spheroid opened this issue Sep 28, 2023 · 4 comments

Comments

@spheroid
Copy link

spheroid commented Sep 28, 2023

I know the title is a mouthful, but that's the simplest one I can come up with that properly describes the issue. Technically this is a regression from Xcode 14.3.1 and therefore I've created a feedback FB13209670 for this. But as it only seems to affect swift-certificates, I'm opening an issue here as well. Feel free to close this if you think the feedback alone is sufficient.

The error message is the same as in #78:

clang: error: no such file or directory: '/Users/…/Library/Developer/Xcode/DerivedData/Xcode15LinkerProblem-ewdhpfkuiwqkvjewbspactaqojht/Build/Products/Debug-iphonesimulator/PackageFrameworks/Crypto_17A3B1FFC41E47_PackageProduct.framework/Crypto_17A3B1FFC41E47_PackageProduct'

How to reproduce the issue:

  • Create a Swift package that contains two libraries, one that uses swift-certificates and one the doesn't, but depends on the one that does.
  • Create an application and link the first package to it.
  • Add test target to the application and link the second package to it. Make sure the Host Application API testing is allowed.
  • Run tests

The issue can be resolved in a number of ways, at least by:

  • Disable Host Application API testing.
  • Don't include the package library in the application target.
  • Remove the dependency between package libraries.

For our project all of these options have downsides we're not happy with. We've disabled the tests that cause this for now, but it's not a good long term solution.

I've included a sample project in the aforementioned feedback that reproduces this issue.

@spheroid spheroid changed the title Linking fails in Xcode 15 when swift-certificates is used by a package that is linked to an application test target Linking fails in Xcode 15 when swift-certificates is used in a package that is linked to an application test target Sep 29, 2023
@thomzon
Copy link

thomzon commented May 31, 2024

Hi,

I have an issue that sounds awfully similar, although not related to testing. In my case, compiling in a specific project configuration. To reproduce:

  • Create a Swift package that contains 1 library, that depends on swift-certificates.
  • Create an app, depending on that package, with 2 targets (let's call them A & B)
  • In target B, add dependency to our library. Compiling target B on its own works fine.
  • In target A, add dependency to our library, as well as dependency to target A. Compiling target A now fails with this error "No such file or directory: '/Users/thomas.debouverie/Library/Developer/Xcode/DerivedData/mid-reader-demo-btpgbhzcmeewgfbvpokmsjeuqlta/Build/Products/Debug-iphoneos/PackageFrameworks/Crypto_17A3B1FFC41E47_PackageProduct.framework/Crypto_17A3B1FFC41E47_PackageProduct'"

While different, I don't know why I have a feeling there might be a link between the 2 issues. Sorry if it's not the case.
Could not find a way to resolve this, so I finally had to wrap anything using swift-certificates as a framework instead of an SPM library.

@Lukasa
Copy link
Collaborator

Lukasa commented May 31, 2024

This seems very likely to be a related issue: this looks related to the triangle dependency solving that Xcode does. Can you please file a report using Feedback Assistant?

@thomzon
Copy link

thomzon commented May 31, 2024

Thank you for your feedback. I've created a feedback item on Feedback Assistant.
Maybe important info, but this only happens to me with the swift-certificates package. If I do the same steps with another one, no problem. Guessing it has to do with the swift-certificates package dependencies.

@Lukasa
Copy link
Collaborator

Lukasa commented May 31, 2024

The issue will be with swift-crypto, which is a dependency of this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants