JohnSundell / Marathon

[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts πŸƒ
MIT License
1.86k stars 78 forks source link

Fix Swift 4.1 branch on Linux #169

Closed sunshinejr closed 6 years ago

sunshinejr commented 6 years ago

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 ;-)