Skip to content

IRGen: Weak-link references to swift_getExtendedExistentialTypeMetadata() #69459

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

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Oct 27, 2023

Fixes rdar://117530421 and (probably) #64657.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -0,0 +1,13 @@
// RUN: %target-swift-frontend -emit-ir %s -target arm64-apple-macos12 | %FileCheck %s
Copy link
Contributor

@tshortli tshortli Oct 27, 2023

Choose a reason for hiding this comment

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

Nit: %target-cpu-apple-macos12 would make this test run without building a bunch of modules on x86_64. Even, better %target-swift-abi-5.5-triple and using @available(SwiftStdlib 5.7, *) instead of @available(macOS 13, *) in the body would allow this to run on REQUIRES: VENDOR=apple instead of just macOS

@slavapestov slavapestov force-pushed the fix-extended-existential-metadata-weak branch from 0ae3ab4 to c9c0572 Compare October 27, 2023 21:36
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

@slavapestov slavapestov merged commit 3b51407 into swiftlang:main Oct 28, 2023
FranzBusch added a commit to FranzBusch/swift-nio that referenced this pull request Nov 14, 2023
# Motivation
We have reverted the typed HTTP protocol upgrader pieces since adopters were running into a compiler bug (swiftlang/swift#69459) that caused the compiler to emit strong references to `swift_getExtendedExistentialTypeMetadata`. The problem is that `swift_getExtendedExistentialTypeMetadata` is not available on older runtimes before constrained existentials have been introduced. This caused adopters to run into runtime crashes when loading any library compiled with this NIO code.

# Modifications
This PR reverts the revert and guard all new code in a compiler guard that checks that we are either on non-Darwin platforms or on a new enough Swift compiler that contains the fix.

# Result
We can offer the typed HTTP upgrade code to our adopters again.
FranzBusch added a commit to FranzBusch/swift-nio that referenced this pull request Nov 15, 2023
# Motivation
We have reverted the typed HTTP protocol upgrader pieces since adopters were running into a compiler bug (swiftlang/swift#69459) that caused the compiler to emit strong references to `swift_getExtendedExistentialTypeMetadata`. The problem is that `swift_getExtendedExistentialTypeMetadata` is not available on older runtimes before constrained existentials have been introduced. This caused adopters to run into runtime crashes when loading any library compiled with this NIO code.

# Modifications
This PR reverts the revert and guard all new code in a compiler guard that checks that we are either on non-Darwin platforms or on a new enough Swift compiler that contains the fix.

# Result
We can offer the typed HTTP upgrade code to our adopters again.
FranzBusch added a commit to FranzBusch/swift-nio that referenced this pull request Nov 15, 2023
# Motivation
We have reverted the typed HTTP protocol upgrader pieces since adopters were running into a compiler bug (swiftlang/swift#69459) that caused the compiler to emit strong references to `swift_getExtendedExistentialTypeMetadata`. The problem is that `swift_getExtendedExistentialTypeMetadata` is not available on older runtimes before constrained existentials have been introduced. This caused adopters to run into runtime crashes when loading any library compiled with this NIO code.

# Modifications
This PR reverts the revert and guard all new code in a compiler guard that checks that we are either on non-Darwin platforms or on a new enough Swift compiler that contains the fix.

# Result
We can offer the typed HTTP upgrade code to our adopters again.
FranzBusch added a commit to FranzBusch/swift-nio that referenced this pull request Nov 15, 2023
# Motivation
We have reverted the typed HTTP protocol upgrader pieces since adopters were running into a compiler bug (swiftlang/swift#69459) that caused the compiler to emit strong references to `swift_getExtendedExistentialTypeMetadata`. The problem is that `swift_getExtendedExistentialTypeMetadata` is not available on older runtimes before constrained existentials have been introduced. This caused adopters to run into runtime crashes when loading any library compiled with this NIO code.

# Modifications
This PR reverts the revert and guard all new code in a compiler guard that checks that we are either on non-Darwin platforms or on a new enough Swift compiler that contains the fix.

# Result
We can offer the typed HTTP upgrade code to our adopters again.
FranzBusch added a commit to apple/swift-nio that referenced this pull request Nov 15, 2023
* Revert "Back out new typed HTTP protocol upgrader (#2579)"

# Motivation
We have reverted the typed HTTP protocol upgrader pieces since adopters were running into a compiler bug (swiftlang/swift#69459) that caused the compiler to emit strong references to `swift_getExtendedExistentialTypeMetadata`. The problem is that `swift_getExtendedExistentialTypeMetadata` is not available on older runtimes before constrained existentials have been introduced. This caused adopters to run into runtime crashes when loading any library compiled with this NIO code.

# Modifications
This PR reverts the revert and guard all new code in a compiler guard that checks that we are either on non-Darwin platforms or on a new enough Swift compiler that contains the fix.

# Result
We can offer the typed HTTP upgrade code to our adopters again.

* Add compiler guards
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.

2 participants