jmespath.swift icon indicating copy to clipboard operation
jmespath.swift copied to clipboard

Doesn't compile under Linux

Open proggeramlug opened this issue 3 years ago • 9 comments

I'm getting

/build/.build/checkouts/jmespath.swift/Sources/JMESPath/Variable.swift:118:96: error: type 'JSONSerialization.WritingOptions' has no member 'fragmentsAllowed'
            guard let jsonData = try? JSONSerialization.data(withJSONObject: array, options: [.fragmentsAllowed]) else {

proggeramlug avatar Nov 01 '21 10:11 proggeramlug

What version of swift are you compiling with?

The CI says swift 5.2 - 5.5 are all compiling fine

adam-fowler avatar Nov 01 '21 11:11 adam-fowler

I'm compiling with 5.2 - I'm sure it works under MacOS but Linux doesn't seem to have quite the same version of swift (yet).

proggeramlug avatar Nov 01 '21 16:11 proggeramlug

GitHub CI says swift:5.2 docker image works and I tested it locally as well. What is the output of swift --version

adam-fowler avatar Nov 01 '21 16:11 adam-fowler

I am getting the same issue with Vapor docker images, specifically vapor/swift:5.2.

CLoutas avatar Nov 08 '21 15:11 CLoutas

Ok swift:5.2 work fine but vapor/swift:5.2 doesn't. I'm guessing .fragmentsAllowed appeared in a patch release of swift 5.2 and it never managed to make it into the vapor images. I'll ask on the Vapor discord.

adam-fowler avatar Nov 08 '21 15:11 adam-fowler

The vapor swift docker images are no longer maintained. You should be able to use the swift:5.2 image instead of vapor/swift:5.2. Unless @proggeramlug says he is using another docker image in the next couple of days I am closing this

adam-fowler avatar Nov 08 '21 15:11 adam-fowler

I had no idea the Vapor Swift Docker images are not maintained, their documentation still recommends you use vapor/swift:5.2.

I switched to using the latest official Swift image, swift:5.5.1, and that fixed the issue.

Thanks for the very quick replies @adam-fowler ! 👏

CLoutas avatar Nov 08 '21 16:11 CLoutas

@CLoutas Thanks for the heads-up about the docs, I'll take care of updating that right now!

gwynne avatar Nov 08 '21 16:11 gwynne

No worries, thanks for looking into this, great to see that we got to the bottom of it so quickly! 👍

CLoutas avatar Nov 08 '21 16:11 CLoutas