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

Library products with dynamic types cause linking errors for unit tests #29

Open
mlink opened this issue Nov 8, 2024 · 1 comment
Open

Comments

@mlink
Copy link
Contributor

mlink commented Nov 8, 2024

For years there has been an issue where library products with .dynamic types have caused linking problems when building unit test targets in Xcode.

Apple documentation recommends always not defining the library type so that it is always automatic.

A library’s product can be either statically or dynamically linked. It’s recommended that you don’t explicitly declare the type of library, so Swift Package Manager can choose between static or dynamic linking based on the preference of the package’s consumer.

This issue is apparent if using Xcode 15.4 or earlier. It seems that the Xcode 16.0 or 16.1 has fixed these issues. Although when using Xcode 16 there is still an extra step involved of adding a library explicitly to the app target. If a change is made to remove the .dynamic type from a library product than that extra step is unnecessary.

@teeweizhong10
Copy link
Contributor

teeweizhong10 commented Nov 13, 2024

Removing the library product types first with this PR, and to be released as 3.x

Future work once other apple native teams are ready: remove duplicated products which can be tagged as a 4.0 as it will introduce breaking changes.

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

2 participants