-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] correct take semantics for synthesized ID assignments #63779
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
cleanup: no need to dump input always
@swift-ci please smoke test |
700bc18
to
7ecfc82
Compare
} | ||
someField = try getSomeClass() | ||
} | ||
|
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.
This adds a test for a class based actor system which was a thing we didn't cover well, but in the real world most systems will be; This is the same as the other sil_n tests but for a class.
@@ -209,7 +209,7 @@ void SILGenFunction::emitDistActorIdentityInit(ConstructorDecl *ctor, | |||
{ temp, selfMetatypeValue }); | |||
|
|||
// --- initialize the property. | |||
initializeProperty(*this, loc, borrowedSelfArg, var, temp); |
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.
The issue was here, so changing to take here is correct, but the other sites want to remain not-take.
Thanks @eeckstein and @drexin for the pointers !
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 please smoke test |
/// | ||
/// By adding the `Any` we don't know the full size of the struct making the type in SIL `$*ActorAddress` | ||
/// when we try to store or pass it around, which triggers `isAddressOnly` guarded paths which we need to test. | ||
public struct NotLoadableActorAddress: Hashable, Sendable, Codable { |
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.
The important bit to reproduce the issue
b92995a
to
629ac65
Compare
Added another test that exercises the AddressOnly case as well. |
@swift-ci please smoke test and merge |
Resolves #62898
Resolves rdar://104583893
This is a surprising regression because it always was wrong, but only started failing in recent toolchains where this started getting verified.
I'll also wok on getting distributed cluster into the source compat build, which we didn't complete for some reason before: swiftlang/swift-source-compat-suite#730 which would have likely caught this when the toolchain changed to detect this wrong lifetime.
I also confirmed this works on the reproducer steps, targeting swift-distributed actors
main
and indeed this started failing but used to somehow sneakily still pass on older toolchains:git clone https://github.com/apple/swift-distributed-actors.git
export SWIFT_EXEC=$HOME/code/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swiftc
swift run --package-path Samples/Sources/SampleDiningPhilosophers
echo $SWIFT_EXEC; echo; echo; /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-02-18-a.xctoolchain/usr/bin/swift run --package-path Samples/Sources/SampleDiningPhilosophers