-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Add Linux support to SwiftDate #568
Comments
Is there any specific version known to compile under Linux? |
Is there an easy way to test it? A container? |
Sure there is. Install Docker for Mac CE, and run this from your project folder:
After a cursory look (a friend is looking for working date arithmetics on Linux and found this project, I'm just helping out), the project doesn't build because there are multiple Darwin-only references in it, plus the unit tests are not set up correctly either. (Travis can be potentially tamed to do Linux testing too, once the source and the tests are up to speed. As a side note, I've had more luck with CircleCI 2.0 for Swift + Linux.) |
Did you know if this error is referred to the git repository or...what?
|
Do you have any spaces in your current working directory path? My gut feeling says that it might cause trouble with the backticks. |
Yeah it was related to spaces in path. With iCloud it's a damn mess. Thanks. |
Related commit: #611 Removed arc4random_uniform to use new Swift 4.2 random APIs. |
This is the opening issues on Linux, strictly related to
|
Still remains only the definitions inside the
|
Okay it now compiles fine. I've switched from old internal implementation taken from CoreFoundation to |
Is there a way to run unit tests via docker? |
commands is
|
Finally it compiles successfully. sourcery --sources Tests --templates .sourcery/LinuxMain.stencil --output .sourcery --force-parse generated
mv .sourcery/LinuxMain.generated.swift Tests/LinuxMain.swift However there are several failed tests. |
I had a strange issue with compare function with granularity inside the NSCalendar object. let d2 = Date.init(timeIntervalSince1970: 1529431200.0) // 2018-06-19 18:00:00 +0000
let d3 = Date.init(timeIntervalSince1970: 1529604000.0) // 2018-06-21 18:00:00 +0000
print("Data2: \(d2), Date3: \(d3)")
let res = Calendar.current.compare(d2, to: d3, toGranularity: .month) The following code return I had filled the following radar on Swift forum: |
Follow #612 |
5.0.5 does not compile under Linux. Multiple issues objective C runtimes, arc_random etc.
The text was updated successfully, but these errors were encountered: