-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Non-package module should load swiftinterface instead of binary module with PackageCMO. #76338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci smoke test |
e8d9227
to
a483cdb
Compare
@swift-ci smoke test |
Can you move the The alternative would be like |
The correct approach is to load the same optimized binary module for use by external clients of the package. Therefore, I prefer to keep |
@swift-ci smoke test |
binary module with PackageCMO enabled. If the binary module optimized with Package CMO is loaded for a non-package client module, the client module does not understand the serialized content of the optimized binary module because it contains attributes and instructions specific to the optimization, i.e. [serialized_for_package] definition that contains operations on non-loadable types that are normally not allowed. This can cause an assert or a crash in SIL verifier. This PR checks whether the optimized binary module and the client module are in the same package, and require loading swiftinterface module if not. Resolves rdar://134584629
f1711c0
to
1261f2b
Compare
@swift-ci smoke test |
After further consideration, it seems more reasonable to implement the proper long-term fix stated above instead of relying on this interim solution, especially since there's already a workaround: pass |
If the binary module optimized with Package CMO is loaded for a non-package client module, the client module does not understand the serialized content of the optimized binary module because it contains attributes and instructions specific to the optimization, i.e. [serialized_for_package] definition that contains operations on non-loadable types that are normally not allowed. This can cause an assert or a crash in SIL verifier.
This PR checks whether the optimized binary module and the client module are in the same package, and require loading swiftinterface module if not.
Resolves rdar://134584629