exponea / exponea-ios-sdk

MIT License
19 stars 27 forks source link

Cannot install 2.16.0 using Carthage #47

Closed olejnjak closed 1 year ago

olejnjak commented 1 year ago

When running carthage update --platform iOS --cache-builds --use-xcframeworks with this Cartfile:

github "exponea/exponea-ios-sdk" == 2.16.0

I am getting this error

*** Fetching exponea-ios-sdk
*** Checking out exponea-ios-sdk at "2.16.0"
*** xcodebuild output can be found in /var/folders/_s/x8bvjnf17576wt6pz70ybtk00000gn/T/carthage-xcodebuild.RrC5lL.log
The dependency graph contained a cycle:
exponea-ios-sdk: SwiftSoup

I assume the cause is that since 2.15.2 "Cartfile" changed to "cartfile" which seems to be invalid. I would create a PR but none of my PRs ever got merged. Please fix ASAP thanks.

adam1929 commented 1 year ago

Hi @olejnjak did your Cartfile contains line: github "scinfu/SwiftSoup" == 2.4.3 ? Please check https://github.com/exponea/exponea-ios-sdk#carthage

olejnjak commented 1 year ago

Nope as my project doesn't actually depend on it. It is Exponea's dependency, so it should solve its dependencies. That is the actual nature of dependency managers, isn't it?

And also Exponea requires this input in Cartfile, I don't see a point why there is this badly named "cartfile" with the same dependency, doesn't make a good sense..

xcibik00 commented 1 year ago

Hi @olejnjak

Since we are an SDK with support of more package managers (pods, SPM and Carthage), we are bringing solution that souit to multiple customers with different env setup. Also due to the fact that size of SDK as-is is crucial for us/customers we can not include it as a part of SDK. This solution requires and certainly brings compromises in use - therefore it is necessary to proceed according to the documentation.

We are sorry for the badly named "cartfile" instead of "Cartfile" - we will update it in next iOS release. But it has no effect on functionality.

Hope it make sense for you. We always consider feedback and promise that we will still work on improvements for the best experience.

Regards

olejnjak commented 1 year ago

Hi @xcibik00, but this is not true and this seems to be major misunderstanding of how Carthage works. Badly named Cartfile has serious consequences as you can see in this following Cartfile.

# this fork with correctly named Cartfile (capital "C") is working right
github "olejnjak/exponea-ios-sdk" "cd44050" # 2.16.0 with fixed Cartfile name

This successfully createas XCFramework when running this:

olejnjak@Jakub-Macbook exponea-test % carthage update --platform iOS --cache-builds --use-xcframeworks
*** Cloning exponea-ios-sdk
*** Cloning SwiftSoup
*** Checking out exponea-ios-sdk at "cd440509c010b156d3b9b2cd9b83bdd6b642d6e5"
*** Checking out SwiftSoup at "2.4.3"
*** No cache found for SwiftSoup, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/_s/x8bvjnf17576wt6pz70ybtk00000gn/T/carthage-xcodebuild.W1ECbl.log
*** Building scheme "SwiftSoup-iOS" in SwiftSoup.xcodeproj
*** Building scheme "ExponeaSDKObjC" in ExponeaSDK.xcworkspace
*** Building scheme "ExponeaSDK" in ExponeaSDK.xcworkspace
*** Building scheme "ExponeaSDKShared" in ExponeaSDK.xcworkspace
*** Building scheme "ExponeaSDK-Notifications" in ExponeaSDK.xcworkspace

While running on 2.16.0 with this Cartfile

# original repo is not working as expected, reports false dependency cycle
# probably just because of badly named cartfile
github "exponea/exponea-ios-sdk" == 2.16.0

produces this output

olejnjak@Jakub-Macbook exponea-test-original % cu             
*** Fetching exponea-ios-sdk
*** Checking out exponea-ios-sdk at "2.16.0"
*** xcodebuild output can be found in /var/folders/_s/x8bvjnf17576wt6pz70ybtk00000gn/T/carthage-xcodebuild.Irh5eW.log
The dependency graph contained a cycle:
exponea-ios-sdk: SwiftSoup

Everything is fixed just by naming Cartfile correctly and having correctly specified.

And I don't know how you got the impression that having two inputs in Cartfile (Exponea and SwiftSoup) affects the result binary size, but that is obviously not true.

Screenshot 2023-05-03 at 11 11 44
xcibik00 commented 1 year ago

Hi @olejnjak, thanks for the remarks I reopened the issue -> we will double check it and taking steps to fix it and create 2.16.1 if necessary. We will inform you. Thanks for your patience.

olejnjak commented 1 year ago

I think everything that is needed is just fixing name of Cartfile and everything works as expected, I don't have any other issues with 2.16.0.

xcibik00 commented 1 year ago

Hi @olejnjak, we prepared new release 2.16.1 - should fix your issue