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 Swift Package Manager #1453

Closed
ShawnBaek opened this issue Sep 21, 2019 · 58 comments · Fixed by #1683 or #1696
Closed

Support Swift Package Manager #1453

ShawnBaek opened this issue Sep 21, 2019 · 58 comments · Fixed by #1683 or #1696
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) state:released Released as stable version type:feature New feature or improvement of existing feature

Comments

@ShawnBaek
Copy link
Contributor

ShawnBaek commented Sep 21, 2019

Parse has two dependencies, Bolts and OCMock.

I think Bolts is not maintainability, so If we want to keep the Parse-Objc or support latest tech stacks like SPM, I think fork the Bolts is a better option.

Here is my suggestion.

  1. Fork Bolts and OCMock into the parse-community.
  2. Make a Package.swift for Bolts and OCMock to support SPM.
  3. Make a Package.swift for Parse-SDK-iOS-OSX.

That's it.

What do you think about this?

Another option is to focus on the Parse-Swift like Parse Dart SDK.

PS. FireBase also has dependencies with OCMock. firebase/firebase-ios-sdk#3136

@drdaz
Copy link
Member

drdaz commented Sep 22, 2019

Would we actually need to do anything to OCMock? It's not part of the distribution as far as I can tell; it's a development dependency.

FYI I don't know anything about SPM yet, but I assume it would be used to install the SDK to projects. Just using the SDK in a project doesn't require OCMock.

@mrmarcsmith
Copy link

This sounds like a great idea. Do you want to open a PR for the iOS part of the process?

@ShawnBaek
Copy link
Contributor Author

ShawnBaek commented Sep 24, 2019

@mrmarcsmith I can’t fork into the parse repository. (I’m not a member of Parse). So could you fork it? I’ll make a PR

@mrmarcsmith
Copy link

sure! It would be great if your PR included some instructions in the README on how to use SPM with Parse since this would be my first experience using SPM so I'm sure lots of other people are curious how to use it too.

@noobs2ninjas
Copy link
Member

Anyone should be able to fork parse. Thats super weird.

So, I'm curious if we could talk to the bolts guys about just turning the repo to us. Like Parse, Bolts was previously maintained by Facebook and at around the same time as Parse they turned over Bolts to community contributors. So, theres probably at least a little report with them. Not to mention Parse is probably the largest application to use Bolts.

@ryang1428
Copy link

+1 to SPM support!

@stale
Copy link

stale bot commented Nov 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

@stale stale bot added the Won't Fix label Nov 29, 2019
@stale stale bot closed this as completed Dec 6, 2019
@Vortec4800
Copy link

SPM is getting more popular recently and with WWDC and Xcode updates coming soon I'm guessing it will only increase.

Just bringing this up to see if we can re-open and figure out what to do with Bolts.

@TomWFox TomWFox reopened this Jun 29, 2020
@stale stale bot removed the Won't Fix label Jun 29, 2020
@TomWFox
Copy link
Contributor

TomWFox commented Jun 29, 2020

@noobs2ninjas has been communicating with FB open source so if someone wants to make a PR to bolts with SPM support we could probably get it merged now.

@paulfreeman
Copy link

Just to clarify, the PR is needed to Bolts-ObjC as the Swift version of Bolts is already SPM compatible.

@vdkdamian
Copy link

Any news on this topic?

@davidhakki
Copy link

Definitely bumping for support especially since now SwiftPM has a gui and has been updated to handle frameworks better. Its far easier and less cumbersome then pods at this point.

@asam139
Copy link

asam139 commented Jan 14, 2021

Please recently SPM is becoming more and more popular 🙏

@TomWFox
Copy link
Contributor

TomWFox commented Jan 18, 2021

We would gladly accept a PR for this, as I understand we still need SPM support from Bolts-obj.

@itayAmza
Copy link

Any progress with this one? tnx

@drdaz
Copy link
Member

drdaz commented May 18, 2021

Right now I'm working on a fork of our dependency Bolts-Objc with SPM support. Once that works, I'll see if I can do the same to the SDK.

I can't give you an estimate on completion, sorry.

@drdaz
Copy link
Member

drdaz commented May 21, 2021

I've got a PR open against Bolts that adds SPM support.

Started looking at this library today.

@drdaz
Copy link
Member

drdaz commented Jun 4, 2021

WIP here

@funkenstrahlen
Copy link

Maybe not an option for everyone but there is a rebuild of the Parse API for iOS in Swift: https://github.com/parse-community/Parse-Swift

@carbonimax
Copy link

Any news ?

@drdaz
Copy link
Member

drdaz commented Sep 9, 2021

There's nothing newer than what's on my branch right now that I'm aware of. But the main Parse SDK imports properly using SPM in that branch IIRC.

I do plan on getting it working, but I need to find time.

I'd welcome any help. PR is here.

@davidhakki
Copy link

Maybe not an option for everyone but there is a rebuild of the Parse API for iOS in Swift: https://github.com/parse-community/Parse-Swift

Problem is, its currently missing a lot of features and because they renamed a bunch of methods new users may struggle to implement it until documentation is updated accordingly.

@mman
Copy link
Contributor

mman commented Jan 25, 2022

@mtrezza Exposing multiple .products from the same swift package is definitely possible and would probably work. The main issue for me is to keep the swift build and swift test always passing. And that was my concern where 3rd party dependency breaks the overall build & test. Let me dig into it a bit more (slowly)...

@drdaz
Copy link
Member

drdaz commented Jan 25, 2022

When adding a package via SPM one can select which subpackages should be installed. Would that allow to add only the main Parse SDK without Facebook Utils and without the FB SDK as 3rd party dependency?

As @mman says, yes it should. I believe the only install route that suffers from everything always being installed is Carthage.

The main issue for me is to keep the swift build and swift test always passing. And that was my concern where 3rd party dependency breaks the overall build & test. Let me dig into it a bit more (slowly)...

It's a legitimate concern, but since we specify which version of the FBSDK we use, the breakage generally won't catch us unawares. Moving between FB dep versions is an explicit, conscious action, and the developer should be able to see if the update breaks anything.

The only place I see this causing issues is when an Apple SDK update breaks whatever version of the FB SDK we're using. And if that happens, it's likely to be because we're hanging on an old version; FB seems to keep up to speed with Apple's newest stuff pretty well. Even then, the move to a newer Apple SDK is a conscious move.

@drdaz
Copy link
Member

drdaz commented Feb 2, 2022

@mman I've been bashing my head against something for a minute now... I've got my fork rebased with mainline, but it seems like no matter what I do, I can't get the tests to see the main source files. You're doing it with cSettings I gather, but when I do similar, they seem to be ignored.

Do you know of any reason why this might be? The only differences I can see are that I use the path and publicHeadersPath attributes.

EDIT: You've also flattened the source structure much more. Starting to think this might be the right way forward tbh.

@mman
Copy link
Contributor

mman commented Feb 2, 2022

@drdaz Do you have any error messages?

The line: https://github.com/mman/Parse-SDK-iOS-OSX/blob/b1f2a5cd1e5df228c34171495af0ccd3455492a2/Package.swift#L25 here shows that tests must depend on Parse, Bolts, and OCMock, and we only use .headersSearchPath to actually lookup internal header files that are not public

@danipralea
Copy link

hello everyone. is there any kind of update on this?
I currently have a Package Resolution Failed error
image

@mman
Copy link
Contributor

mman commented Jun 1, 2022

@danipralea What URL you specified as a dependency? I guess the way to the future is to use Parse Swift SDK implementation and fall back to this legacy repository only when you really need it and know what you are doing.

Feel free to use the spm branch of my fork from https://github.com/mman/Parse-SDK-iOS-OSX.git, that should resolve and work just fine but the question is whether this will ever get merged at all? CC @drdaz ?

@danipralea
Copy link

@mman yeah, I've already made the transition to Parse Swift SDK, but we still need to support this one as well. Big project, slow transition.

@mtrezza
Copy link
Member

mtrezza commented Jun 1, 2022

@mman Did you or do you want to open a PR for spm support?

@danipralea Please keep in mind the risks when using an unofficial fork of any Parse Platform repository that is outside of our GitHub org.

@mman
Copy link
Contributor

mman commented Jun 1, 2022

@mtrezza I did a lot of temporary hacks to make the package compile for tvOS, macOS, and iOS, and it generally works, but I had to reorganize sources a lot (which I do not like), i had to #ifdef some stuff (which I do not like) so I am kind of neutral. It is not ready to be merged as is and requires more work, which I do not think is a time well spent given we want to move towards Swift implementation anyway... Let me think about it some more...

@mtrezza
Copy link
Member

mtrezza commented Jun 1, 2022

Got it. I think as long as this repo is embeddable with in some way, I think we're good. We made carthage work recently, so it's available I'd say.

@mtrezza
Copy link
Member

mtrezza commented Aug 31, 2022

Has there been any progress in adding SPM support? Would anyone be interested to pick this up?

The FB SDK is at 14.1.0 and we are still stuck at 11.0.1, because they have deprecated support for carthage in favor of SPM. Upgrading the SDK could help developers who are not ready to migrate to the Parse Swift SDK. The migration process is also not documented yet, so this gives a bit more time. We could also increase the bounty if necessary.

@mtrezza
Copy link
Member

mtrezza commented Sep 13, 2022

@mman Could you open a PR from your spm branch to this repo, so others can see the diffs and build upon it?

@mman
Copy link
Contributor

mman commented Sep 15, 2022

@mtrezza Sure, I have opened parse-community/Bolts-ObjC#3 and #1659.

@mtrezza
Copy link
Member

mtrezza commented Sep 15, 2022

Thanks, if you find some time, could you resolve the conflicts, so that these show the latest state compared to the target branches?

@mtrezza
Copy link
Member

mtrezza commented Sep 16, 2022

Hi everyone, @ricky641b will give it a shot to add full SPM support.

Luckily he can build on the PRs and investigations already done by you.

Let's support him with whatever questions he may have, to get this over the finish line - thanks especially to @mman, @drdaz!

@mman
Copy link
Contributor

mman commented Sep 16, 2022

@ricky641b, @mtrezza I will be happy to help !!!

@mtrezza
Copy link
Member

mtrezza commented Sep 16, 2022

@ricky641b:

  • cocoapods and carthage support can (or even should) be removed when implementing SPM. We are implementing SPM support the others actually don't work anymore in some scenarios. SPM solves this. Removing carthage & cocoapods should also make it easier for you to implement SPM, because it reduces the code base.

  • The ParseFacebookUtils and ParseTwitterUtils can be removed from the SDK if they are an obstacle for SPM implementation. They are merely convenience wrappers for PFUser.linkWith(). But if they are kept, the SPM implementation must make it optional to install them, since not everyone may need it.

@mtrezza
Copy link
Member

mtrezza commented Jan 4, 2023

Could someone try out #1683 to add the SDK via Swift Package Manager?

cc @drdaz @mman

@ricky641b
Copy link

ricky641b commented Jan 5, 2023 via email

@mtrezza
Copy link
Member

mtrezza commented Jan 5, 2023

@ricky641b The SPM integration should be done with #1683; with try out I meant to try to add the Parse Apple SDK via SPM in Xcode using the PR's branch.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 2.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Jan 29, 2023
@mtrezza mtrezza unpinned this issue Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) state:released Released as stable version type:feature New feature or improvement of existing feature
Projects
None yet