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

Need tagged releases in order to use IGListKit SPM package as a dependency of another package #1574

Open
3 tasks done
ChrisLawther-KitmanLabs opened this issue Mar 30, 2023 · 1 comment

Comments

@ChrisLawther-KitmanLabs
Copy link

ChrisLawther-KitmanLabs commented Mar 30, 2023

New issue checklist

  • I have reviewed the README and documentation
  • I have searched existing issues and this is not a duplicate
  • I have attempted to reproduce the issue and include an example project.

General information

  • IGListKit version: head of main branch, currently 501cccc
  • iOS version(s): 15+
  • CocoaPods/Carthage version: n/a
  • Xcode version: 14.2
  • Devices/Simulators affected: All
  • Reproducible in the demo project? (Yes/No):
  • Related issues:

Debug information

# Please include debug logs using the following lldb command:
po [IGListDebugger dump]

We have an app which uses an in-house library, in SPM form. That library has a dependency on IGListKit. Until recently the app wasn't pinning the library to a specific version, and nor was Package.swift in the library pinning IGListKit:

.package(url: "https://github.com/Instagram/IGListKit", branch: "main"),

That's not ideal though - we want to be more deliberate about dependency versions. Pinning the in-house library to a specific version results in an Xcode error of the form:

Failed to resolve dependencies
Dependencies could not be resolved because root depends on '{ourLibrary}' 0.0.2..<0.1.0.
'{ourLibrary}' >= 0.0.2 cannot be used because ...
no versions of '{ourLibrary}' match the requirement 0.0.3..<0.1.0
and package '{ourLibrary}' is required using a stable-version
but '{ourLibrary}' depends on an unstable-version package 'iglistkit'.

Which is Xcode's way of telling us that branch: "main" isn't acceptable to it. Pinning to a specific commit doesn't solve the problem. From the Swift Package docs:

Note that packages which use branch-based dependency requirements can’t be added as dependencies to packages that use version-based dependency requirements; you should remove branch-based dependency requirements before publishing a version of your package.

and

Note that packages which use commit-based dependency requirements can’t be added as dependencies to packages that use version-based dependency requirements; you should remove commit-based dependency requirements before publishing a version of your package.

By forking IGListKit and adding a tag of my own to that, I can confirm that that is all that is needed to resolve this. It's 3+ years since this project made a tagged release, but as SPM adoption ramps up the lack of tagged releases is likely to be problematic for anybody following this pattern.

@ChrisLawther-KitmanLabs ChrisLawther-KitmanLabs changed the title Need tagged releases in order use IGListKit SPM package as a dependency of another package Need tagged releases in order to use IGListKit SPM package as a dependency of another package Mar 30, 2023
@TimOliver
Copy link
Member

Hey @ChrisLawther-KitmanLabs! Thanks for letting us know! I'm trying to get v5.0 tagged and shipped ASAP, so hopefully this will also resolve this issue at the same time.

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

No branches or pull requests

2 participants