Commit Graph

7 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
cedcd4afc6 [Distributed] enable additional testing in library evolution mode
We had a number of problems either "only in" or "only without" library
evolution and protocols, so in order to increase the test coverage, run
a few of the crucial tests in both modes.
2025-06-06 07:06:11 +09:00
Konrad 'ktoso' Malawski
30d54531a7 [Distributed] Don't drop dist get accessors from witness tables.
This actually manifested as an pointer auth crash, but the real reason
being is that we messed up the order of elements in the witness table.
If we'd skip the accessor like this, the types we sign/auth with would
no longer align and manifest in a crash.

There is no real reason to skip this entry so we just bring it back, and
avoid making this special in any way.

This unlocks a few tests as well as corrects any distributed+protocol
use where a requirement distributed var was _followed by_ other
requirements.

resolves rdar://125628060
2025-06-05 16:58:00 +09:00
Konrad `ktoso` Malawski
f48384bc7e [Distributed] Correct distributed accessor mangling for protocol calls
This is a crucial fix without which we can crash on some distributed
protocol declarations with @Resolvable. We cannot "just" use a String to
represent the "fake base" of the thunks, and must instead find the
$Target macro generated type and use it as the base of the thunk's
mangling.

Calls are made in such way that record for the protocol requirement:
`$s4main28GreeterDefinedSystemProtocolP5greetSSyYaKFTEHF` points at
`$$s4main29$GreeterDefinedSystemProtocolC5greetSSyYaKFTE` which makes a
dispatch through the _apropriate_ witness table.
And the record for the $witness named e.g.
`$s4main29$GreeterDefinedSystemProtocolC5greetSSyYaKFTEHF` points to
`$s4main28GreeterDefinedSystemProtocolPAA11Distributed01_F9ActorStubRzrlE5greetSSyYaKFTE`
which is an extension method: `distributed thunk (extension in main):main.GreeterDefinedSystemProtocol< where A: Distributed._DistributedActorStub>.greet() async throws -> Swift.String`,
this very specific design allows us to call the "right method" on the
recieving end of a remote call where we do not know the recipient type.
2024-12-03 14:59:15 +09:00
Pavel Yaskevich
e6b445b8d1 [SE-0428] NFC: Rename _DistributedProtocol macro into Resolvable
The proposal was [accepted with modifications](https://forums.swift.org/t/accepted-with-modifications-se-0428-resolve-distributedactor-protocols/71366)

The decision was made to change the spelling of the attached macro
in the proposal from @DistributedProtocol to `@Resolvable`
(or `@Distributed.Resolvable` if disambiguation is needed).
2024-04-22 14:18:11 -07:00
Meghana Gupta
afb65c2cdd Disable some distributed actor tests on arm64e 2024-04-09 11:00:12 -07:00
Konrad `ktoso` Malawski
6132386371 [Distributed] Complete handling of protocol calls and witnesses using adjusted mangling scheme (#72416) 2024-03-23 23:54:23 +09:00
Konrad `ktoso` Malawski
27702fa115 [Distributed][Macro] Handle more cases in distributed protocol macro (#72177) 2024-03-12 02:12:31 -07:00