-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add deserialization support for section attribute #71588
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
Alternatively, should the |
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test?
@eeckstein is there a convention for testing deserialization? The way I would construct a test is to serialize a swiftmodule containing the section attribute, and then load it from a separate invocation. If the loading crashes, the test fails. |
Yes. You can look at some examples in https://github.com/apple/swift/tree/main/test/Serialization, for example https://github.com/apple/swift/blob/main/test/Serialization/attr-extern.swift |
@swift-ci test |
@swift-ci test linux |
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@swift-ci test macOS |
@swift-ci test linux |
@swift-ci test macOS |
Introduces the first use of `@_DebugDescription` in the standard library, applying it to `ObjectIdentifier`. In order to use the DebugDescription macro in the stdlib, the following changes are required: 1. Compilation must reference the just built macros (ie `libSwiftMacros.dylib`), not those from the SDK. This is addressed by adding an explicit `-external-plugin-path` flag that overrides the defaults generated by the compiler (which uses SDK paths, where the macro may or may not exist, and may not be the current version). 2. As DebugDescription uses `@_section`, compilation enables the `SymbolLinkageMarkers` feature. Note that the use of DebugDescription is conditionally enabled for the following reasons: 1. Use is disabled in freestanding builds, where the stdlib macros are not built. 2. Use is temporarily disabled in Linux builds due to a dynamic loader issue that needs further investigation The dynamic loader error causing issues with Linux CI is: > swift-plugin-server: error while loading shared libraries: libswiftGlibc.so: cannot open shared object file: No such file or directory This PR depended on #71639, #71588, and #71685.
While working on #71425, I hit an assert indicating the
@_section
attribute was not handled inDeclDeserializer::deserializeDeclCommon
. This change adds the missing deserialization for the@_section
attribute.