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

Enable the PhoenixCouchDB repo to compile (including test cases) #7

Closed
dfirsht opened this issue Feb 8, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@dfirsht
Copy link
Contributor

dfirsht commented Feb 8, 2016

Issue by ricardo-olivieri
Wednesday Jan 06, 2016 at 23:06 GMT
Originally opened as https://github.ibm.com/ibmswift/Phoenix/issues/7


@dfirsht dfirsht added this to the 0.2 milestone Feb 8, 2016
@dfirsht
Copy link
Contributor Author

dfirsht commented Feb 8, 2016

Comment by KALLNER
Tuesday Jan 19, 2016 at 21:39 GMT


I don't think this repo was built after the move. SwiftCouchDB needs net (at least) from Phoenix. Also it needs SwiftyJSON.

Where is the contents of the Package.swift file?
Why are the source files under Sources? Eventually we will have tests.....

@dfirsht
Copy link
Contributor Author

dfirsht commented Feb 8, 2016

Comment by ricardo-olivieri
Monday Jan 25, 2016 at 16:56 GMT


Work item completed, though on Linux, we have known compilation issues because of SwiftyJson (see issue #63).

@dfirsht
Copy link
Contributor Author

dfirsht commented Feb 8, 2016

Comment by rfdickerson
Thursday Feb 04, 2016 at 16:17 GMT


I was able to get the CouchDBSample to successfully link the sample app on Linux by using:

/home/rfdickerson/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu15.10/usr/bin/swiftc -o /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/CouchDBSample /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/PhoenixCouchDB.o/Sources/CouchDBSample/main.swift.o -g /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/CouchDB.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/SwiftyJSON.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/net.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/sys.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/router.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/regex.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/Phoenix.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/HeliumLogger.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/ETSocket.a /home/rfdickerson/mil/PhoenixProject/PhoenixCouchDB/.build/debug/net.a -L/usr/local/lib -Xlinker -ldispatch -Xlinker -L./.build/debug

The problem was that the net.a library needs to be included after the router. There's an issue regarding the order of static libraries that are determined by llbuild and the Package manager. This bug will be fixed eventually, I imagine.

Starting sample program...
connPropertiesStr:
    hostName -> fee33f3a-cdbc-4c9b-bf9a-f1541ee68c06-bluemix.cloudant.com
    port -> 80
    secured -> false
    userName -> Optional("omitted")
    password -> Optional("omitted")
Hostname is: fee33f3a-cdbc-4c9b-bf9a-f1541ee68c06-bluemix.cloudant.com
>> Successfully created the following JSON document in CouchDB:
    Optional({
  "id": "123456",
  "ok": true,
  "rev": "82-a5ffd94265f8fd8f17c236bc86e6cf86"
})
>> Successfully read the followiong JSON document with ID 123456 from CouchDB:
    Optional({
  "truncated": false,
  "value": "value1",
  "_rev": "82-a5ffd94265f8fd8f17c236bc86e6cf86",
  "favorited": false,
  "coordinates": null,
  "_id": "123456",
  "created_at": "Tue Aug 28 21:16:23 +0000 2012"
})
revisionNumber is 82-a5ffd94265f8fd8f17c236bc86e6cf86
>> Successfully updated the JSON document with ID 123456 in CouchDB:
    Optional({
  "id": "123456",
  "ok": true,
  "rev": "83-623dd48d1cb9a471e896f294795eb963"
})
revisionNumber is 83-623dd48d1cb9a471e896f294795eb963
>> Successfully deleted the JSON document with ID 123456 from CouchDB.
Sample program completed its execution.

This is not an ultimate solution, however it's enough to link the sample app.

@shmuelk
Copy link
Collaborator

shmuelk commented Feb 9, 2016

Now compiles and runs on both Linux and OSX. Tested using the SwiftBlue-Pic demo server

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

2 participants