Mark configuration setting closure as sending#1224
Merged
ktoso merged 1 commit intoapple:mainfrom Oct 16, 2025
Merged
Conversation
ktoso
approved these changes
Sep 26, 2025
Contributor
Author
|
hm, seems like CI now using 6.2 (swift62noble) and swift format slightly changed, had re-run formatting once with Swift 6.2 and pushed |
akbashev
commented
Sep 29, 2025
Comment on lines
+134
to
+138
| handleSignal: | ||
| @escaping @Sendable ( | ||
| _ActorContext<Message>, | ||
| _Signal | ||
| ) async throws -> _Behavior<Message> |
Contributor
Author
There was a problem hiding this comment.
swift format change
Fix format check updated sample to swift 6 make v5 specific for package enabled strict memory safety back to just unwrapping optional let's just use simple formatted Date.now formatting fix
37c903a to
b6339e9
Compare
akbashev
commented
Oct 13, 2025
Comment on lines
+56
to
+59
| .iOS(.v17), | ||
| .macOS(.v15), | ||
| .tvOS(.v17), | ||
| .watchOS(.v10), |
Contributor
Author
There was a problem hiding this comment.
Increased to run on Mac
akbashev
commented
Oct 13, 2025
| @@ -1,4 +1,4 @@ | |||
| // swift-tools-version:5.9 | |||
| // swift-tools-version:6.0 | |||
Contributor
Author
There was a problem hiding this comment.
Aligned with cluster system
akbashev
commented
Oct 13, 2025
Comment on lines
-132
to
+134
| var buffer = [Int8](repeating: 0, count: 255) | ||
| var timestamp = time(nil) | ||
| let localTime = localtime(×tamp) | ||
| // This format is pleasant to read in local sample apps: | ||
| strftime(&buffer, buffer.count, "%H:%M:%S", localTime) | ||
| // The usual full format is: | ||
| // strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime) | ||
| return buffer.withUnsafeBufferPointer { | ||
| $0.withMemoryRebound(to: CChar.self) { | ||
| String(cString: $0.baseAddress!) | ||
| } | ||
| } | ||
| Date.now.formatted(date: .omitted, time: .standard) |
Contributor
Author
There was a problem hiding this comment.
Not sure but seems like starting Swift 6.2 localtime(×tamp) returns optional UnsafeMutablePointer? on Linux, while for Darwin it's UnsafeMutablePointer!
Guess simple date formatting will work here.
Contributor
Author
|
@ktoso there was ongoing issues with Dining philosophers sample test, fixed it. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
Configuring cluster system on main actor (whoever needs this) using configuration closure init leads to compiler error
Sending value of non-Sendable type '(inout ClusterSystemSettings) -> Void' risks causing data races.Modifications:
As library already been updated to Swift 6 and ClusterSystemSettings is not used outside configuration closure — feels like marking closure as sending is more suitable than using Sendable conformance.
Result:
Additional information
There are other same type closures in the system, but as they're not exposed to outside world — will be fixed during refactoring.