JohnSundell/Marathon

Can't create scripts with SourceKitten as a dependency

dabrut opened this issue ยท 7 comments

It seems like I can add SourceKitten as a dependency using

marathon add https://github.com/jpsim/SourceKitten.git

but when I try to create a script using

marathon create helloWorld --verbose

I get this error

๐Ÿƒ  $ cd "/Users/bruno/.marathon/Scripts/Cache/-Users-bruno-Documents-Scripts-helloWorld/" && readlink OriginalFile
   /Users/bruno/Documents/Scripts/helloWorld.swift
   $ cd "/Users/bruno/Documents/Scripts/" && /usr/bin/env xcrun --sdk macosx swift --version
   Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
   Target: x86_64-apple-macosx10.9
   $ cd "/Users/bruno/.marathon/Scripts/Cache/-Users-bruno-Documents-Scripts-helloWorld/" && /usr/bin/env xcrun --sdk macosx swift package generate-xcodeproj
   error: product dependency 'SourceKitten' not found
๐Ÿ’ฅ  Failed to open script 'helloWorld' for editing
๐Ÿ‘‰  Make sure that it exists and that its file is readable

This is the content of ~/.marathon/Packages and SourceKitten is in there.

screen shot 2017-11-05 at 4 37 55 pm

Not really sure what's happening here ๐Ÿค”

Thanks for opening an issue, so much easier than on Twitter ๐Ÿ˜… Did you install Marathon through Homebrew or are you using the latest master?

Haha totally. I just wanted to make sure that it should work before opening an issue ๐Ÿ˜„ .

I built it myself by pulling master and using the Swift Package Manager.
I followed the steps that are on the README.

Alright, I can reproduce it locally here. Will look into it a bit and let you know what I find ๐Ÿ˜„

Oh great.
Thanks John

This is intriguing, but it seems to be a problem with SourceKitten rather than Marathon. I just created a brand new Swift Package and added SourceKitten to its Package.swift, and I get the exact same error:

error: product dependency 'SourceKitten' not found

Looking at the SourceKitten repo, it looks like they are using an interesting way of supporting both Swift 3.x and Swift 4 that I haven't seen before (using a @swift-4 suffix on the Package.swift file).

So I'd open an issue with SourceKitten for this, since it seems that their SPM support is broken in general. Once that issue it fixed there should be no problems adding it to Marathon ๐Ÿ‘

Interesting.
Thanks a lot for looking into this ๐Ÿ‘
I'll close this issue since it's not related to Marathon.

No problems ๐Ÿ™‚