Skip to content
This repository has been archived by the owner. It is now read-only.

Fix Swift 4.1 branch on Linux #169

Merged
merged 2 commits into from Apr 21, 2018
Merged

Fix Swift 4.1 branch on Linux #169

merged 2 commits into from Apr 21, 2018

Conversation

@sunshinejr
Copy link
Collaborator

@sunshinejr sunshinejr commented Apr 21, 2018

Hey! This should help in #161 with Linux tests.

You might think "What better to do than spend the Friday night debugging Swift on Linux, eh?" -and you're absolutely right. I spent some time debugging the issue with Linux tests and I narrowed it down to one line. Try to run this line in your REPL:

NSData(contentsOfFile: "https://raw.githubusercontent.com/JohnSundell/MarathonTestScriptWithDependencies/master/Script.swift", options: .alwaysMapped)

And you should see something similar to:
zrzut ekranu 2018-04-21 o 01 59 34

So the problem is that for some reason we can't fetch the data from the interwebz using Foundation on Linux. The error suggests that the reason should be in this file, possible in this function. I didn't really have time for a bigger investigation but probably radar or issue or (even a fix) should be filled.

The solution, for now, is to use wget -O fileName fileUrl. I've checked both tests on macOS and Ubuntu 17~ and it looks good, but we'll see how the CI reacts 馃槃

Let me know what do you think about this one ;-)

@orta
orta approved these changes Apr 21, 2018
Copy link
Collaborator

@orta orta left a comment

I'm impressed 馃憤

Copy link
Owner

@JohnSundell JohnSundell left a comment

I'm impressed too 馃憤 Thanks a lot for this @sunshinejr, what a strange reason, almost seems like a bug in Linux' implementation of Data. But CI seems to be happy (finally! 馃槄) so I'm happy 馃槂

@JohnSundell JohnSundell merged commit 018e363 into JohnSundell:swift-4.1 Apr 21, 2018
2 checks passed
2 checks passed
buddybuild: Marathon (iOS, MarathonCore - Debug) Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants