Experimental consolidated iOS repo/framework

692 views
Skip to first unread message

Jens Alfke

unread,
Mar 16, 2012, 8:47:51 PM3/16/12
to mobile-c...@googlegroups.com
OK, I’ve got a repository that combines TouchDB and CouchCocoa into a single framework called “Syncpoint”. This is the rough shape of the product we are going to release as the Syncpoint client. It is <blink>BLEEDING EDGE STUFF</blink> right now, though, so feel free to ignore this thread :)

There are not too many actual code changes yet. I’ve merged together a few things, like the _changes-listener classes and JSON APIs, but other than that CouchCocoa still talks to TouchDB the way it used to via NSURLConnection. This is setting the state for tighter merging; so far just the packaging-level changes have been gnarly and time-consuming.

To check it out:


(The “--recursive” flag will automatically initialize and check out submodules.)

To build it:
  1. Open Syncpoint.xcworkspace.
  2. Choose the “Syncpoint iOS Framework” scheme (should be at the top of the pop-up) and “Simulator” destination.
  3. Build.
  4. Open build/Syncpoint/Build/Products/Debug-iphonesimulator/
  5. Voila Syncpoint.framework! Copy it where you will.
(To build for Mac OS, use the “Syncpoint Mac” scheme, and look for the result in the Debug/ folder.)

You should be able to build existing TouchDB/CouchCocoa based apps with the new framework, but you will need to change the #imports in your code. Basically, anywhere you imported a CouchCocoa header, replace that with
#import <Syncpoint/Syncpoint.h>
The class names, constants, etc. are still the same for now, don’t worry.

If you’re feeling very curious you could have a look at SyncpointClient.h, SyncpointModels.h, etc. but be aware that these are still in a chrysalis state, evolving into new forms day by day.

—Jens

Iain Stubbs

unread,
Mar 16, 2012, 11:36:01 PM3/16/12
to mobile-c...@googlegroups.com
Thanks Jens - but I get the following errors after following your git command ...

Unable to checkout 'a58402683d96846d9f9bfa9cf1ed25441245df0d' in submodule path 'CouchCocoa'
--
Cheers



Iain Stubbs
0404873041

"We are ready for any unforeseen event that may or may not occur" - George W Bush

Jens Alfke

unread,
Mar 16, 2012, 11:38:59 PM3/16/12
to mobile-c...@googlegroups.com

On Mar 16, 2012, at 8:36 PM, Iain Stubbs wrote:

Thanks Jens - but I get the following errors after following your git command ...

Unable to checkout 'a58402683d96846d9f9bfa9cf1ed25441245df0d' in submodule path 'CouchCocoa'

Oops, didn’t push the latest revision in CouchCocoa. Try it again now!

—Jens

Iain Stubbs

unread,
Mar 16, 2012, 11:46:00 PM3/16/12
to mobile-c...@googlegroups.com
Ok - got further but then got...

The following build commands failed:

Libtool /Users/iainstubbs1959/Downloads/Syncpoint-iOS/DerivedData/Syncpoint/Build/Products/Debug-iphoneos/libSyncpoint.a normal armv7

(1 failure)

Showing first 200 notices only

Command /bin/sh failed with exit code 65

J Chris Anderson

unread,
Mar 17, 2012, 2:20:18 AM3/17/12
to mobile-c...@googlegroups.com, mobile-c...@googlegroups.com
I had to upgrade to the latest (4.3) Xcode to make it build...

Sent from my iPhone

Iain Stubbs

unread,
Mar 17, 2012, 2:31:20 AM3/17/12
to mobile-c...@googlegroups.com
I'm on 4.3.1 - has there been an update since?

J Chris Anderson

unread,
Mar 17, 2012, 2:43:46 AM3/17/12
to mobile-c...@googlegroups.com
I think that is what I've got. Not near my build laptop right now or I'd double check. My testing was as of a few days ago. Will retest sometime thus weekend and post if I hit any snags.

Chris 

Sent from my iPhone

bk

unread,
Mar 17, 2012, 3:10:14 AM3/17/12
to mobile-c...@googlegroups.com
Select SyncPoint iOS Framework -> iPhone 5.1 Simulator. It should work.
Initially I selected just iOS Device instead of simulator and it gave me the exact same error you have mentioned.
And yes latest xcode is Version 4.3.1 (4E1019).

J Chris Anderson

unread,
Mar 17, 2012, 10:55:16 AM3/17/12
to mobile-c...@googlegroups.com

On Mar 16, 2012, at 11:43 PM, J Chris Anderson wrote:

I think that is what I've got. Not near my build laptop right now or I'd double check. My testing was as of a few days ago. Will retest sometime thus weekend and post if I hit any snags.

Chris 

Sent from my iPhone

On Mar 16, 2012, at 11:31 PM, "Iain Stubbs" <stu...@gmail.com> wrote:

I'm on 4.3.1 - has there been an update since?

I just did a fresh checkout and build of the "Syncpoint iOS Demo" target for iPhone 5.1 simulator and everything was smooth. My Xcode is Version 4.3.1 (4E1019)

Chris

Jens Alfke

unread,
Mar 17, 2012, 8:32:45 PM3/17/12
to mobile-c...@googlegroups.com

On Mar 16, 2012, at 8:46 PM, Iain Stubbs wrote:

Libtool /Users/iainstubbs1959/Downloads/Syncpoint-iOS/DerivedData/Syncpoint/Build/Products/Debug-iphoneos/libSyncpoint.a normal armv7

(1 failure)

Showing first 200 notices only

Command /bin/sh failed with exit code 65


Can you post the exact error message? You’ll need to go to the build output tab in the navigator and click the little parallel-lines button at the right edge of the error to switch to the raw-output view.

—Jens

Paul Capestany

unread,
Mar 22, 2012, 7:59:32 PM3/22/12
to mobile-c...@googlegroups.com
I got the same "/bin/sh failed with exit code 65" error as stubbsi when trying to build the latest commit of the Syncpoint framework (with my scheme set to iPhone 5.1 Simulator).

Jens—I posted the full error message here

Iain Stubbs

unread,
Mar 22, 2012, 8:05:46 PM3/22/12
to mobile-c...@googlegroups.com
I have recloned and I have exactly the same error again ...

Jens Alfke

unread,
Mar 22, 2012, 8:18:53 PM3/22/12
to mobile-c...@googlegroups.com

On Mar 22, 2012, at 4:59 PM, Paul Capestany wrote:

> I got the same "/bin/sh failed with exit code 65" error as stubbsi when trying to build the latest commit of the Syncpoint framework (with my scheme set to iPhone 5.1 Simulator).

Yeah, I’ve seen this error too:

/Users/capestany/Library/Developer/Xcode/DerivedData/Syncpoint-gznvmjhcrtfvpibfgxytjcoiarac/Build/Products/Debug-iphoneos/libSyncpoint.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lfacebook_ios_sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lfacebook_ios_sdk is not an object file (not allowed in a library)

It doesn’t make sense, and for me it went away when I rebuilt. Time to go track it down for real … yay.

I’d say that dealing with complex Xcode build configurations was the least favorite part of my job, if it weren’t for the mandatory weekly latrine cleaning duty.

—Jens

Iain Stubbs

unread,
Mar 22, 2012, 8:37:45 PM3/22/12
to mobile-c...@googlegroups.com
and it now fails with xcode 4.3.2 ...

Paul Capestany

unread,
Mar 22, 2012, 8:49:20 PM3/22/12
to mobile-c...@googlegroups.com
Ok, I just got it to build and I was able to run the Syncpoint version of the Demo Grocery App as well (and I've also been running Xcode 4.3.2).

Here's what I did:

- Xcode was giving a warning about wanting to change some compiler settings, so I let it change em.
- I then did a Ctrl + K clean, just to play things safe.
- It still wouldn't build for iPhone 5.1 Simulator, so I changed the scheme to be for my actual iPhone.
- *MAGIC!* It built.

Iain Stubbs

unread,
Mar 22, 2012, 9:02:38 PM3/22/12
to mobile-c...@googlegroups.com
ditto for me ... thanks for the info...

Iain Stubbs

unread,
Mar 22, 2012, 9:27:11 PM3/22/12
to mobile-c...@googlegroups.com
My app just came up with Syncpoint ...

Jens Alfke

unread,
Mar 22, 2012, 9:30:23 PM3/22/12
to mobile-c...@googlegroups.com

On Mar 22, 2012, at 5:49 PM, Paul Capestany wrote:

- It still wouldn't build for iPhone 5.1 Simulator, so I changed the scheme to be for my actual iPhone.
- *MAGIC!* It built.

Yeah, the problem is some weird failure in the ‘fat’ build — when the scheme is set to Device and it builds the Facebook library for the simulator, the linker settings are screwed up. So it appears that a workaround is to explicitly build for the simulator first, to get that Facebook library built, and then both builds will work.

By the way, Chris will be back from vacation next week, so maybe he’ll be able to unveil the server-side components of Syncpoint that this client code talks to.

—Jens

Len Kawell

unread,
Mar 22, 2012, 10:23:42 PM3/22/12
to mobile-c...@googlegroups.com
If there isn't one yet, could you post a pre-built version? If there is one, could you point me to it? The only one I found was https://github.com/couchbaselabs/TouchDB-iOS/downloads and it says that it's a month old. Thanks.

Paul Capestany

unread,
Mar 22, 2012, 11:10:34 PM3/22/12
to mobile-c...@googlegroups.com
On Thursday, March 22, 2012 6:30:23 PM UTC-7, Jens Alfke wrote:

By the way, Chris will be back from vacation next week, so maybe he’ll be able to unveil the server-side components of Syncpoint that this client code talks to.


Awesome! Is that what you guys are calling "Couchbase Server 2.0 Developer Preview"? Or is that something else? 

Jens Alfke

unread,
Mar 23, 2012, 12:31:42 PM3/23/12
to mobile-c...@googlegroups.com

On Mar 22, 2012, at 8:10 PM, Paul Capestany wrote:

By the way, Chris will be back from vacation next week, so maybe he’ll be able to unveil the server-side components of Syncpoint that this client code talks to.


Awesome! Is that what you guys are calling "Couchbase Server 2.0 Developer Preview"? Or is that something else? 

That’s something else — the big-iron server. Syncpoint will, in part, be glue between that and mobile clients.

—Jens

Pulkit Singhal

unread,
Mar 26, 2012, 10:44:37 AM3/26/12
to mobile-c...@googlegroups.com
Hello Jens,

I cloned just last night (March 25th) & I'm getting a total of 21 compilation issues while building Syncpoint iOSFramework > iPhone 5.0 Simulator on Xcode 4.2.1 and here's a flavor of some of the errors:

Receiver type 'SyncpointClient' for instance message does not declare a method with selector 'stopObservingControlPull'
Receiver type 'SyncpointFacebookAuth' for instance message does not declare a method with selector 'forgetToken'
Default property attribute 'assign' not appropriate for non-gc object
No 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed
Receiver type 'SyncpointClient' for instance message does not declare a method with selector 'connectToControlDB'

Any thoughts?
- Pulkit

Pulkit Singhal

unread,
Mar 26, 2012, 11:29:39 AM3/26/12
to mobile-c...@googlegroups.com
Got past it all after the upgrade to Xcode 4.3.2

Pulkit Singhal

unread,
Mar 26, 2012, 11:46:16 AM3/26/12
to mobile-c...@googlegroups.com
Hi Jens,

Just want to double-check ... when you say:
"Open build/Syncpoint/Build/Products/Debug-iphonesimulator/"

Are you possibly hinting at a path, which on our machines may be something like the following:
/Users/pulkitsinghal/Library/Developer/Xcode/DerivedData/Syncpoint-feknkuolcerbbghclpbnmdnqyrlc/Build/Products/Debug-iphonesimulator/

Or something else?

On Fri, Mar 16, 2012 at 7:47 PM, Jens Alfke <je...@couchbase.com> wrote:

Jens Alfke

unread,
Mar 26, 2012, 1:09:20 PM3/26/12
to mobile-c...@googlegroups.com

On Mar 26, 2012, at 8:29 AM, Pulkit Singhal wrote:

Got past it all after the upgrade to Xcode 4.3.2

Yes, sorry. The compiler in Xcode 4.3 allows forward-references to methods, whereas earlier versions didn’t. This is nice, but it’s easy to depend on this feature without realizing you’re doing it, inadvertently creating code that won’t build with 4.2 or earlier. I think I’m going to just say that Xcode 4.3 is required for Syncpoint.

Just want to double-check ... when you say:
"Open build/Syncpoint/Build/Products/Debug-iphonesimulator/"

Are you possibly hinting at a path, which on our machines may be something like the following:
/Users/pulkitsinghal/Library/Developer/Xcode/DerivedData/Syncpoint-feknkuolcerbbghclpbnmdnqyrlc/Build/Products/Debug-iphonesimulator/

Yes, wherever your build output is. It depends on how you’ve got your Xcode prefs configured; I use a ‘build’ subfolder of the project directory so that path I gave is the literal path from the project root. If you put builds in ~/Library, your paths will be different.

—Jens

Pulkit Singhal

unread,
Mar 26, 2012, 4:54:31 PM3/26/12
to mobile-c...@googlegroups.com
Thank You Jens!

Now I'll ask some utterly RTFM Qs that will probably make your jaw drop ...
  1. Why does compilation for Demo-Shopping-IOS > iPhone 5.1 Simulator fail with 'Syncpoint.h' file not found?
  2. Is something yet to be checked in or is it just my ignorance?
The biggest charm for me in this newly consolidated branch is the presence of TouchDB and CouchCocoa all together so that I don't have to go get them separately and then link them together but SyncPoint seems to be getting in the way ;)

- Pulkit
Reply all
Reply to author
Forward
0 new messages