Skip to content

Conversation

@mikeash
Copy link
Contributor

@mikeash mikeash commented Dec 14, 2018

Old Swift and new Swift runtimes and overlays need to coexist in the same process. This means there must not be any classes which have the same ObjC runtime name in old and new, because the ObjC runtime doesn't like name collisions.

When possible without breaking source compatibility, classes were renamed in Swift, which results in a different ObjC name.

Public classes were renamed only on the ObjC side using the @_objcRuntimeName attribute.

This is similar to the work done in pull request #19295. That only renamed @objc classes. This renames all of the others, since even pure Swift classes still get an ObjC name.

rdar://problem/46646438

@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from 21af72b to b3fbb55 Compare December 14, 2018 22:02
@mikeash
Copy link
Contributor Author

mikeash commented Dec 14, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b3fbb55d3271a363a7df2bf09bd874166071cfc5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b3fbb55d3271a363a7df2bf09bd874166071cfc5

@mikeash
Copy link
Contributor Author

mikeash commented Dec 17, 2018

@swift-ci please test

@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from b3fbb55 to 6b8f42a Compare December 17, 2018 21:27
@mikeash
Copy link
Contributor Author

mikeash commented Dec 17, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b3fbb55d3271a363a7df2bf09bd874166071cfc5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b3fbb55d3271a363a7df2bf09bd874166071cfc5

@mikeash
Copy link
Contributor Author

mikeash commented Dec 18, 2018

apple/swift-lldb#1154

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6b8f42a6bb709eb6d1f17b52a4554354e4a2aa96

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6b8f42a6bb709eb6d1f17b52a4554354e4a2aa96

@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from d23a617 to 0a28ad3 Compare December 20, 2018 17:23
@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

Helps to push ALL of the changes made to resolve the merge....

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d23a6174aa91f1ad71e52a824338085d8af6dce9

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d23a6174aa91f1ad71e52a824338085d8af6dce9

@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

Also helps to test with the other PR it needs, sigh.

@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

apple/swift-lldb#1154

@swift-ci please test

lib/AST/Attr.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unfortunate since sometimes a regular developer can write this as @objc. Maybe we should have a flag that preserves the original spelling?

Copy link
Contributor

Choose a reason for hiding this comment

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

(That can come separately.)

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0a28ad3fb09a2b7f0b864b4a12d6b7446a65eb32

@mikeash
Copy link
Contributor Author

mikeash commented Dec 20, 2018

apple/swift-lldb#1154

@swift-ci please test linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0a28ad3fb09a2b7f0b864b4a12d6b7446a65eb32

@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from 0a28ad3 to c5b2bcb Compare December 21, 2018 16:08
@mikeash
Copy link
Contributor Author

mikeash commented Dec 21, 2018

apple/swift-lldb#1154

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0a28ad3fb09a2b7f0b864b4a12d6b7446a65eb32

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0a28ad3fb09a2b7f0b864b4a12d6b7446a65eb32

Copy link
Contributor

Choose a reason for hiding this comment

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

This one didn't need to be renamed because it's new? (And the same for the Set one.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out yes, but I (correctly) missed it by accident, so that's bad.

@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from 47b11c2 to 862cdea Compare December 21, 2018 21:45
@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from 862cdea to 4f0cd92 Compare January 15, 2019 15:37
…ames.

Old Swift and new Swift runtimes and overlays need to coexist in the same process. This means there must not be any classes which have the same ObjC runtime name in old and new, because the ObjC runtime doesn't like name collisions.

When possible without breaking source compatibility, classes were renamed in Swift, which results in a different ObjC name.

Public classes were renamed only on the ObjC side using the @_objcRuntimeName attribute.

This is similar to the work done in pull request swiftlang#19295. That only renamed @objc classes. This renames all of the others, since even pure Swift classes still get an ObjC name.

rdar://problem/46646438
…mes.

This avoids name conflicts between generic classes in the Swift modules of the old and new stdlibs when loaded into the same process.
@mikeash mikeash force-pushed the rename-avoid-objc-conflicts branch from 4f0cd92 to e07e1db Compare January 15, 2019 17:21
@mikeash
Copy link
Contributor Author

mikeash commented Jan 15, 2019

apple/swift-lldb#1154

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c5b2bcb4f86250e5240ab4464edd671610f46cc7

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c5b2bcb4f86250e5240ab4464edd671610f46cc7

@mikeash
Copy link
Contributor Author

mikeash commented Jan 15, 2019

apple/swift-lldb#1154

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e07e1db

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e07e1db

@mikeash mikeash merged commit 577e04d into swiftlang:master Jan 15, 2019
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