apple / swift-certificates

An implementation of X.509 for Swift
https://swiftpackageindex.com/apple/swift-certificates/main/documentation/x509
Apache License 2.0
220 stars 53 forks source link

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 11 months ago

spheroid commented 11 months ago

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:

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

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.

thomzon commented 3 months ago

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:

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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