Skip to content

Name conflict when adding the Optimizely SDK via SPM #474

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
dbarden opened this issue Jan 26, 2023 · 1 comment
Closed

Name conflict when adding the Optimizely SDK via SPM #474

dbarden opened this issue Jan 26, 2023 · 1 comment

Comments

@dbarden
Copy link

dbarden commented Jan 26, 2023

Description

At our project, we are having an issue when adding the Optimizely SDK via Swift Package Manager. There is a naming conflict when adding the SDK and it reports the Package is already used in the project.

This happens because Swift Package Manager uses the last component of the URL path as the identifier. So in case there is another package named swift-sdk (like this one), the Package.resolved file will be

    {
      "identity" : "swift-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/Iterable/swift-sdk.git",
      "state" : {
        "revision" : "8d984cf6c2ea7edb1c97a3585fa632af6be43de0",
        "version" : "6.4.7"
      }
    },
    {
      "identity" : "swift-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/optimizely/swift-sdk.git",
      "state" : {
        "revision" : "193cc00e1004d29f16f7b32e5b6787199760c482",
        "version" : "3.10.1"
      }
    },

Which will generate the conflict.

Workaround

To be able to integrate the Optimizely SDK on our project, we had to create a fork and change the name of the repository. This experience is less than ideal since it requires use to periodically update the fork to fetch updates and new releases instead of just fetching from the official source.

Expected behaviour

It should be possible to use the Optimizely SDK along with other Packages, and therefore the name of the repository should be changed. I know it looks like a lot, but GitHub supports repository redirects and when a repository is renamed, the old location keeps working as before. From the documentation:

In addition to redirecting web traffic, all git clone, git fetch, or git push operations targeting the previous location will continue to function as if made on the new location.

This way, we can support the integration of Optimizely SDK directly from the official repository.

@dbarden
Copy link
Author

dbarden commented Jan 26, 2023

Duh, #450

@dbarden dbarden closed this as completed Jan 26, 2023
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

1 participant