Skip to content

[Serialization] Drop extensions whose base type can't be deserialized. #11323

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

Merged

Conversation

jrose-apple
Copy link
Contributor

This shows up with swift_wrapper typedefs, which get imported into Swift as structs. If someone makes an extension of a swift_wrapper type, but the swift_wrapper is only applied in Swift 4 mode, that extension will break any Swift 3 clients. Recover by just dropping the extension entirely.

There's still more complexity around extensions—what if a requirement can't be deserialized? what if something's depending on the protocol conformance provided by the extension?—but the missing base type case should be pretty safe. If you can't see the type at all, things that depend on its conformances are already in trouble.

rdar://problem/33636733

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 31e29c0c25f49bb816db6bc2464456e2eb4a3fc6
Test requested by - @jrose-apple

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 31e29c0c25f49bb816db6bc2464456e2eb4a3fc6
Test requested by - @jrose-apple

This shows up with swift_wrapper typedefs, which get imported into
Swift as structs. If someone makes an extension of a swift_wrapper
type, but the swift_wrapper is only applied in Swift 4 mode, that
extension will break any Swift 3 clients. Recover by just dropping
the extension entirely.

There's still more complexity around extensions---what if a
requirement can't be deserialized? what if something's depending on
the protocol conformance provided by the extension?---but the missing
base type case should be pretty safe. If you can't see the type at
all, things that depend on its conformances are already in trouble.

rdar://problem/33636733
@jrose-apple jrose-apple force-pushed the extension-recovery-extension branch from 31e29c0 to 78c1e8c Compare August 3, 2017 18:05
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 31e29c0c25f49bb816db6bc2464456e2eb4a3fc6
Test requested by - @jrose-apple

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 31e29c0c25f49bb816db6bc2464456e2eb4a3fc6
Test requested by - @jrose-apple

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this makes sense. Thanks

@jrose-apple jrose-apple merged commit 35f8e17 into swiftlang:master Aug 3, 2017
@jrose-apple jrose-apple deleted the extension-recovery-extension branch August 3, 2017 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants