Closed compnerd closed 2 years ago
@jpsim this is likely something which is going to require some uglish workarounds for older versions of Swift. What do you think is the best way forward with such a change?
@jpsim ping?
this is likely something which is going to require some uglish workarounds for older versions of Swift
More specifically, looks like this would bump the minimum version of Swift supported when building Yams to Swift 5.4, which was released 9 months ago. That seems like an acceptable amount of time to support older Swift versions to me.
Would you like to handle the removal of Swift < 5.4 CI jobs & code, or shall I?
Started working on bumping the minimum supported Swift version here: https://github.com/jpsim/Yams/pull/347
I can take a stab at the codepaths for the older releases (if any) once the CI support is there.
I can take a stab at the codepaths for the older releases (if any) once the CI support is there.
Not sure what you mean, I don't think there will be code changes needed for Swift 5.4/5.5.
Not sure what you mean, I don't think there will be code changes needed for Swift 5.4/5.5.
Ah right; there is only a single location (Tests/YamsTest/TopLevelDecoderTests.swift) that has a check for something other than 5.6.
@compnerd please rebase to get the changes from https://github.com/jpsim/Yams/pull/347 to require Swift 5.4.
Thanks @compnerd. Do you need me to tag a release?
That would be great - hopefully then I should be able to get this integrated into the swift-driver build.
Release tagged: https://github.com/jpsim/Yams/releases/tag/5.0.0
This changes how
CYaml
is built and used within Yams. As there are no interfaces fromCYaml
being directly exposed, we can statically link the library. However, this still would cause a problem as theCYaml
import would be serialized into the module requiring that the module is available when building anything which consumesYams
. To avoid that, change theimport CYaml
instances to@_implementationOnly
. This allows forCYaml
to not be required at the consumer site.While in the area of the CMake build system, clean up some of the build system to use language specific options. This is required to avoid the de-duplication of the options across languages and enables linking
CYaml
statically into the library. Note that on Windows static linking of Swift libraries is not yet properly supported and this does not enable that nor use that - it is statically linking C content.This now allows building Yams dynamically as a single library target. On Windows, this is a negligible space savings of ~16KiB.