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

Support dynamic SPM product #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrii-vysotskyi-cko
Copy link

This PR adds a dynamic product to JOSESwift.

@daniel-moh
Copy link
Member

Hi @andrii-vysotskyi-cko, thanks for your contribution and apologies for the late response.

Could you clarify a bit on the need for declaring this separate library product? According to SPM documentation, leaving the linking type empty lets SPM decide which one to use—effectively supporting both linkage types. I might be missing something here but, to me, this sounds like there is no need to explicitly declare a separate dynamic-only library product:

Leave this parameter so Swift Package Manager can choose between static or dynamic linking (recommended). If you don’t support both linkage types, use Product.Library.LibraryType.static or Product.Library.LibraryType.dynamic for this parameter.

📚 SPM Docs

@daniel-moh daniel-moh added the waiting for response Waiting for the author to provide more information or respond to feedback label May 11, 2024
@andrii-vysotskyi-cko
Copy link
Author

andrii-vysotskyi-cko commented Jun 20, 2024

Hey @daniel-moh, thank you for the response.

The use case we are facing is that there is a binary only dynamic framework that is distributed via SPM. This framework depends on JOSESwift, but SPM still links JOSESwift statically so we are forced to vendor our own dynamic copy of framework.

Having an ability to use "dynamic" version of JOSESwift explicitly should solve the problem.

@daniel-moh daniel-moh removed the waiting for response Waiting for the author to provide more information or respond to feedback label Aug 21, 2024
@daniel-moh
Copy link
Member

Thanks for the clarification @andrii-vysotskyi-cko. I understand that adding an additional explicit dynamic library product represents the workaround you need, but it does introduce some complexity that feels a bit unconventional to me. I am still wondering why SPM doesn't automatically pick the correct product like it seems to suggest in its docs.

To better understand the specific issue you’re encountering, could you provide a minimal reproducible example or a more detailed explanation of the problem? That way we can rule out that this is a bug in SPM or potentially a misconfiguration on your end and make sure that this is in fact something we need to change on the library end. 🙏

@daniel-moh daniel-moh added the waiting for response Waiting for the author to provide more information or respond to feedback label Aug 21, 2024
@haeser haeser force-pushed the feat/support-dynamic-spm-product branch from 2689d99 to 4f060ee Compare August 23, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Waiting for the author to provide more information or respond to feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants