vinivendra / Gryphon

The Swift to Kotlin translator.
https://vinivendra.github.io/Gryphon/
Other
609 stars 46 forks source link

Support Swift 5.4 #102

Closed troy-lamerton closed 3 years ago

troy-lamerton commented 3 years ago

Try to run Gryphon on MacOS Big Sur:

$ gryphon ./hello.swift
Swift version 5.4 is not supported.
Currently supported Swift versions: 5.1, 5.2, 5.3.
You can use the `--toolchain=<toolchain name>` option to choose a toolchain with a supported Swift version.
$ gryphon --toolchain=5.3 ./hello.swift
Gryphon's new frontend always uses the Swift version it was built with. The current version was built with (and uses) Swift 5.3. To use a different version, please reinstall Gryphon.
$ gryphon ./hello.swift
Swift version 5.4 is not supported.
Currently supported Swift versions: 5.1, 5.2, 5.3.
You can use the `--toolchain=<toolchain name>` option to choose a toolchain with a supported Swift version.
$ swift --version
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0

How do I get it working? If I need to install older swift version, I'm worried that will break Xcode projects.

Previously I have been running Gryphon in a linux docker container and that worked.

vinivendra commented 3 years ago

Hi Troy!

Swift 5.4 isn’t supported yet, but I’ll look into it this weekend.

It seems that you’re using a gryphon version built with Swift 5.3 though, so I’m not sure why it’s complaining about 5.4. Could you please try running gryphon hello.swift (without the ./)? If that doesn’t work, could you run xcode-select -p and tell me what that prints?

Also, sorry about that error message, it’s misleading. Gryphon doesn’t support the —toolchain option anymore, I need to replace it.

troy-lamerton commented 3 years ago

I ran those commands:

➜  Desktop gryphon hello.swift
Swift version 5.4 is not supported.
Currently supported Swift versions: 5.1, 5.2, 5.3.
You can use the `--toolchain=<toolchain name>` option to choose a toolchain with a supported Swift version.
➜  Desktop xcode-select -p
/Applications/Xcode.app/Contents/Developer

Xcode and MacOS version:

Screenshot 2021-05-05 at 07 43 06

vinivendra commented 3 years ago

I'm trying to add support for Swift 5.4 but I ran into a SwiftSyntax problem, so it's taking longer than I expected.

In the meantime I thought I'd take a look at why you're getting the --toolchain message, but it seems that message isn't present anymore in the latest version of Gryphon. Could you run a gryphon --version and tell me what version you're using?

vinivendra commented 3 years ago

Hi @troy-lamerton, this should be fixed in version 0.14. Please try updating Gryphon and let me know if it worked :)

vinivendra commented 3 years ago

I'm closing this because it seems to be fixed. If anyone still has problems, feel free to comment and I'll open it up again.