JohnSundell / Marathon

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

Failed to compile script #157

Closed UncleRic closed 6 years ago

UncleRic commented 6 years ago

I followed the example thusly:

$:swift --version Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2) Target: x86_64-apple-macosx10.9

$:marathon create helloWorld "import Foundation; print(\"Hello world\")" πŸ’₯ Failed to open script 'helloWorld' for editing πŸ‘‰ Make sure that it exists and that its file is readable

$:ls helloWorld.* helloWorld.swift

$: marathon run helloWorld πŸ’₯ Failed to compile script $:

$:cat helloWorld.swift import Foundation; print("Hello world") $:

gunesmert commented 6 years ago

Same here, it is not possible to compile example script. @JohnSundell

proxpero commented 6 years ago

I encountered this issue as well. The fix for me was to install using SPM not homebrew. I think the homebrew version is stale. (I also deleted my .marathon folderβ€”but I don't know if that's relevant)

bduisenov commented 6 years ago

+1 @proxpero thanks for sharing. Got it working after removing .marathon folder.

narner commented 6 years ago

+1, also experiencing the same issue after using brew

JohnSundell commented 6 years ago

Hey guys, sorry, a bit late to the party here πŸ˜… It's correct that the latest version of Marathon is not yet available on Homebrew (see https://github.com/JohnSundell/Marathon/issues/145 for details). I hope to make it available there soon, but in the meantime you can use master (by installing through SPM or Mint) which contains a fix for Xcode 9.1 and later πŸ‘

mkkroliks commented 6 years ago

I've installed marathon via brew but after reading comments about issue I uninstalled it and used make/SPM but still encounter the same problem.

marathon create helloWorld "import Foundation; print(\"Hello world\")" 🐣 Created script at helloWorld.swift πŸ’₯ Failed to open script 'helloWorld' for editing πŸ‘‰ Make sure that it exists and that its file is readable

Any suggestions? I could not find any .marathon folder. Where is it located?

proxpero commented 6 years ago

Files with a dot in front are hidden. You can google "show hidden files mac" to find out how to reveal them in Finder. My .marathon file is in my home folder. You can get to it (hidden or not) from the Finder.app menu: Go -> Go to Folder…  and enter ~/.marathon. (~ means your home folder)

mkkroliks commented 6 years ago

@proxpero Cool thanks a lot. I was looking for this folder in brew directory and did not know it can appear in home directory. It solved my issue.

lf-araujo commented 6 years ago

Can confirm the similar (same?) bug on linux. Marathon is not usable in my installation at the moment, unfortunately.

└─λ swift --version
Swift version 4.0.3 (swift-4.0.3-RELEASE)
Target: x86_64-unknown-linux-gnu

Marathon was installed using clone and swift build.

If I try to run the Files example from the Readme.md with the --verbose flag I get:

   /home/luis/.marathon/Scripts/Cache/-tmp-Selenops-teste/.build/checkouts/Files.git--6062313482316197225/Sources/Files.swift:1024:12: error: value of type 'ObjCBool' (aka 'Bool') has no member 'boolValue'
           if objCBool.boolValue {
              ^~~~~~~~ ~~~~~~~~~
   warning: '--chdir/-C' option is deprecated; use '--package-path' instead

By the looks it may be a distinct problem, related to latest Files dependency.

Edit: found the solution in my case and sent a pull request: https://github.com/lf-araujo/Files/pull/1

Edit 2 This problem has disappeared last update, I think its time to close it.

ghost commented 6 years ago

You will need to do exactly what it says in the README

marathon create helloWorld "import Foundation; print(\"Hello world\")"

Your script will build fine if you escape the quote marks.

Maybe marathon create should validate the script works, by building it first, and avoid creating the script if it doesn't compile ?

lf-araujo commented 6 years ago

This issue is no more, someone should close it.