Commit Graph

580 Commits

Author SHA1 Message Date
Allan Shortlidge
082f0ac4b5 Tests: Use a more natural spelling for ABI triple lit substitutions.
`%target-swift-5.8-abi-triple` instead of `%target-swift-abi-5.8-triple`, for
example.
2024-10-18 10:11:36 -07:00
Konrad `ktoso` Malawski
41d8962783 Revert "Revert "Revert "[Distributed] remote calls over-retain returned values""" 2024-10-04 06:53:43 +09:00
Konrad `ktoso` Malawski
f45f683f24 Merge pull request #76627 from swiftlang/revert-76623-revert-76595-wip-release-dist-execute-return 2024-10-03 19:15:59 +09:00
Konrad `ktoso` Malawski
62b04be2fa Revert "Revert "[Distributed] remote calls over-retain returned values"" 2024-09-21 14:50:35 +09:00
Konrad `ktoso` Malawski
9779137dc9 Revert "[Distributed] remote calls over-retain returned values" 2024-09-21 13:58:43 +09:00
Konrad `ktoso` Malawski
a12420a739 [Distributed] Must deinitialize return value of remoteCall
resolves rdar://136338200
resolves rdar://136313477
2024-09-20 14:33:46 +09:00
Konrad `ktoso` Malawski
2fd6f0043c add more experimental IsolatedDeinit flags to tests 2024-09-18 13:16:10 +09:00
Konrad `ktoso` Malawski
a6bc0e6759 temporary -experimental flag for IsolatedDeinit 2024-09-18 12:52:37 +09:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Mykola Pokhylets
56fca2ad26 Fixed test/Distributed/Runtime/distributed_actor_deinit.swift in optimized mode 2024-09-03 09:47:13 +02:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Pavel Yaskevich
d87be5a9db Merge pull request #75763 from xedin/rdar-132714652-disable-on-remote
[Tests/Distributed] NFC: `distributed_actor_protocol_call_resilient_l…
2024-08-08 00:20:38 -07:00
Pavel Yaskevich
343e0c7228 [Tests/Distributed] NFC: distributed_actor_protocol_call_resilient_lib test cannot be run remotely
The test depends on dynamic libraries that a rebuilt on the host
and are not transferred to the remote machine.

Resolves: rdar://132714652
2024-08-07 15:51:48 -07:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Konrad `ktoso` Malawski
4c3fa03588 [Distributed] Test for distributed protocols + method defaults (#75609) 2024-08-01 00:23:59 -07:00
Konrad `ktoso` Malawski
1869174cb5 Harden new distributed_actor_protocol_call_resilient_lib test for lib search paths (#75561) 2024-07-30 22:37:55 +09:00
Konrad `ktoso` Malawski
eb675c222e [Distributed] Correct tbd handling for distributed thunks (#74935) 2024-07-26 16:52:18 +09:00
Konrad `ktoso` Malawski
96c5d836ce [Distributed] Map into context computed property result type for SerReq checking (#75467) 2024-07-25 23:31:08 +09:00
Konrad `ktoso` Malawski
e53cd7d079 [Distributed] Handle #isolation param in DA as known to not cross isolation (#75327)
The isolation checker was assuming that one can only be isolated to a
specific var, but that's not true for distributed actors -- because the
default parameter emitted by #isolation is a method call -- converting
the self into an any Actor.

We must handle this in isolation checker in order to avoid thinking
we're crossing isolation boundaries and making methods implicitly async
etc, when we're actually not.

resolves rdar://131874709
2024-07-19 09:47:24 +09:00
Mykola Pokhylets
1304f81a04 Fixed CI builds 2024-07-11 21:54:43 +02:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
e9173ff2f4 Make sure legacy executor checking mode is always used in swift_task_deinitOnExecutor() 2024-07-11 13:09:08 +02:00
Mykola Pokhylets
4d0b624866 Make deinit non-isolated by default
Failing: Distributed/Runtime/distributed_actor_deinit.swift
2024-07-11 13:09:08 +02:00
Mykola Pokhylets
9dcea15d21 Fixed tests on Linux, Windows and older MacOS versions 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
7505cd20dd Updated unit tests 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
35f0334eb6 Rename performOnExecutor into deinitOnExecutor.
It cannot be used for executing general-purpose work, because such function would need to have a different signature to pass isolated actor instance.

And being explicit about using this method only for deinit allows to use object pointer for comparison with executor identity.
2024-07-11 13:09:07 +02:00
Mykola Pokhylets
5437b31cf3 Expanded test for SIL for distributed actor deinit, added isolated cases 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
c28df0dc05 Don't isolate deinit of remote actor proxies 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
b4a1aab20d Updated Distributed/Runtime/distributed_actor_deinit.swift to check for isolation 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
62dbc6c966 Fixed some tests. Using extract_executor SIL instruction instead of custom code. 2024-07-11 13:09:06 +02:00
Tim Kientzle
4470ed71ac Update executor test
The test previously checked for a message that is no longer
emitted.  Drop it.
2024-07-09 13:31:49 -07:00
Michael Gottesman
474aa47732 [concurrency] Standardize sending of non-isolated -> nonisolated to match the keyword 'nonisolated'.
rdar://130827967
2024-06-29 18:09:38 -07:00
Michael Gottesman
d28eef2d62 [sending] Convert the TaskGroup APIs 2024-06-21 06:11:17 -07:00
Holly Borla
4bec599931 Merge pull request #74543 from hborla/promote-isolated-any
[Features] Promote `IsolatedAny` and its alias to a language feature.
2024-06-19 10:32:30 -07:00
Holly Borla
966269d31a [Features] Promote IsolatedAny and its alias to a language feature.
The proposal is accepted and implemented for Swift 6.0.
2024-06-18 22:09:16 -07:00
Konrad `ktoso` Malawski
c42ecb0908 [Distributed] Remove "Stdlib" in macro as it is not understood in user code (#74417) 2024-06-14 23:03:33 +09:00
Konrad `ktoso` Malawski
e650dc00df [Distributed] Distributed thunks take parameters as 'sending'
This is in order to avoid errors in complete concurrency checking mnode
in distributed funcs, or rather their thunks, as there is isolation
boundary crossing happening when we pass a value to a distributed func.

This is because as we do this, we pass it to a nonisolated thunk:

```
nonisolated func THUNK(param: Thing) {
  if remote {
    ...
  } else {
    await self.realFunc(param)
  }
}
```

So what happens here is that the Thing would become isolated to the
task and we get a bad isolation crossing as we pass it along to the
"real func".

Sending values into the distributed thunk is the right thing to do to
resolve this problem: `nonisolated func THUNK(param: sending Thing) {}`

Resolves rdar://126577527
2024-06-06 12:32:47 +09:00
Holly Borla
135e3f2ee9 Merge pull request #73889 from hborla/deprecate-anyactor
[Concurrency] Deprecate `AnyActor`.
2024-05-30 09:36:35 -07:00
Holly Borla
c20b0e0956 [Concurrency] Obsolete AnyActor in Swift 6 using a typealias. 2024-05-29 22:59:19 -07:00
Konrad `ktoso` Malawski
168bc7b454 [Concurrency] Fix how we obtain DA-as-A conformance for cross module
Resolves rdar://127206143
2024-05-28 13:37:21 +09:00
Holly Borla
8417f51061 Merge pull request #73897 from hborla/fix-ptrauth-test-failure
[NFC] Fix a distributed actor test failure due to IRGen ptrauth differences.
2024-05-24 16:09:00 -07:00
Holly Borla
0773c832f2 Merge pull request #73877 from hborla/non-sendable-isolated-any
[Concurrency] `@isolated(any)` does not imply `@Sendable`.
2024-05-24 16:01:47 -07:00
Holly Borla
0e7ad76416 [NFC] Fix a distributed actor test failure due to IRGen ptrauth differences. 2024-05-24 13:09:48 -07:00
Holly Borla
1011e4ddb0 [Concurrency] Only deprecate AnyActor, and update more tests.
Obsoleting `AnyActor` in Swift 6 blocks the Concurrency library itself
from migrating to Swift 6, because `Actor` and `DistributedActor` have to
preserve their refinement of `AnyActor` to avoid breaking code currently
using the marker protocol. There's no way to move protocol refinement into
an extension so that the use-site declaration can be obsoleted, so we're
stuck with just the deprecation of `AnyActor`.
2024-05-24 12:58:02 -07:00
Holly Borla
8d6f16ef4b [Concurrency] @isolated(any) does not imply @Sendable. 2024-05-24 12:22:01 -07:00
Doug Gregor
5a0e70a2bc Update diagnostic text to address code review feedback 2024-05-20 22:06:40 -07:00
Doug Gregor
640042f396 Suggest @preconcurrency on conformances it could help
When diagnosing a case where an actor-isolated witness cannot satisfy
a non-isolated requirement, also suggest that the conformance could be
annotated with `@preconcurrency`.
2024-05-20 22:06:40 -07:00
Konrad `ktoso` Malawski
344f91ad73 [Distributed] dont crash when concrete system is invalid/missing type 2024-05-17 15:34:16 +09:00
Konrad `ktoso` Malawski
66e311074b Merge pull request #73635 from ktoso/wip-relax-macro-diagnostics 2024-05-15 21:01:49 +09:00