Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Linux Support #121

Closed
rhyshort opened this issue Aug 24, 2016 · 21 comments
Closed

Linux Support #121

rhyshort opened this issue Aug 24, 2016 · 21 comments
Assignees
Milestone

Comments

@rhyshort
Copy link
Member

With the merging of URLSession into swift corelibs, (See swiftlang/swift-corelibs-foundation#426) it should be possible to compile on Linux.

Once a snapshot is published we should take the opportunity to see if we compile on linux and fix and issues that arise.

@rolivieri
Copy link

@rhyshort Hello, it is our understanding that with the latest development snapshot (8/25), libdispatch, NSURLSession and friends are now available: https://swift.org/download/#snapshots.

@rhyshort rhyshort self-assigned this Aug 30, 2016
@rhyshort
Copy link
Member Author

Yes they are available, there a few niggles to get through, so far I've got library compiling on Linux, just need to fix up the tests.

@rolivieri
Copy link

That's great! Looking forward to using the Cloudant SDK on linux.

@rhyshort
Copy link
Member Author

rhyshort commented Sep 1, 2016

Being able to test on Linux is currently blocked by SR-2170.

@rhyshort
Copy link
Member Author

Bad news on this. With the release of Swift 3, there are still issues that we can't overcome. The biggest being unable to link due to SR-2170. Which has yet to be fixed (error attached below). I think we will need to wait for a few patch releases before we can add linux support as it currently stands.

Error:

Linking ./.build/debug/SwiftCloudantPackageTests.xctest
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg6_queueXwGSqCS_14OperationQueue_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations6_queueXwGSqCS_14OperationQueue_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm6_queueXwGSqCS_14OperationQueue_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg10_cancelledSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations10_cancelledSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm10_cancelledSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg10_executingSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations10_executingSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm10_executingSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg9_finishedSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations9_finishedSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm9_finishedSb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg6_readySb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations6_readySb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm6_readySb' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg13_dependenciesGVs3SetS0__' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations13_dependenciesGVs3SetS0__' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm13_dependenciesGVs3SetS0__' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg6_groupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations6_groupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm6_groupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg9_depGroupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations9_depGroupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm9_depGroupC8Dispatch13DispatchGroup' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationg7_groupsGSaC8Dispatch13DispatchGroup_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operations7_groupsGSaC8Dispatch13DispatchGroup_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operationm7_groupsGSaC8Dispatch13DispatchGroup_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operation12_leaveGroupsfT_T_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operation6finishfT_T_' is not defined locally
/usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation9Operation15_waitUntilReadyfT_T_' is not defined locally
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@rhyshort
Copy link
Member Author

The related SR-1901 has been fixed. Not sure if it would fix the issue throughout foundation without verification however.

There are also a couple of issues with Foundation on linux JSONSeralisation, booleans are stored as NSNumber on linux and can't be cast to Bool like it can be on Apple platforms. HTTPCookieStorage is also lacking the shared storage option, we use it so we can access cookies later, and have our tests interact with the same cookie storage object.

@rhyshort
Copy link
Member Author

Small update, all of HTTPCookieStorage is currently unimplemented see https://github.com/apple/swift-corelibs-foundation/blob/7400a09/Foundation/NSHTTPCookieStorage.swift

@pushkarnk
Copy link

Yes, we'll start looking at HTTPCookieStorage.

@rhyshort
Copy link
Member Author

HTTPCookieStorage PR swiftlang/swift-corelibs-foundation#672 its been open quite a while and doesn't look like its going to get merged anytime soon.

@rhyshort
Copy link
Member Author

With swiftlang/swift-corelibs-foundation#836 merged, one less barrier to running on linux.

@benspratling4
Copy link

Is this fixed in Swift 3.1?

@rhyshort
Copy link
Member Author

No not yet, cookie support hasn't been merged so that is still a blocker.

@rhyshort
Copy link
Member Author

The linux testing will need to be expanded from just 14.04, to cover:

  • 14.04
  • 16.04
  • 16.10

should be straight forward to add to the matrix.

@ianpartridge
Copy link
Contributor

ianpartridge commented Jul 6, 2017

I've just merged the linux-support branch to master. With this, the Cloudant testsuite passes on Linux when run against the latest Swift 4 snapshot from swift.org.

Once Swift 4 is released we'll be able to declare Linux support!

@ricellis
Copy link
Member

ricellis commented Jul 6, 2017

Thanks @ianpartridge
We'll have to figure out whether this library becomes Swift 4 only or how easy it is to support both 4 and 3 (for non-linux).

@ianpartridge
Copy link
Contributor

As of today it compiles on both Swift 3 and 4, so hopefully we can support both.

@gmosx
Copy link

gmosx commented Sep 20, 2017

Now that Swift 4 is released, what's the status of this issue?

@rhyshort
Copy link
Member Author

There are currently test failures that need investigating: https://travis-ci.org/cloudant/swift-cloudant/jobs/277632910

@ianpartridge
Copy link
Contributor

Hmm, that's annoying, it must be a regression somewhere.

@gmosx
Copy link

gmosx commented Oct 7, 2017

So, any updates?

@ricellis
Copy link
Member

ricellis commented Mar 16, 2018

I'm closing this ticket, the Linux support work in this library has been done for quite a while (although not released). There is a remaining issue with the GetChangesOperation which I think should be tracked separately see #176.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants