serverless-openwhisk icon indicating copy to clipboard operation
serverless-openwhisk copied to clipboard

Support for Swift 4.1 runtime

Open chrislonge opened this issue 5 years ago • 4 comments

The openwhisk-swift template defaults to 3.1.1. Is there plans to add support for Swift 4.1?

chrislonge avatar Sep 07 '18 01:09 chrislonge

@chrislonge :wave: Swift 4.1 is also supported in OpenWhisk. If you use the runtime: swift:4.1 configuration parameter in the YAML, this should change the runtime verison. Let me know if this doesn't work for you?

jthomas avatar Sep 10 '18 08:09 jthomas

Hey @jthomas, I was able to change the runtime to 4.1, thanks! I did have a couple questions however.

  1. Will the default swift template app work using 4.1, or do I need to make changes? Doesn't seem to be working when I invoke with 4.1 on the template:
    {
      "error": "The action failed to generate or locate a binary. See logs for details."
    }
    
  2. Swift 4.2 comes out in about a week or two, is there plans to update template to default to at least 4.1?

Thanks for your help!

chrislonge avatar Sep 17 '18 03:09 chrislonge

@chrislonge You have found a bug 😢. I can see that the 4.1 runtime fails to compile with the example template project. Here are the logs I get....

activation (2f8d8e2948ee4bb98d8e2948ee8bb989):
2018-09-17 15:34:14.655 Compiling
2018-09-17 15:34:14.655 swiftc status is 1
2018-09-17 15:34:14.655 Action did not compile
2018-09-17 15:34:14.655 /swift4Action/spm-build/Sources/Action/main.swift:127:25: error: use of unresolved identifier 'main'
2018-09-17 15:34:14.655 _run_main(mainFunction: main)
2018-09-17 15:34:14.655 ^~~~
2018-09-17 15:34:14.655 Swift.min:1:13: note: did you mean 'min'?
2018-09-17 15:34:14.655 public func min<T>(_ x: T, _ y: T) -> T where T : Comparable
2018-09-17 15:34:14.655 ^
2018-09-17 15:34:14.655 Swift.min:1:13: note: did you mean 'min'?
2018-09-17 15:34:14.655 public func min<T>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T where T : Comparable
2018-09-17 15:34:14.655 ^

I will have to try and look into this although I've not got much time at the moment.

2). I'll open an issue for this.

jthomas avatar Sep 17 '18 15:09 jthomas

https://github.com/apache/incubator-openwhisk-runtime-swift/issues/83

jthomas avatar Sep 17 '18 15:09 jthomas