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

Build using Carthage? #39

Closed
davenquinn opened this issue Apr 5, 2017 · 14 comments
Closed

Build using Carthage? #39

davenquinn opened this issue Apr 5, 2017 · 14 comments

Comments

@davenquinn
Copy link

Hi,

This looks like fantastic work! I am trying to integrate into an app where I am using Carthage as my framework manager — it's a little more lightweight than CocoaPods. I am wondering if it is possible to configure this for Carthage...I tried installing it and there was some cryptic (to me) error which I have pasted below. Perhaps this just means that there needs to be a Cartfile in the project directory specifying dependencies (MapBox iOS SDK?). Might be...anyway, insight from other interested parties would be appreciated.

Thanks,
Daven

*** Building scheme "GEOSwift" in GEOSwift.xcworkspace
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -workspace "/Users/Daven/Development/Mapping App/Map-Digitizer/Carthage/Checkouts/GEOSwift/GEOSwift.xcworkspace" -scheme GEOSwift -configuration Release -derivedDataPath /Users/Daven/Library/Caches/org.carthage.CarthageKit/DerivedData/GEOSwift/f5a631fe99cdac1fd72fd680763b8cf952a9aed6 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/md/lvb3zv4n5652ffl6t44397t80000gn/T/carthage-xcodebuild.l8D67B.log
@vfn
Copy link
Member

vfn commented Apr 5, 2017 via email

@davenquinn
Copy link
Author

Oh sorry, that's a pretty obvious step for me to take! My bad. It was kinda large so I attached below...

xcode-build.txt

@kylebrowning
Copy link

Getting this as well.

@kylebrowning
Copy link

kylebrowning commented Oct 30, 2017

WARNING: Unable to open project file '/Users/kylebrowning/work/ios/leagueapp/Carthage/Checkouts/GEOSwift/GEOSwift.playground' in workspace '/Users/kylebrowning/work/ios/leagueapp/Carthage/Checkouts/GEOSwift/GEOSwift.xcworkspace'.
=== BUILD TARGET GEOSwift OF PROJECT GEOSwift WITH CONFIGURATION Release ===

@samritchie
Copy link
Contributor

Carthage is not going to work as-is on the project; as it’s building geos via a pod install step and linking via a Pods framework. Carthage builds are failing on the CocoaPods 'run script' lockfile check, but even if that was stripped out the build will fail when it attempts to link to geos.framework

The xcodeproj isn’t used at all by cocoapods (which only looks at the podspec) so it’s more common to see this set up to handle the Carthage build. However in this case, dropping CocoaPods out of the project file will impact the experience for users downloading & running the playground, and the developers who are presumably pod people.

For frameworks with dependencies, people seem to mostly use --use-submodules to add the Carthage dependencies to Carthage/Checkouts as a submodule, but to support casual users of playground it might be better committing the geos dependency in Carthage/Checkouts directly to the repo. @vfn if you have any sort of a preference here, let me know.

@vfn
Copy link
Member

vfn commented May 3, 2018

@samritchie Would you be able to create a pull request with what you are suggesting?

Thanks!

@samritchie
Copy link
Contributor

samritchie commented May 4, 2018

Can I verify if the playground should be working? I only get


error: Couldn't lookup symbols:
  __T08GEOSwift8GeometryC7crossesSbACF
  __T08GEOSwift8WaypointCMa
  __T08GEOSwift8GeometryC8disjointSbACF
  __T08GEOSwift12MultiPolygonCMa
  __T08GEOSwift8GeometryC6relateSbAC_SS7patterntF
  __T08GEOSwift8GeometryC12intersectionACSgACF
  __T08GEOSwift8GeometryC6equalsSbACF
  __T08GEOSwift8GeometryCACSgSS3WKT_tcfC
  __T08GEOSwift8GeometryCMa
  __T08GEOSwift8GeometryC6bufferACSgSd5width_tF
  __T08GEOSwift8GeometryC8containsSbACF
  __T0Sa8GEOSwiftAA7FeatureCRszlE11fromGeoJSONSayACGSg10Foundation3URLVKFZ
  __T08GEOSwift8GeometryC5unionACSgACF
  __T08GEOSwift7PolygonCMa
  __T08GEOSwift8GeometryC7touchesSbACF
  __T08GEOSwift8GeometryC10differenceACSgACF
  __T08GEOSwift8GeometryC8boundaryACSgyF
  __T08GEOSwift8GeometryC8overlapsSbACF
  __T08GEOSwift8GeometryC14pointOnSurfaceAA8WaypointCSgyF
  __T08GEOSwift8GeometryC10convexHullAA7PolygonCSgyF
  __T08GEOSwift8GeometryC6withinSbACF
  __T08GEOSwift7FeatureCMa
  __T08GEOSwift8GeometryC8centroidAA8WaypointCSgyF
  __T08GEOSwift8GeometryC10intersectsSbACF
  __T08GEOSwift8GeometryC8mapShapeSo7MKShapeCyF
  __T08GEOSwift8GeometryC8envelopeACSgyF```

@vfn
Copy link
Member

vfn commented May 4, 2018

@samritchie it was working until Xcode 9.2, that was the last time I checked. I haven't tried it on Xcode 9.3

@mmarkov-appolica
Copy link

Is there a working solution for the carthage?

@madhavajay
Copy link
Contributor

#145

@madhavajay
Copy link
Contributor

#149

@macdrevx
Copy link
Member

#153

@madhavajay
Copy link
Contributor

@macdrevx and I have solved the issue. For anyone who wants to know what we did. I created an xcode project for the https://github.com/GEOSwift/geos dependency which allows a nested Carthage dependency in GEOSwift.

There was a hacky way to then get Carthage to play ball, by having a pre-script which copied the geos.framework into the expected filename for the existing Cocoapods Workspace setup.
However @macdrevx opted instead to replace Cocoapods with Carthage as the primary Dependency manager for the GEOSwift project, thus allowing Cocoapods to just be a spec for external use.

The final missing piece of the puzzle was getting the Playgrounds to work. Turns out that the playgrounds are able to find frameworks in the current Build > Product > Arch directory $BUILT_PRODUCTS_DIR so I simply copy the geos.framework from the Carthage folder into this local folder during build so that the Playground sees it.

If anyone knows a better solution I am all ears. I tried the obvious solution of nesting the Playground in the project since the Framework Search Paths are defined there and work for the framework build, but no luck.

Anyway, looks like GEOSwift is now: Cocoapods, Carthage and SPM compatible which is great news!

@macdrevx
Copy link
Member

This change will be released shortly…

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

7 participants