-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] Correct tbd handling for distributed thunks #74935
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
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c806d08
[Distributed] Correct tbd handling for distributed thunks
ktoso 6b7381f
remove un-necessary special handling distributed thunks in LinkEntity…
ktoso 272c1e5
[Distributed] Add runtime test with resilient protocol method call
ktoso 43a17f5
Disable test on Linux for now, problem with finding libs, we primarily
ktoso 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
117 changes: 117 additions & 0 deletions
117
test/Distributed/Runtime/distributed_actor_protocol_call_resilient_lib.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// RUN: %empty-directory(%t/src) | ||
// RUN: split-file %s %t/src | ||
|
||
/// Build the fake actor systems lib | ||
// RUN: %target-build-swift \ | ||
// RUN: -Xfrontend -disable-availability-checking \ | ||
// RUN: -parse-as-library -emit-library \ | ||
// RUN: -emit-module-path %t/FakeDistributedActorSystems.swiftmodule \ | ||
// RUN: -module-name FakeDistributedActorSystems \ | ||
// RUN: %S/../Inputs/FakeDistributedActorSystems.swift \ | ||
// RUN: -enable-library-evolution \ | ||
// RUN: -o %t/%target-library-name(FakeDistributedActorSystems) | ||
|
||
/// Build the Lib | ||
// RUN: %target-build-swift \ | ||
// RUN: -Xfrontend -disable-availability-checking \ | ||
// RUN: -parse-as-library -emit-library \ | ||
// RUN: -emit-module-path %t/ResilientLib.swiftmodule \ | ||
// RUN: -module-name ResilientLib \ | ||
// RUN: -I %t \ | ||
// RUN: -L %t \ | ||
// RUN: %t/src/ResilientLib.swift \ | ||
// RUN: -enable-library-evolution \ | ||
// RUN: -o %t/%target-library-name(ResilientLib) | ||
|
||
/// Build the ActorLib | ||
// RUN: %target-build-swift \ | ||
// RUN: -Xfrontend -disable-availability-checking \ | ||
// RUN: -parse-as-library -emit-library \ | ||
// RUN: -emit-module-path %t/ResilientActorLib.swiftmodule \ | ||
// RUN: -module-name ResilientActorLib \ | ||
// RUN: -I %t \ | ||
// RUN: -L %t \ | ||
// RUN: %t/src/ResilientActorLib.swift \ | ||
// RUN: -lFakeDistributedActorSystems \ | ||
// RUN: -lResilientLib \ | ||
// RUN: -enable-library-evolution \ | ||
// RUN: -o %t/%target-library-name(ResilientActorLib) | ||
|
||
/// Build the client | ||
// RUN: %target-build-swift \ | ||
// RUN: -Xfrontend -disable-availability-checking \ | ||
// RUN: -parse-as-library \ | ||
// RUN: -lFakeDistributedActorSystems \ | ||
// RUN: -lResilientLib \ | ||
// RUN: -lResilientActorLib \ | ||
// RUN: -module-name main \ | ||
// RUN: -I %t \ | ||
// RUN: -L %t \ | ||
// RUN: %s \ | ||
// RUN: -enable-library-evolution \ | ||
// RUN: -o %t/a.out | ||
|
||
// RUN: %target-codesign %t/a.out | ||
// RUN: %target-run %t/a.out | %FileCheck %s | ||
|
||
// REQUIRES: executable_test | ||
// REQUIRES: concurrency | ||
// REQUIRES: distributed | ||
|
||
// Locating the built libraries failed on Linux (construction of test case), | ||
// but we primarily care about macOS in this test | ||
// UNSUPPORTED: OS=linux-gnu | ||
|
||
// UNSUPPORTED: use_os_stdlib | ||
// UNSUPPORTED: back_deployment_runtime | ||
|
||
//--- ResilientLib.swift | ||
|
||
import Distributed | ||
|
||
public protocol SomeProtocol { | ||
func function() async throws -> String | ||
} | ||
|
||
//--- ResilientActorLib.swift | ||
|
||
import ResilientLib | ||
|
||
import Distributed | ||
import FakeDistributedActorSystems | ||
|
||
public distributed actor Impl: SomeProtocol { | ||
public typealias ActorSystem = FakeRoundtripActorSystem | ||
|
||
public distributed func function() async throws -> String { | ||
"Success!" | ||
} | ||
} | ||
|
||
//--- Main.swift | ||
|
||
import ResilientLib | ||
import ResilientActorLib | ||
|
||
import Distributed | ||
import FakeDistributedActorSystems | ||
|
||
@main struct Main { | ||
static func main() async { | ||
let system = FakeRoundtripActorSystem() | ||
|
||
print("start") | ||
|
||
let impl = Impl(actorSystem: system) | ||
|
||
let anyAct: any SomeProtocol = impl | ||
let anyReply = try! await anyAct.function() | ||
print("any reply = \(anyReply)") // CHECK: any reply = Success! | ||
|
||
let proxy: any SomeProtocol = try! Impl.resolve(id: impl.id, using: system) | ||
let proxyReply = try! await proxy.function() | ||
print("proxy reply = \(proxyReply)") // CHECK: proxy reply = Success! | ||
|
||
print("done") | ||
} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.