Open 2horse9sun opened 1 week ago
Thanks for this ticket!
I'm a little bit surprised to hear you're compiling with library evolution mode on Linux. Swift's ABI is not stable on Linux, and so there is no promise that library evolution mode does anything at all. Can you elaborate a bit on what you're trying to achieve?
Motivation:
I'm currently working on a swift package project which depends on the swift-crypto library. The package is distributed to other teams and built on multiple platforms (macos + linux). Most importantly, the package is required to enable swift library evolution.
However, after the library evolution is enabled, the linux build failed with following error:
The above error can be easily reproduced by:
swift build -c release -Xswiftc -emit-module-interface -Xswiftc -enable-library-evolution
Modifications:
After some investigation on this error, I found a useful github issue that may be relevant: https://github.com/swiftlang/swift/issues/62507
As shown in the issue discussion:
Therefore, I just remove "inlinable" from init() of three structs.
Result:
After the modification, it successfully builds on Linux. (At least fix my problem :)
But feel free to give more suggestions on how to support library evolution in the long term instead of just removing these 'inlinable'. Somehow I feel like it's not elegant enough.