You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the binaries only work with Swift 5.4.2, specifically the one that comes with Xcode 12.5.1 (current stable Xcode):
Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
This is fine, as long as you use Xcode 12.5.1.
But if you attempt to link them with Swift code in the Xcode 13 beta, it errors out with:
... error: failed to build module 'CiteprocRsKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.29.102 clang-1300.0.28.1)'). Please select a toolchain which matches the SDK.
The text was updated successfully, but these errors were encountered:
rI think this is basically it -- the usual (but unstable) way would be to use @_exported import CiteprocRs, but it appears this doesn't work with module stability. Module stability is the thing needed to get compiled code compiled with one version of swiftc to work on a later version.
It appears to be the same as this: there is actually a second error, No such module 'CiteprocRs', which occurs within the .swiftinterface file on the line @_exported import CiteprocRs.
For now I think this might be impossible, so I will just track Xcode stable and just make a new breaking release when Apple releases 13.0. One swiftc version at a time.
Edit: the root cause is that we can't use @_implementationOnly (which does work with module stability), because we need to re-export a few very-tedious-to-rewrite-in-Swift enums, e.g. CiteprocRs.CRErrorCode.
I've figured this out, and can make this work with just SPM. The binary xcframework can be limited to just the Rust ffi library, if you build one manually with the correct lipo incantations and xcodebuild -create-xcframework. Then all the swift ABI/module stability issues simply disappear, as different swift compilers get access to the Swift source code.
I've also been testing it for usability and have some improvements to the JSON reference encoding part, I didn't realise Swift had Encodable/JSONEncoder.
At the moment, the binaries only work with Swift 5.4.2, specifically the one that comes with Xcode 12.5.1 (current stable Xcode):
This is fine, as long as you use Xcode 12.5.1.
But if you attempt to link them with Swift code in the Xcode 13 beta, it errors out with:
The text was updated successfully, but these errors were encountered: