-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Metadata and runtime support for checking isolated conformances at runtime #79785
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
DougGregor
merged 13 commits into
swiftlang:main
from
DougGregor:isolated-conformances-metadata-runtime
Mar 9, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
951b535
Metadata and runtime support for checking isolated conformances at ru…
DougGregor 5b6aff7
Test case fixes for isolated conformances
DougGregor c266a09
[Isolated conformances] Check witness tables for conditional requirem…
DougGregor 6dd141a
Replace dlsym of swift_task_isCurrentGlobalActor with a constructor hook
DougGregor 48aa75d
[Isolated conformances] Cache resolved global actor for conformances
DougGregor 296e146
Rework runtime entrypoints for isolated conformance checking
DougGregor 8ef9f7f
[WebAssembly] Temporarily work around lack of __attribute__((construc…
DougGregor 904d0cf
Generalize FileCheck'ing of IRGen testcase slightly
DougGregor d7f6876
Revert "[WebAssembly] Temporarily work around lack of __attribute__((…
DougGregor f54791b
[WebAssembly] Disable the runtime test for isolated conformances
DougGregor 313a099
Fixup ABI test
DougGregor a099c69
Disable test on WebAssembly harder
DougGregor d9ed5d9
Generalize IRGen test yet more
DougGregor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ok when the new
isIsolatingCurrentContext
I'm working on lands this will actually work then. Should be fine without changes I think (tho today it'll crash on not-isolated-to-the-expected-thing, which is expected). When run against an old runtime this must expect a potential of a crash basically I think, but in new runtimes it'll be good.// ongoing discussions about how to roll out that new check with backwards compat etc.
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.
None of the code that would call this entry point back-deploys, so I think it's safe from crash-if-not-expected. If we did try to back-deploy, yeah, it would be a problem.
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.
There's more to that though; Say there's someone's custom executor impl; they did implement
checkIsolated
, they did not implement the newis...
API. We check_taskIsCurrentExecutor
against it; we have no choice (well we can debate what we should do), but to call the only "check" implementation we have -- the crashing one that the developer implemented. So regardless of backdeployment or not, these may crash if people only implemented thecheck...
APIs.If that happens, we should be telling people to instead implement the new in 6.2 isIsolatingCurrentContext and it'll stop crashing, but it's something to be aware of.
There's a big flowchart of what can get called when in swiftlang/swift-evolution#2716 -- we can come up with some other more drastic policy that we'd ignore implemented check methods but that's pretty dramatic... Anyway, something to be aware of as we discuss semantics of swiftlang/swift-evolution#2716
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.
Main executor has a bunch of special case sugar so it'll be fine; but this may come up for global actors on custom executors... there's probably pretty few of them so we may choose to not worry about this too much and just "if it blows up, update your impl" which is probably good enough, just highlighting that it's an issue that'll happen eventually