Remove inlinable from init() to support library evolution on linux #294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: swiftlang/swift#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.