Is Swift 5.5 ready for Linux?

Apple doesn't always release every Swift point update for macOS. Now that Xcode 13.3 has entered beta with Swift 5.6, it's unlikely they'll ever ship a new build of Xcode 13.2 with Swift 5.5.3 (even though they should). So don't worry about using 5.5.2 on macOS and 5.5.3 on Linux, there were only a few bugfixes in 5.5.3.

To get back to your first problem, you can add the settings it recommends to you package and only activate it when building on Linux.

let swiftSettings: [SwiftSetting]
#if os(Linux)
swiftSettings = [.unsafeFlags(["-Xfrontend", "-validate-tbd-against-ir=none"])]
#else
swiftSettings = []
#endif

Then pass it to your relevant target through the swiftSettings parameter.

1 Like