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

Carthage builds no longer include SQLite since Cartfile was removed. #2210

Closed
jostster opened this issue Mar 22, 2022 · 14 comments
Closed

Carthage builds no longer include SQLite since Cartfile was removed. #2210

jostster opened this issue Mar 22, 2022 · 14 comments

Comments

@jostster
Copy link

Bug report

Please replace this line with a short description of the problem. Make sure you've read CHANGELOG.md in the root of the repo to make sure a new version hasn't already addressed your problem!

Versions

Please fill in the versions you're currently using:

  • apollo-ios SDK version: 0.51.2
  • Xcode version: 13.2.1
  • Swift version: 5.5.2
  • Package manager: Carthage

Steps to reproduce

We are using Carthage with Rome so that we can save compile time by using binaries. It seems that now that the Cartfile is removed that the SQLite.framework is no longer built.

Further details

Please replace this line with any further details or context necessary to understand the problem. Delete this section if you don't have anything further to add. We are currently using Carthage 0.38.0 and use the --use-xcframeworks flag.

@calvincestari
Copy link
Member

Hi @jostster - I'm not sure what cartfile you're referring to, I went back and looked at the tags for 0.37.0 and 0.38.0 and neither of them have a cartfile in the root (similar to where the podspec or Swift.package files would be).

What is the path of the cartfile you're referring to?

@jostster
Copy link
Author

Sorry @calvincestari the carthage version is 0.38.0. I'm referring to this commit f557af6 . We are migrating from cocoapods to carthage so that we can use cache binaries and save build time. But when using carthage update --use-xcframeworks --platform ios it does not include SQLite.framework. Seems to be the cause of #1205

@calvincestari
Copy link
Member

Can you resolve the problem by adding the SQLite.swift dependency to your cartfile? The PR (#1311) that removed the cartfile has additional context on why the change was made.

github "stephencelis/SQLite.swift" ~> <version>

@jostster
Copy link
Author

It does not :( I saw it listed in #1205 as well but still get the error. I really don't want to have to use SPM as I don't see a point in building Apollo every PR since it doesn't change. Would be easier to just compile it once and download the frameworks each build.

@calvincestari
Copy link
Member

I really don't want to have to use SPM as I don't see a point in building Apollo every PR since it doesn't change.

You shouldn't have to compile each PR using SPM, it targets tagged releases unless you're linking to a specific branch.

@jostster
Copy link
Author

Right, but it still points to the tagged source, and since there isn't binary caching on CI for SPM it would need to recompile it, no?

@calvincestari
Copy link
Member

You still need to build the framework using Carthage right now don't you? We don't upload archives of the prebuilt framework with our GitHub releases, and my understanding of Carthage is that's where it fetches the binaries from.

The OpenSSL library is an example of one that includes the xcframework archive with each release. If you look at the releases for apollo-ios there has never been a framework archive included in the assets of each release. It doesn't look like the SQLite.swift library includes them either, from their releases.

@calvincestari
Copy link
Member

Oh, it's Rome that provides this functionality! I am not familiar with Rome at all so I completely missed that - I get it now.

@calvincestari
Copy link
Member

calvincestari commented Mar 23, 2022

@jostster I went back and read through those two PRs again and from what I understand the missing dependency is resolved by adding an explicit dependency to your own project cartfile; so that fixes one problem.

Next is the missing cached artifact provided by Rome. In this context I think the issue outlined in #1311 (multiple versions) is a more onerous and difficult problem to track down if you're not aware of it vs. having to rebuild the project. With that in mind I don't think bringing back the private cartfile is a good idea.

@jostster
Copy link
Author

What about providing the .xcframework binaries in the release tags? This could benefit those not wanting to build from source and just wanting to add the frameworks directly to their project as well as carthage just downloading the binaries.

@calvincestari
Copy link
Member

I think that would only help downloading the apollo-ios frameworks as binaries, not it's dependency of SQLite.swift. Does Rome not cache SQLite.swift for you if you add it as a manual dependency to your cartfile?

@jostster
Copy link
Author

So rome does cache it. The issue is when having SQLite and apollo-ios separately it causes a module not found SQLiteObjc error, even though SQLite.xcframework is added to the library

@calvincestari
Copy link
Member

@jostster - I tried a quick test project and was able to replicate a "module not found" build error but that was resolved once I added it to the linked libraries for the target. I cannot replicate the SQLiteObjC error though.

Did you find a resolution yet?

@jostster
Copy link
Author

jostster commented Apr 5, 2022

I was not able to find a solution for carthage. Right now still having to add it via SPM

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